X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Fatomicity;h=1c786fa2724262dad40cc9f7b883b6269586bc1d;hp=34642388430ff8c544017764c0d03222c69fa217;hb=84719b08f757a6079f4c3331d0c476d19b265948;hpb=2697f623ae1534b669e182934ade124bd9cfd7ad diff --git a/test/atomicity b/test/atomicity index 34642388..1c786fa2 100755 --- a/test/atomicity +++ b/test/atomicity @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description='atomicity' . ./test-lib.sh @@ -7,8 +7,7 @@ test_description='atomicity' # final database contents should be the same regardless of when (or # if) it is killed and restarted. -if which gdb 1>/dev/null 2>&1; then - test_set_prereq GDB +if test_require_external_prereq gdb; then # Create a maildir structure to also stress flag synchronization mkdir $MAIL_DIR/cur @@ -52,7 +51,7 @@ if which gdb 1>/dev/null 2>&1; then # Prepare a snapshot of the updated maildir. The gdb script will # update the database in this snapshot as it goes. - cp -ra $MAIL_DIR $MAIL_DIR.snap + cp -a $MAIL_DIR $MAIL_DIR.snap cp ${NOTMUCH_CONFIG} ${NOTMUCH_CONFIG}.snap NOTMUCH_CONFIG=${NOTMUCH_CONFIG}.snap notmuch config set database.path $MAIL_DIR.snap @@ -91,14 +90,11 @@ if which gdb 1>/dev/null 2>&1; then i=$(expr $end - 1) fi done -else - say_color info "%-6s" "WARNING" - echo " Missing test prerequisite GDB" -fi +fi test_begin_subtest '"notmuch new" is idempotent under arbitrary aborts' -test_expect_equal_file GDB searchall expectall +test_expect_equal_file searchall expectall -test_expect_success GDB "detected $outcount>10 abort points" "test $outcount -gt 10" +test_expect_success "detected $outcount>10 abort points" "test $outcount -gt 10" test_done