]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
lib/n_d_needs_upgrade: handle error return from n_d_get_version
[notmuch] / test / test-lib.sh
index 58972339bfa05e7e9cf5707b0b1564abf8333025..8c331b882d2f02786679dcbdbbf0121c4762e476 100644 (file)
@@ -556,7 +556,7 @@ test_json_nodes () {
 
        if ! test_skip "$test_subtest_name"
        then
-           output=$(PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON "$TEST_DIRECTORY"/json_check_nodes.py "$@")
+           output=$(PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -B "$NOTMUCH_SRCDIR"/test/json_check_nodes.py "$@")
                if [ "$?" = 0 ]
                then
                        test_ok_
@@ -619,6 +619,11 @@ print(msg.as_string(False))
 ' "$@"
 }
 
+notmuch_exception_sanitize ()
+{
+    perl -pe 's/(A Xapian exception occurred at .*[.]cc?):([0-9]*)/\1:XXX/'
+}
+
 notmuch_search_sanitize ()
 {
     perl -pe 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/'
@@ -1021,7 +1026,7 @@ export NOTMUCH_CONFIG=$NOTMUCH_CONFIG
 # --load               Force loading of notmuch.el and test-lib.el
 
 exec ${TEST_EMACS} --quick \
-       --directory "$NOTMUCH_SRCDIR/emacs" --load notmuch.el \
+       --directory "$NOTMUCH_BUILDDIR/emacs" --load notmuch.el \
        --directory "$NOTMUCH_SRCDIR/test" --load test-lib.el \
        "\$@"
 EOF
@@ -1081,7 +1086,7 @@ test_python() {
 }
 
 test_ruby() {
-    MAIL_DIR=$MAIL_DIR $NOTMUCH_RUBY -I $NOTMUCH_SRCDIR/bindings/ruby> OUTPUT
+    MAIL_DIR=$MAIL_DIR $NOTMUCH_RUBY -I "$NOTMUCH_BUILDDIR/bindings/ruby"> OUTPUT
 }
 
 test_C () {
@@ -1093,7 +1098,7 @@ test_C () {
     echo "== stdout ==" > OUTPUT.stdout
     echo "== stderr ==" > OUTPUT.stderr
     ./${exec_file} "$@" 1>>OUTPUT.stdout 2>>OUTPUT.stderr
-    notmuch_dir_sanitize OUTPUT.stdout OUTPUT.stderr > OUTPUT
+    notmuch_dir_sanitize OUTPUT.stdout OUTPUT.stderr | notmuch_exception_sanitize > OUTPUT
 }
 
 make_shim () {