]> git.ipfire.org Git - thirdparty/systemd.git/commit
test: make unit tests relocatable
authorMartin Pitt <martin@piware.de>
Sun, 12 Feb 2017 22:14:43 +0000 (23:14 +0100)
committerMartin Pitt <martin@piware.de>
Mon, 13 Feb 2017 21:31:13 +0000 (22:31 +0100)
commitf853c6efb509589c8e3a82caa3af2ac5a370ae97
tree4b5e46c4dfc6a9dfd701db8c29975d546b0b9ece
parentee3c7ff7c303cdbc8fea18d3a6f3c4c6e7c450d8
test: make unit tests relocatable

It is useful to package test-* binaries and run them as root under
autopkgtest or manually on particular machines. They currently have a
built-in hardcoded absolute path to their test data, which does not work
when running the test programs from any other path than the original
build directory.

By default, make the tests look for their data in
<test_exe_directory>/testdata/ so that they can be called from any
directory (provided that the corresponding test data is installed
correctly). As we don't have a fixed static path in the build tree (as
build and source tree are independent), set $TEST_DIR with "make check"
to point to <srcdir>/test/, as we previously did with an automake
variable.
Makefile.am
src/resolve/test-dns-packet.c
src/shared/tests.c
src/shared/tests.h
src/test/test-cgroup-mask.c
src/test/test-engine.c
src/test/test-execute.c
src/test/test-helper.h
src/test/test-path.c
src/test/test-sched-prio.c