X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Ftest-lib.sh;h=7ae96c6999aaed84007b99e4e2a6c8a6beb754da;hb=4a085a51376d888185e6719c397832173a4ba159;hp=32bd3f1278a446b230dab2c11cca4c01eab6d3be;hpb=0497d695ca796c4d19ad5ec08788bbb1f400c58c;p=notmuch diff --git a/test/test-lib.sh b/test/test-lib.sh index 32bd3f12..7ae96c69 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -219,10 +219,21 @@ test_fixed=0 test_broken=0 test_success=0 +declare -a _exit_functions=() + +at_exit_function () { + _exit_functions=($1 ${_exit_functions[@]/$1}) +} + +rm_exit_function () { + _exit_functions=(${_exit_functions[@]/$1}) +} + _exit_common () { code=$? trap - EXIT set +ex + for _fn in ${_exit_functions[@]}; do $_fn; done rm -rf "$TEST_TMPDIR" } @@ -1121,7 +1132,7 @@ test_emacs () { test_python() { # Note: if there is need to print debug information from python program, # use stdout = os.fdopen(6, 'w') or stderr = os.fdopen(7, 'w') - PYTHONPATH="$TEST_DIRECTORY/../bindings/python${PYTHONPATH:+:$PYTHONPATH}" \ + PYTHONPATH="$NOTMUCH_SRCDIR/bindings/python${PYTHONPATH:+:$PYTHONPATH}" \ $NOTMUCH_PYTHON -B - > OUTPUT } @@ -1133,7 +1144,7 @@ test_C () { exec_file="test${test_count}" test_file="${exec_file}.c" cat > ${test_file} - ${TEST_CC} ${TEST_CFLAGS} -I${TEST_DIRECTORY} -I${TEST_DIRECTORY}/../lib -o ${exec_file} ${test_file} -L${TEST_DIRECTORY}/../lib/ -lnotmuch -ltalloc + ${TEST_CC} ${TEST_CFLAGS} -I${TEST_DIRECTORY} -I${NOTMUCH_SRCDIR}/lib -o ${exec_file} ${test_file} -L${TEST_DIRECTORY}/../lib/ -lnotmuch -ltalloc echo "== stdout ==" > OUTPUT.stdout echo "== stderr ==" > OUTPUT.stderr ./${exec_file} "$@" 1>>OUTPUT.stdout 2>>OUTPUT.stderr @@ -1191,6 +1202,22 @@ test_init_ () { . ./test-lib-common.sh || exit 1 +if [ "${NOTMUCH_GMIME_MAJOR}" = 3 ]; then + test_subtest_broken_gmime_3 () { + test_subtest_known_broken + } + test_subtest_broken_gmime_2 () { + true + } +else + test_subtest_broken_gmime_3 () { + true + } + test_subtest_broken_gmime_2 () { + test_subtest_known_broken + } +fi + emacs_generate_script