Skip to content

Commit 8afecde

Browse files
pks-tgitster
authored andcommitted
t: skip chain lint when PERL_PATH is unset
Our chainlint script verifies that test files have proper '&&' chains. This script is written in Perl and executed for every test file before executing the test logic itself. In subsequent commits we're about to refactor our test suite so that Perl becomes an optional dependency, only. And while it is already possible to disable this linter, developers that don't have Perl available at all would always have to disable the linter manually, which is rather cumbersome. Disable the chain linter automatically in case PERL_PATH isn't set to make this a bit less annoying. Bail out with an error in case the developer has asked explicitly for the chain linter. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 683c54c commit 8afecde

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

t/test-lib.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,22 @@ then
15231523
export LSAN_OPTIONS
15241524
fi
15251525

1526+
if test -z "$PERL_PATH"
1527+
then
1528+
case "${GIT_TEST_CHAIN_LINT:-unset}" in
1529+
unset)
1530+
GIT_TEST_CHAIN_LINT=0
1531+
;;
1532+
0)
1533+
# The user has explicitly disabled the chain linter, so we
1534+
# don't have anything to worry about.
1535+
;;
1536+
*)
1537+
BAIL_OUT 'You need Perl for the chain linter'
1538+
;;
1539+
esac
1540+
fi
1541+
15261542
if test "${GIT_TEST_CHAIN_LINT:-1}" != 0 &&
15271543
test "${GIT_TEST_EXT_CHAIN_LINT:-1}" != 0
15281544
then

0 commit comments

Comments
 (0)