]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t: annotate !PTHREADS tests with !FAIL_PREREQS
authorJeff King <peff@peff.net>
Wed, 17 Mar 2021 22:47:03 +0000 (18:47 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Mar 2021 21:17:30 +0000 (14:17 -0700)
Some tests in t5300 and t7810 expect us to complain about a "--threads"
argument when Git is compiled without pthread support. Running these
under GIT_TEST_FAIL_PREREQS produces a confusing failure: we pretend to
the tests that there is no pthread support, so they expect the warning,
but of course the actual build is perfectly happy to respect the
--threads argument.

We never noticed before the recent a926c4b904 (tests: remove most uses
of C_LOCALE_OUTPUT, 2021-02-11), because the tests also were marked as
requiring the C_LOCALE_OUTPUT prerequisite. Which means they'd never
have run in FAIL_PREREQS mode, since it would always pretend that the
locale prereq was not satisfied.

These tests can't possibly work in this mode; it is a mismatch between
what the tests expect and what the build was told to do. So let's just
mark them to be skipped, using the special prereq introduced by
dfe1a17df9 (tests: add a special setup where prerequisites fail,
2019-05-13).

Reported-by: Son Luong Ngoc <sluongng@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5300-pack-object.sh
t/t7810-grep.sh

index d586fdc7a955daf6ddd9590b707e4dee1aefc82c..e830a37a38530635fb03f31097618b3da3d502cf 100755 (executable)
@@ -427,7 +427,8 @@ test_expect_success 'index-pack --strict <pack> works in non-repo' '
        test_path_is_file foo.idx
 '
 
-test_expect_success !PTHREADS 'index-pack --threads=N or pack.threads=N warns when no pthreads' '
+test_expect_success !PTHREADS,!FAIL_PREREQS \
+       'index-pack --threads=N or pack.threads=N warns when no pthreads' '
        test_must_fail git index-pack --threads=2 2>err &&
        grep ^warning: err >warnings &&
        test_line_count = 1 warnings &&
@@ -445,7 +446,8 @@ test_expect_success !PTHREADS 'index-pack --threads=N or pack.threads=N warns wh
        grep -F "no threads support, ignoring pack.threads" err
 '
 
-test_expect_success !PTHREADS 'pack-objects --threads=N or pack.threads=N warns when no pthreads' '
+test_expect_success !PTHREADS,!FAIL_PREREQS \
+       'pack-objects --threads=N or pack.threads=N warns when no pthreads' '
        git pack-objects --threads=2 --stdout --all </dev/null >/dev/null 2>err &&
        grep ^warning: err >warnings &&
        test_line_count = 1 warnings &&
index edfaa9a6d1cbe962c5b3e138adc529a5df3397e7..5830733f3d25be77cc4318e76d9c30695d4adbd0 100755 (executable)
@@ -969,7 +969,8 @@ do
        "
 done
 
-test_expect_success !PTHREADS 'grep --threads=N or pack.threads=N warns when no pthreads' '
+test_expect_success !PTHREADS,!FAIL_PREREQS \
+       'grep --threads=N or pack.threads=N warns when no pthreads' '
        git grep --threads=2 Hello hello_world 2>err &&
        grep ^warning: err >warnings &&
        test_line_count = 1 warnings &&