test-lib: add a PTHREADS prerequisite

Add a PTHREADS prerequisite which is false when git is compiled with NO_PTHREADS=YesPlease. There's lots of custom code that runs when threading isn't available, but before this prerequisite there was no way to test it. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed May 25, 2017 at 19:45 UTC 68c7d2761dd78173d311fbe4fa5f0f764a75e4ec
3 files changed +6
Makefile
+1
@@ -2242,6 +2242,7 @@ GIT-BUILD-OPTIONS: FORCE
2242 @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+
2243 @echo USE_LIBPCRE1=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@+
2244 @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+
2245 + @echo NO_PTHREADS=\''$(subst ','\'',$(subst ','\'',$(NO_PTHREADS)))'\' >>$@+
2246 @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+
2247 @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
2248 @echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
t/README
+4
@@ -817,6 +817,10 @@ use these, and "test_set_prereq" for how to define your own.
817 Test is run on a filesystem which converts decomposed utf-8 (nfd)
818 to precomposed utf-8 (nfc).
819
820 + - PTHREADS
821 +
822 + Git wasn't compiled with NO_PTHREADS=YesPlease.
823 +
824 Tips for Writing Tests
825 ----------------------
826
t/test-lib.sh
+1
@@ -1009,6 +1009,7 @@ esac
1009
1010 ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
1011 test -z "$NO_PERL" && test_set_prereq PERL
1012 +test -z "$NO_PTHREADS" && test_set_prereq PTHREADS
1013 test -z "$NO_PYTHON" && test_set_prereq PYTHON
1014 test -n "$USE_LIBPCRE1" && test_set_prereq PCRE
1015 test -z "$NO_GETTEXT" && test_set_prereq GETTEXT