t: adapt existing PERL prerequisites

A couple of our tests depend on the PERL prerequisite even though it
isn't needed. These tests fall into one of the following classes:

  - The underlying logic used to be implemented in Perl but isn't
    anymore. Here we can simply drop the dependency altogether.

  - The test logic used to depend on Perl but doesn't anymore. Again, we
    can simply drop the dependency.

  - The test logic still relies on a Perl interpreter. These tests
    should use the newly introduced PERL_TEST_HELPERS prerequisite.

Adapt test cases accordingly.

Note that in t1006 we have to introduce another new prerequisite
depending on whether or not the IPC::Open2 module is available. Funny
enough, when starting to use `test_lazy_prereq` to do so we also get a
conflict of variables with the "script" variable that contains the Perl
logic because `test_run_lazy_prereq_` also sets that variable. We thus
rename the variable in t1006 to "perl_script".

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-04-03 07:05:58 +02:00
committed by Junio C Hamano
parent 23e21a58d5
commit 64b3eee038
4 changed files with 19 additions and 15 deletions

View File

@@ -46,7 +46,7 @@ test_expect_success 'paths and -a do not mix' '
test_must_fail git commit -m foo -a file
'
test_expect_success PERL 'can use paths with --interactive' '
test_expect_success 'can use paths with --interactive' '
echo bong-o-bong >file &&
# 2: update, 1:st path, that is all, 7: quit
test_write_lines 2 1 "" 7 |
@@ -345,12 +345,12 @@ test_expect_success 'overriding author from command line' '
grep Rubber.Duck output
'
test_expect_success PERL 'interactive add' '
test_expect_success 'interactive add' '
echo 7 | test_must_fail git commit --interactive >out &&
grep "What now" out
'
test_expect_success PERL "commit --interactive doesn't change index if editor aborts" '
test_expect_success "commit --interactive doesn't change index if editor aborts" '
echo zoo >file &&
test_must_fail git diff --exit-code >diff1 &&
test_write_lines u "*" q |