Browse Source

ctest: show test output in case of failures

ctest as run by cmake by default does not show the output of the tests
even if the tests failed. In terms of our tests it could be handy to set
it always, but unfortunately it seems like cmake doesn't allow it if the
internet is to be believed, so lets enable it at least while building
packages and on travis.

Gbp-Dch: Ignore
tags/debian/1.3_rc2
David Kalnischkies 4 years ago
parent
commit
ecaae01f31
3 changed files with 7 additions and 3 deletions
  1. +1
    -1
      .travis.yml
  2. +4
    -2
      README.md
  3. +2
    -0
      debian/rules

+ 1
- 1
.travis.yml View File

@@ -16,7 +16,7 @@ before_script:
- ( mkdir build && cd build && cmake .. )
- make -C build -j4
script:
- make -C build test
- CTEST_OUTPUT_ON_FAILURE=1 make -C build test
- ./test/integration/run-tests -q
- sudo adduser --force-badname --system --home /nonexistent --no-create-home --quiet _apt || true
- sudo ./test/integration/run-tests -q


+ 4
- 2
README.md View File

@@ -115,8 +115,10 @@ itself as well as in conjunction with dpkg and other tools while working with pa

### Unit tests

These tests are gtest-dev based, reside in `./test/libapt` and can be run with `make test`.
They are executed at package build-time, but not by `make`.
These tests are gtest-dev based, executed by ctest, reside in `./test/libapt`
and can be run with `make test`. They are executed at package build-time, but
not by `make`. CTest by default does not show the output of tests, even if they
failed, so to see more details you can also run them with `ctest --verbose`.

Debugging
---------


+ 2
- 0
debian/rules View File

@@ -8,6 +8,8 @@ export DEB_BUILD_MAINT_OPTIONS := hardening=+all
# do not fail as we are just experimenting with symbol files for now
export DPKG_GENSYMBOLS_CHECK_LEVEL=0

export CTEST_OUTPUT_ON_FAILURE=1

%:
dh $@ --with systemd --parallel --buildsystem=cmake



Loading…
Cancel
Save