tests: Strengthen test tmpdir sanity check, be compat with ginsttest saving
GNOME Continuous uses ginstest-runner --report-directory, which causes the tests to save their tmpdirs persistently. This also means the result directories didn't match the `/(var/)?tmp` regexp, which broke the ostree tests in GContinuous. Fix this by simply asserting that the tmpdir either has `.tmpdir` or nothing.
This commit is contained in:
parent
8057254b0b
commit
a02b425fc2
|
|
@ -25,13 +25,14 @@ assert_not_reached () {
|
||||||
|
|
||||||
test_tmpdir=$(pwd)
|
test_tmpdir=$(pwd)
|
||||||
|
|
||||||
# Extra sanity checks
|
# Sanity check that we're in a tmpdir that has
|
||||||
if test -d .git; then
|
# just .testtmp (created by tap-driver for `make check`,
|
||||||
assert_not_reached "Found .git, not in a tempdir?"
|
# or nothing at all (as ginstest-runner does)
|
||||||
fi
|
if ! test -f .testtmp; then
|
||||||
echo "in ${test_tmpdir}"
|
files=$(ls)
|
||||||
if ! echo ${test_tmpdir} | grep -E -q '^/(var/)?tmp'; then
|
if test -n "${files}"; then
|
||||||
assert_not_reached "Not in /tmp or /var/tmp"
|
assert_not_reached "test tmpdir=${test_tmpdir} is not empty; run this test via \`make check TESTS=\`, not directly"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export G_DEBUG=fatal-warnings
|
export G_DEBUG=fatal-warnings
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue