Skip to content

Commit ce9a257

Browse files
avargitster
authored andcommitted
test-lib: add LIBPCRE1 & LIBPCRE2 prerequisites
Add LIBPCRE1 and LIBPCRE2 prerequisites which are true when git is compiled with USE_LIBPCRE1=YesPlease or USE_LIBPCRE2=YesPlease, respectively. The syntax of PCRE1 and PCRE2 isn't the same in all cases (see pcresyntax(3) and pcre2syntax(3)). If test are added that test for those they'll need to be guarded by these new prerequisites. The subsequent patch will make use of LIBPCRE2, so LIBPCRE1 isn't strictly needed for now, but let's add it for consistency and so that checking for it doesn't have to be done with the less obvious "PCRE, !LIBPCRE2", which while semantically the same is more confusing, and would lead to bugs if PCRE v3 is ever released as the tests would mean v1, not any non-v2 version. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 14c63a9 commit ce9a257

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

t/README

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,18 @@ use these, and "test_set_prereq" for how to define your own.
808808
Git was compiled with support for PCRE. Wrap any tests
809809
that use git-grep --perl-regexp or git-grep -P in these.
810810

811+
- LIBPCRE1
812+
813+
Git was compiled with PCRE v1 support via
814+
USE_LIBPCRE1=YesPlease. Wrap any PCRE using tests that for some
815+
reason need v1 of the PCRE library instead of v2 in these.
816+
817+
- LIBPCRE2
818+
819+
Git was compiled with PCRE v2 support via
820+
USE_LIBPCRE2=YesPlease. Wrap any PCRE using tests that for some
821+
reason need v2 of the PCRE library instead of v1 in these.
822+
811823
- CASE_INSENSITIVE_FS
812824

813825
Test is run on a case insensitive file system.

t/test-lib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,8 @@ test -z "$NO_PERL" && test_set_prereq PERL
10281028
test -z "$NO_PTHREADS" && test_set_prereq PTHREADS
10291029
test -z "$NO_PYTHON" && test_set_prereq PYTHON
10301030
test -n "$USE_LIBPCRE1$USE_LIBPCRE2" && test_set_prereq PCRE
1031+
test -n "$USE_LIBPCRE1" && test_set_prereq LIBPCRE1
1032+
test -n "$USE_LIBPCRE2" && test_set_prereq LIBPCRE2
10311033
test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
10321034

10331035
# Can we rely on git's output in the C locale?

0 commit comments

Comments
 (0)