3 # Copyright (c) 2005 Junio C Hamano
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see http://www.gnu.org/licenses/ .
18 if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
19 echo "Error: The notmuch test suite requires a bash version >= 4.0"
20 echo "due to use of associative arrays within the test suite."
21 echo "Please try again with a newer bash (or help us fix the"
22 echo "test suite to be more portable). Thanks."
26 # if --tee was passed, write the output not only to the terminal, but
27 # additionally to the file test-results/$BASENAME.out, too.
28 case "$GIT_TEST_TEE_STARTED, $* " in
30 # do not redirect again
32 *' --tee '*|*' --va'*)
34 BASE=test-results/$(basename "$0" .sh)
35 (GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1;
36 echo $? > $BASE.exit) | tee $BASE.out
37 test "$(cat $BASE.exit)" = 0
42 # Keep the original TERM for say_color
45 # For repeatability, reset the environment to known value.
51 export LANG LC_ALL PAGER TERM TZ
52 GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}
53 export SCREENRC=/dev/null
54 export SYSSCREENRC=/dev/null
56 # Protect ourselves from common misconfiguration to export
57 # CDPATH into the environment
64 # A regexp to match 5 and 40 hexdigits
65 _x05='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
66 _x40="$_x05$_x05$_x05$_x05$_x05$_x05$_x05$_x05"
68 _x04='[0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
69 _x32="$_x04$_x04$_x04$_x04$_x04$_x04$_x04$_x04"
71 # Each test should start with something like this, after copyright notices:
73 # test_description='Description of this test...
74 # This test checks if command xyzzy does the right thing...
77 [ "x$ORIGINAL_TERM" != "xdumb" ] && (
78 TERM=$ORIGINAL_TERM &&
81 tput bold >/dev/null 2>&1 &&
82 tput setaf 1 >/dev/null 2>&1 &&
83 tput sgr0 >/dev/null 2>&1
90 -d|--d|--de|--deb|--debu|--debug)
92 -i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)
94 -l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests)
95 GIT_TEST_LONG=t; export GIT_TEST_LONG; shift ;;
96 -h|--h|--he|--hel|--help)
98 -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
100 -q|--q|--qu|--qui|--quie|--quiet)
103 with_dashes=t; shift ;;
109 --va|--val|--valg|--valgr|--valgri|--valgrin|--valgrind)
110 valgrind=t; verbose=t; shift ;;
112 shift ;; # was handled already
114 root=$(expr "z$1" : 'z[^=]*=\(.*\)')
117 echo "error: unknown test option '$1'" >&2; exit 1 ;;
121 if test -n "$color"; then
127 error) tput bold; tput setaf 1;; # bold red
128 skip) tput bold; tput setaf 2;; # bold green
129 pass) tput setaf 2;; # green
130 info) tput setaf 3;; # brown
131 *) test -n "$quiet" && return;;
141 test -z "$1" && test -n "$quiet" && return
149 say_color error "error: $*\n"
158 test "${test_description}" != "" ||
159 error "Test script did not set test_description."
161 if test "$help" = "t"
163 echo "Tests ${test_description}"
167 echo $(basename "$0"): "Testing ${test_description}"
179 if test -n "$GIT_EXIT_OK"
183 echo >&5 "FATAL: Unexpected exit with code $code"
191 test_decode_color () {
192 sed -e 's/.\[1m/<WHITE>/g' \
193 -e 's/.\[31m/<RED>/g' \
194 -e 's/.\[32m/<GREEN>/g' \
195 -e 's/.\[33m/<YELLOW>/g' \
196 -e 's/.\[34m/<BLUE>/g' \
197 -e 's/.\[35m/<MAGENTA>/g' \
198 -e 's/.\[36m/<CYAN>/g' \
199 -e 's/.\[m/<RESET>/g'
211 sed -e 's/$/Q/' | tr Q '\015'
215 tr '\015' Q | sed -e 's/Q$//'
218 # Generate a new message in the mail directory, with a unique message
219 # ID and subject. The message is not added to the index.
221 # After this function returns, the filename of the generated message
222 # is available as $gen_msg_filename and the message ID is available as
225 # This function supports named parameters with the bash syntax for
226 # assigning a value to an associative array ([name]=value). The
227 # supported parameters are:
229 # [dir]=directory/of/choice
231 # Generate the message in directory 'directory/of/choice' within
232 # the mail store. The directory will be created if necessary.
236 # Store the message in file 'name'. The default is to store it
237 # in 'msg-<count>', where <count> is three-digit number of the
242 # Text to use as the body of the email message
244 # '[from]="Some User <user@example.com>"'
245 # '[to]="Some User <user@example.com>"'
246 # '[subject]="Subject of email message"'
247 # '[date]="RFC 822 Date"'
249 # Values for email headers. If not provided, default values will
250 # be generated instead.
252 # '[cc]="Some User <user@example.com>"'
253 # [reply-to]=some-address
254 # [in-reply-to]=<message-id>
255 # [references]=<message-id>
256 # [content-type]=content-type-specification
257 # '[header]=full header line, including keyword'
259 # Additional values for email headers. If these are not provided
260 # then the relevant headers will simply not appear in the
265 # Controls the message-id of the created message.
271 # This is our (bash-specific) magic for doing named parameters
272 local -A template="($@)"
273 local additional_headers
275 gen_msg_cnt=$((gen_msg_cnt + 1))
276 if [ -z "${template[filename]}" ]; then
277 gen_msg_name="msg-$(printf "%03d" $gen_msg_cnt)"
279 gen_msg_name=${template[filename]}
282 if [ -z "${template[id]}" ]; then
283 gen_msg_id="${gen_msg_name%:2,*}@notmuch-test-suite"
285 gen_msg_id="${template[id]}"
288 if [ -z "${template[dir]}" ]; then
289 gen_msg_filename="${MAIL_DIR}/$gen_msg_name"
291 gen_msg_filename="${MAIL_DIR}/${template[dir]}/$gen_msg_name"
292 mkdir -p "$(dirname "$gen_msg_filename")"
295 if [ -z "${template[body]}" ]; then
296 template[body]="This is just a test message (#${gen_msg_cnt})"
299 if [ -z "${template[from]}" ]; then
300 template[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"
303 if [ -z "${template[to]}" ]; then
304 template[to]="Notmuch Test Suite <test_suite@notmuchmail.org>"
307 if [ -z "${template[subject]}" ]; then
308 template[subject]="Test message #${gen_msg_cnt}"
311 if [ -z "${template[date]}" ]; then
312 template[date]="Tue, 05 Jan 2001 15:43:57 -0000"
315 additional_headers=""
316 if [ ! -z "${template[header]}" ]; then
317 additional_headers="${template[header]}
318 ${additional_headers}"
321 if [ ! -z "${template[reply-to]}" ]; then
322 additional_headers="Reply-To: ${template[reply-to]}
323 ${additional_headers}"
326 if [ ! -z "${template[in-reply-to]}" ]; then
327 additional_headers="In-Reply-To: ${template[in-reply-to]}
328 ${additional_headers}"
331 if [ ! -z "${template[cc]}" ]; then
332 additional_headers="Cc: ${template[cc]}
333 ${additional_headers}"
336 if [ ! -z "${template[references]}" ]; then
337 additional_headers="References: ${template[references]}
338 ${additional_headers}"
341 if [ ! -z "${template[content-type]}" ]; then
342 additional_headers="Content-Type: ${template[content-type]}
343 ${additional_headers}"
346 # Note that in the way we're setting it above and using it below,
347 # `additional_headers' will also serve as the header / body separator
348 # (empty line in between).
350 cat <<EOF >"$gen_msg_filename"
351 From: ${template[from]}
353 Message-Id: <${gen_msg_id}>
354 Subject: ${template[subject]}
355 Date: ${template[date]}
356 ${additional_headers}
361 # Generate a new message and add it to the database.
363 # All of the arguments and return values supported by generate_message
364 # are also supported here, so see that function for details.
367 generate_message "$@" &&
368 notmuch new > /dev/null
371 # Deliver a message with emacs and add it to the database
373 # Uses emacs to generate and deliver a message to the mail store.
374 # Accepts arbitrary extra emacs/elisp functions to modify the message
375 # before sending, which is useful to doing things like attaching files
376 # to the message and encrypting/signing.
377 emacs_deliver_message ()
382 # before we can send a message, we have to prepare the FCC maildir
383 mkdir -p "$MAIL_DIR"/sent/{cur,new,tmp}
384 $TEST_DIRECTORY/smtp-dummy sent_message &
387 "(let ((message-send-mail-function 'message-smtpmail-send-it)
388 (smtpmail-smtp-server \"localhost\")
389 (smtpmail-smtp-service \"25025\"))
393 (insert \"test_suite@notmuchmail.org\nDate: 01 Jan 2000 12:00:00 -0000\")
394 (message-goto-subject)
395 (insert \"${subject}\")
399 (message-send-and-exit))" >/dev/null 2>&1
400 wait ${smtp_dummy_pid}
401 notmuch new >/dev/null
404 # Generate a corpus of email and add it to the database.
406 # This corpus is fixed, (it happens to be 50 messages from early in
407 # the history of the notmuch mailing list), which allows for reliably
408 # testing commands that need to operate on a not-totally-trivial
409 # number of messages.
413 if [ -d $TEST_DIRECTORY/corpus.mail ]; then
414 cp -a $TEST_DIRECTORY/corpus.mail ${MAIL_DIR}
416 cp -a $TEST_DIRECTORY/corpus ${MAIL_DIR}
417 notmuch new >/dev/null
418 cp -a ${MAIL_DIR} $TEST_DIRECTORY/corpus.mail
422 test_begin_subtest ()
424 if [ -n "$inside_subtest" ]; then
425 exec 1>&6 2>&7 # Restore stdout and stderr
426 error "bug in test script: Missing test_expect_equal in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}"
428 test_subtest_name="$1"
429 test_subtest_known_broken_=
430 # Remember stdout and stderr file descriptors and redirect test
431 # output to the previously prepared file descriptors 3 and 4 (see
433 if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi
434 exec 6>&1 7>&2 >&3 2>&4
438 # Pass test if two arguments match
440 # Note: Unlike all other test_expect_* functions, this function does
441 # not accept a test name. Instead, the caller should call
442 # test_begin_subtest before calling this function in order to set the
446 exec 1>&6 2>&7 # Restore stdout and stderr
448 test "$#" = 3 && { prereq=$1; shift; } || prereq=
450 error "bug in the test script: not 2 or 3 parameters to test_expect_equal"
454 if ! test_skip "$test_subtest_name"
456 if [ "$output" = "$expected" ]; then
457 test_ok_ "$test_subtest_name"
459 testname=$this_test.$test_count
460 echo "$expected" > $testname.expected
461 echo "$output" > $testname.output
462 test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"
467 # Like test_expect_equal, but takes two filenames.
468 test_expect_equal_file ()
470 exec 1>&6 2>&7 # Restore stdout and stderr
472 test "$#" = 3 && { prereq=$1; shift; } || prereq=
474 error "bug in the test script: not 2 or 3 parameters to test_expect_equal"
478 if ! test_skip "$test_subtest_name"
480 if diff -q "$expected" "$output" >/dev/null ; then
481 test_ok_ "$test_subtest_name"
483 testname=$this_test.$test_count
484 cp "$output" $testname.output
485 cp "$expected" $testname.expected
486 test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"
493 notmuch new | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file'
496 notmuch_search_sanitize ()
498 sed -r -e 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/'
501 NOTMUCH_SHOW_FILENAME_SQUELCH='s,filename:.*/mail,filename:/XXX/mail,'
502 notmuch_show_sanitize ()
504 sed -e "$NOTMUCH_SHOW_FILENAME_SQUELCH"
506 notmuch_show_sanitize_all ()
509 -e 's| filename:.*| filename:XXXXX|' \
510 -e 's| id:[^ ]* | id:XXXXX |'
513 notmuch_json_show_sanitize ()
515 sed -e 's|, |,\n |g' | \
517 -e 's|"id": "[^"]*",|"id": "XXXXX",|' \
518 -e 's|"filename": "[^"]*",|"filename": "YYYYY",|'
521 # End of notmuch helper functions
523 # Use test_set_prereq to tell that a particular prerequisite is available.
524 # The prerequisite can later be checked for in two ways:
526 # - Explicitly using test_have_prereq.
528 # - Implicitly by specifying the prerequisite tag in the calls to
529 # test_expect_{success,failure,code}.
531 # The single parameter is the prerequisite tag (a simple word, in all
532 # capital letters by convention).
535 satisfied="$satisfied$1 "
539 test_have_prereq () {
548 # You are not expected to call test_ok_ and test_failure_ directly, use
549 # the text_expect_* functions instead.
552 if test "$test_subtest_known_broken_" = "t"; then
553 test_known_broken_ok_ "$@"
556 test_success=$(($test_success + 1))
557 say_color pass "%-6s" "PASS"
562 if test "$test_subtest_known_broken_" = "t"; then
563 test_known_broken_failure_ "$@"
566 test_failure=$(($test_failure + 1))
567 test_failure_message_ "FAIL" "$@"
568 test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }
572 test_failure_message_ () {
573 say_color error "%-6s" "$1"
576 echo "$@" | sed -e 's/^/ /'
577 if test "$verbose" != "t"; then cat test.output; fi
580 test_known_broken_ok_ () {
581 test_subtest_known_broken_=
582 test_fixed=$(($test_fixed+1))
583 say_color pass "%-6s" "FIXED"
587 test_known_broken_failure_ () {
588 test_subtest_known_broken_=
589 test_broken=$(($test_broken+1))
590 test_failure_message_ "BROKEN" "$@"
595 test "$debug" = "" || eval "$1"
600 if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi
603 eval >&3 2>&4 "$test_cleanup"
608 test_count=$(($test_count+1))
610 for skp in $NOTMUCH_SKIP_TESTS
612 case $this_test.$test_count in
617 if test -z "$to_skip" && test -n "$prereq" &&
618 ! test_have_prereq "$prereq"
624 test_subtest_known_broken_=
625 say_color skip >&3 "skipping test: $@"
626 say_color skip "%-6s" "SKIP"
636 test_subtest_known_broken () {
637 test_subtest_known_broken_=t
640 test_expect_success () {
641 test "$#" = 3 && { prereq=$1; shift; } || prereq=
643 error "bug in the test script: not 2 or 3 parameters to test-expect-success"
647 if [ "$?" = 0 -a "$eval_ret" = 0 ]
656 test_expect_code () {
657 test "$#" = 4 && { prereq=$1; shift; } || prereq=
659 error "bug in the test script: not 3 or 4 parameters to test-expect-code"
663 if [ "$?" = 0 -a "$eval_ret" = "$1" ]
672 # test_external runs external test scripts that provide continuous
673 # test output about their progress, and succeeds/fails on
674 # zero/non-zero exit code. It outputs the test output on stdout even
675 # in non-verbose mode, and announces the external script with "* run
676 # <n>: ..." before running it. When providing relative paths, keep in
677 # mind that all scripts run in "trash directory".
678 # Usage: test_external description command arguments...
679 # Example: test_external 'Perl API' perl ../path/to/test.pl
681 test "$#" = 4 && { prereq=$1; shift; } || prereq=
683 error >&5 "bug in the test script: not 3 or 4 parameters to test_external"
686 if ! test_skip "$descr" "$@"
688 # Announce the script to reduce confusion about the
689 # test output that follows.
690 say_color "" " run $test_count: $descr ($*)"
691 # Run command; redirect its stderr to &4 as in
692 # test_run_, but keep its stdout on our stdout even in
699 test_failure_ "$descr" "$@"
704 # Like test_external, but in addition tests that the command generated
705 # no output on stderr.
706 test_external_without_stderr () {
707 # The temporary file has no (and must have no) security
709 tmp="$TMPDIR"; if [ -z "$tmp" ]; then tmp=/tmp; fi
710 stderr="$tmp/git-external-stderr.$$.tmp"
711 test_external "$@" 4> "$stderr"
712 [ -f "$stderr" ] || error "Internal error: $stderr disappeared."
713 descr="no stderr: $1"
715 if [ ! -s "$stderr" ]; then
719 if [ "$verbose" = t ]; then
720 output=`echo; echo Stderr is:; cat "$stderr"`
724 # rm first in case test_failure exits.
726 test_failure_ "$descr" "$@" "$output"
730 # This is not among top-level (test_expect_success)
731 # but is a prefix that can be used in the test script, like:
733 # test_expect_success 'complain and die' '
735 # do something else &&
736 # test_must_fail git checkout ../outerspace
739 # Writing this as "! git checkout ../outerspace" is wrong, because
740 # the failure could be due to a segv. We want a controlled failure.
744 test $? -gt 0 -a $? -le 129 -o $? -gt 192
747 # test_cmp is a helper function to compare actual and expected output.
748 # You can use it like:
750 # test_expect_success 'foo works' '
751 # echo expected >expected &&
753 # test_cmp expected actual
756 # This could be written as either "cmp" or "diff -u", but:
757 # - cmp's output is not nearly as easy to read as diff -u
758 # - not all diff versions understand "-u"
764 # This function can be used to schedule some commands to be run
765 # unconditionally at the end of the test to restore sanity:
767 # test_expect_success 'test core.capslock' '
768 # git config core.capslock true &&
769 # test_when_finished "git config --unset core.capslock" &&
773 # That would be roughly equivalent to
775 # test_expect_success 'test core.capslock' '
776 # git config core.capslock true &&
778 # git config --unset core.capslock
781 # except that the greeting and config --unset must both succeed for
784 test_when_finished () {
786 } && (exit \"\$eval_ret\"); eval_ret=\$?; $test_cleanup"
791 test_results_dir="$TEST_DIRECTORY/test-results"
792 mkdir -p "$test_results_dir"
793 test_results_path="$test_results_dir/${0%.sh}-$$"
795 echo "total $test_count" >> $test_results_path
796 echo "success $test_success" >> $test_results_path
797 echo "fixed $test_fixed" >> $test_results_path
798 echo "broken $test_broken" >> $test_results_path
799 echo "failed $test_failure" >> $test_results_path
800 echo "" >> $test_results_path
804 [ -n "$EMACS_SERVER" ] && test_emacs '(kill-emacs)'
806 if [ "$test_failure" = "0" ]; then
807 if [ "$test_broken" = "0" ]; then
816 emacs_generate_script () {
817 # Construct a little test script here for the benefit of the user,
818 # (who can easily run "run_emacs" to get the same emacs environment
819 # for investigating any failures).
820 cat <<EOF >"$TMP_DIRECTORY/run_emacs"
823 export NOTMUCH_CONFIG=$NOTMUCH_CONFIG
825 # Here's what we are using here:
827 # --no-init-file Don't load users ~/.emacs
829 # --no-site-file Don't load the site-wide startup stuff
831 # --directory Ensure that the local elisp sources are found
833 # --load Force loading of notmuch.el and test-lib.el
835 emacs --no-init-file --no-site-file \
836 --directory "$TEST_DIRECTORY/../emacs" --load notmuch.el \
837 --directory "$TEST_DIRECTORY" --load test-lib.el \
840 chmod a+x "$TMP_DIRECTORY/run_emacs"
844 if [ -z "$EMACS_SERVER" ]; then
845 EMACS_SERVER="notmuch-test-suite-$$"
846 # start a detached screen session with an emacs server
847 screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \
849 --eval "(setq server-name \"$EMACS_SERVER\")" \
850 --eval '(server-start)' \
851 --eval "(orphan-watchdog $$)" || return
852 # wait until the emacs server is up
853 until test_emacs '()' 2>/dev/null; do
858 emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)"
866 while [ -n "$dir" ]; do
868 if [ -x "$bin" ]; then
872 dir="$(dirname "$dir")"
873 if [ "$dir" = "/" ]; then
879 # Test the binaries we have just built. The tests are kept in
880 # test/ subdirectory and are run in 'trash directory' subdirectory.
881 TEST_DIRECTORY=$(pwd)
882 if test -n "$valgrind"
886 test "$1" = "$(readlink "$2")" || {
894 while test -d "$2".lock
896 say "Waiting for lock on $2."
903 make_valgrind_symlink () {
904 # handle only executables
905 test -x "$1" || return
907 base=$(basename "$1")
908 symlink_target=$TEST_DIRECTORY/../$base
909 # do not override scripts
910 if test -x "$symlink_target" &&
911 test ! -d "$symlink_target" &&
912 test "#!" != "$(head -c 2 < "$symlink_target")"
914 symlink_target=$TEST_DIRECTORY/valgrind.sh
918 symlink_target=$TEST_DIRECTORY/unprocessed-script
920 # create the link, or replace it if it is out of date
921 make_symlink "$symlink_target" "$GIT_VALGRIND/bin/$base" || exit
924 # override notmuch executable in TEST_DIRECTORY/..
925 GIT_VALGRIND=$TEST_DIRECTORY/valgrind
926 mkdir -p "$GIT_VALGRIND"/bin
927 make_valgrind_symlink $TEST_DIRECTORY/../notmuch
932 ls "$path"/notmuch 2> /dev/null |
935 make_valgrind_symlink "$file"
939 PATH=$GIT_VALGRIND/bin:$PATH
940 GIT_EXEC_PATH=$GIT_VALGRIND/bin
943 notmuch_path=`find_notmuch_path "$TEST_DIRECTORY"`
944 test -n "$notmuch_path" && PATH="$notmuch_path:$PATH"
949 test="tmp.$(basename "$0" .sh)"
950 test -n "$root" && test="$root/$test"
952 /*) TMP_DIRECTORY="$test" ;;
953 *) TMP_DIRECTORY="$TEST_DIRECTORY/$test" ;;
955 test ! -z "$debug" || remove_tmp=$TMP_DIRECTORY
958 echo >&5 "FATAL: Cannot prepare test area"
962 # A temporary home directory is needed by at least:
963 # - emacs/"Sending a message via (fake) SMTP"
964 # - emacs/"Reply within emacs"
965 # - crypto/emacs_deliver_message
966 export HOME="${TMP_DIRECTORY}/home"
969 MAIL_DIR="${TMP_DIRECTORY}/mail"
970 export GNUPGHOME="${TMP_DIRECTORY}/gnupg"
971 export NOTMUCH_CONFIG="${TMP_DIRECTORY}/notmuch-config"
974 mkdir -p "${MAIL_DIR}"
976 cat <<EOF >"${NOTMUCH_CONFIG}"
981 name=Notmuch Test Suite
982 primary_email=test_suite@notmuchmail.org
983 other_email=test_suite_other@notmuchmail.org;test_suite@otherdomain.org
986 emacs_generate_script
989 # Use -P to resolve symlinks in our working directory so that the cwd
990 # in subprocesses like git equals our $PWD (for pathname comparisons).
991 cd -P "$test" || error "Cannot setup test environment"
993 if test "$verbose" = "t"
997 exec 4>test.output 3>&4
1001 for skp in $NOTMUCH_SKIP_TESTS
1004 for skp in $NOTMUCH_SKIP_TESTS
1006 case "$this_test" in
1013 say_color skip >&3 "skipping test $this_test altogether"
1014 say_color skip "skip all tests in $this_test"
1019 # Provide an implementation of the 'yes' utility
1034 # Fix some commands on Windows
1037 # Windows has its own (incompatible) sort and find
1047 # git sees Windows-style pwd
1051 # no POSIX permissions
1052 # backslashes in pathspec are converted to '/'
1053 # exec does not inherit the PID
1056 test_set_prereq POSIXPERM
1057 test_set_prereq BSLASHPSPEC
1058 test_set_prereq EXECKEEPSPID
1062 test -z "$NO_PERL" && test_set_prereq PERL
1063 test -z "$NO_PYTHON" && test_set_prereq PYTHON
1065 # test whether the filesystem supports symbolic links
1066 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS