diff options
author | Mark Anderson <ma.skies@gmail.com> | 2011-06-28 16:11:32 -0600 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2011-06-28 16:01:56 -0700 |
commit | eb4cf465a5c179c711c15649fc90c7377850cb77 (patch) | |
tree | ccc18f56b2bab21f6f6eda0af9282aa854e2d2db /test/test-lib.sh | |
parent | 273d896097830235eca5f1bc87ac03e381280f1c (diff) |
test:Improve test behaviors when --root is used
Change add_email_corpus, emacs_deliver_message and tests to use
$TEST_DIRECTORY instead of '..'.
This improves the behavior of the usage of --root=<dir>, as the
assumption of what '..' means will usually be incorrect.
Document -root option in README and update valgrind to work with
-root.
Diffstat (limited to 'test/test-lib.sh')
-rwxr-xr-x | test/test-lib.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/test-lib.sh b/test/test-lib.sh index 48bace2..49522da 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -392,7 +392,7 @@ emacs_deliver_message () shift 2 # before we can send a message, we have to prepare the FCC maildir mkdir -p "$MAIL_DIR"/sent/{cur,new,tmp} - ../smtp-dummy sent_message & + $TEST_DIRECTORY/smtp-dummy sent_message & smtp_dummy_pid=$! test_emacs \ "(let ((message-send-mail-function 'message-smtpmail-send-it) @@ -421,12 +421,12 @@ emacs_deliver_message () add_email_corpus () { rm -rf ${MAIL_DIR} - if [ -d ../corpus.mail ]; then - cp -a ../corpus.mail ${MAIL_DIR} + if [ -d $TEST_DIRECTORY/corpus.mail ]; then + cp -a $TEST_DIRECTORY/corpus.mail ${MAIL_DIR} else - cp -a ../corpus ${MAIL_DIR} + cp -a $TEST_DIRECTORY/corpus ${MAIL_DIR} notmuch new >/dev/null - cp -a ${MAIL_DIR} ../corpus.mail + cp -a ${MAIL_DIR} $TEST_DIRECTORY/corpus.mail fi } @@ -867,8 +867,8 @@ fi # --load Force loading of notmuch.el and test-lib.el emacs \$BATCH --no-init-file --no-site-file \ - --directory "$TMP_DIRECTORY/../../emacs" --load notmuch.el \ - --directory "$TMP_DIRECTORY/.." --load test-lib.el \ + --directory "$TEST_DIRECTORY/../emacs" --load notmuch.el \ + --directory "$TEST_DIRECTORY" --load test-lib.el \ --eval "(progn \$@)" EOF chmod a+x "$TMP_DIRECTORY/run_emacs" @@ -931,11 +931,11 @@ then test ! -d "$symlink_target" && test "#!" != "$(head -c 2 < "$symlink_target")" then - symlink_target=../valgrind.sh + symlink_target=$TEST_DIRECTORY/valgrind.sh fi case "$base" in *.sh|*.perl) - symlink_target=../unprocessed-script + symlink_target=$TEST_DIRECTORY/unprocessed-script esac # create the link, or replace it if it is out of date make_symlink "$symlink_target" "$GIT_VALGRIND/bin/$base" || exit |