Commit Graph

3 Commits

Author SHA1 Message Date
Alex Kiernan
f07838fa08 build: create tests directory for split builds
When `--disable-dependency-tracking` is in effect with separate build
directory, the tests directory isn't created as a result of the
dependency generation, which leads to a build race for the tests
directory being created and failures:

  Making all in .
  make[2]: Entering directory 'TOPDIR/build/tmp/work/riscv64-yoe-linux-musl/ostree/2019.5-r0/build'
  (echo '[Test]' > tests/test-local-pull-depth.sh.test.tmp; \
  echo 'Type=session' >> tests/test-local-pull-depth.sh.test.tmp; \
  echo 'Exec=env G_TEST_SRCDIR=/usr/libexec/installed-tests/libostree G_TEST_BUILDDIR=/usr/libexec/installed-tests/libostree /usr/libexec/installed-tests/libostree/test-local-pull-depth.sh' >> tests/test-local-pull-depth.sh.test.tmp; \
  mv tests/test-local-pull-depth.sh.test.tmp tests/test-local-pull-depth.sh.test)
  /bin/sh: tests/test-local-pull-depth.sh.test.tmp: No such file or directory
  /bin/sh: line 1: tests/test-local-pull-depth.sh.test.tmp: No such file or directory
  /bin/sh: line 2: tests/test-local-pull-depth.sh.test.tmp: No such file or directory
  mv: cannot stat 'tests/test-local-pull-depth.sh.test.tmp': No such file or directory
  make[2]: *** [Makefile:9282: tests/test-local-pull-depth.sh.test] Error 1

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-11-08 06:51:36 +00:00
Philip Withnall
56188808b4 build: Use AM_TESTS_ENVIRONMENT rather than TESTS_ENVIRONMENT
TESTS_ENVIRONMENT is reserved for the user to be able to set when
running the tests. AM_TESTS_ENVIRONMENT is for the tests’ Makefile to
set itself.

https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #880
Approved by: cgwalters
2017-05-23 17:51:27 +00:00
Colin Walters
d25212f04a tests: Port to glib-tap.mk, make make check run all of the tests
OSTree's code for testing predates the `glib-tap.mk` making its
way into GLib.  Let's switch to it, as it provides a number
of advantages.

By far the biggest advantage is that `make check` can start to run
most of the tests *in addition* to having them work installed.

This commit keeps the installed tests working, but `make check` turns
out to be really broken because...our TAP usage has bitrotted to say
the least.  Fix that all up.

Do some hacks so that the tests work uninstalled as well - in
particular, `glib-tap.mk` and the bits encoded into
`g_test_build_filename()` assume *recursive* Automake (blah).  Work
around that by creating a symlink when installed to loop back.
2016-03-03 08:50:19 -05:00