Skip to content

Commit 4d1d843

Browse files
matheustavaresgitster
authored andcommitted
tests: use the new C rot13-filter helper to avoid PERL prereq
The previous commit implemented a C version of the t0021/rot13-filter.pl script. Let's use this new C helper to eliminate the PERL prereq from various tests, and also remove the superseded Perl script. Signed-off-by: Matheus Tavares <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 52917a9 commit 4d1d843

File tree

4 files changed

+37
-293
lines changed

4 files changed

+37
-293
lines changed

t/t0021-conversion.sh

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ tr \
1717
'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM'
1818
EOF
1919

20-
write_script rot13-filter.pl "$PERL_PATH" \
21-
<"$TEST_DIRECTORY"/t0021/rot13-filter.pl
22-
2320
generate_random_characters () {
2421
LEN=$1
2522
NAME=$2
@@ -365,8 +362,8 @@ test_expect_success 'diff does not reuse worktree files that need cleaning' '
365362
test_line_count = 0 count
366363
'
367364

368-
test_expect_success PERL 'required process filter should filter data' '
369-
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
365+
test_expect_success 'required process filter should filter data' '
366+
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
370367
test_config_global filter.protocol.required true &&
371368
rm -rf repo &&
372369
mkdir repo &&
@@ -450,8 +447,8 @@ test_expect_success PERL 'required process filter should filter data' '
450447
)
451448
'
452449

453-
test_expect_success PERL 'required process filter should filter data for various subcommands' '
454-
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
450+
test_expect_success 'required process filter should filter data for various subcommands' '
451+
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
455452
test_config_global filter.protocol.required true &&
456453
(
457454
cd repo &&
@@ -561,9 +558,9 @@ test_expect_success PERL 'required process filter should filter data for various
561558
)
562559
'
563560

564-
test_expect_success PERL 'required process filter takes precedence' '
561+
test_expect_success 'required process filter takes precedence' '
565562
test_config_global filter.protocol.clean false &&
566-
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean" &&
563+
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean" &&
567564
test_config_global filter.protocol.required true &&
568565
rm -rf repo &&
569566
mkdir repo &&
@@ -587,8 +584,8 @@ test_expect_success PERL 'required process filter takes precedence' '
587584
)
588585
'
589586

590-
test_expect_success PERL 'required process filter should be used only for "clean" operation only' '
591-
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean" &&
587+
test_expect_success 'required process filter should be used only for "clean" operation only' '
588+
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean" &&
592589
rm -rf repo &&
593590
mkdir repo &&
594591
(
@@ -622,8 +619,8 @@ test_expect_success PERL 'required process filter should be used only for "clean
622619
)
623620
'
624621

625-
test_expect_success PERL 'required process filter should process multiple packets' '
626-
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
622+
test_expect_success 'required process filter should process multiple packets' '
623+
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
627624
test_config_global filter.protocol.required true &&
628625
629626
rm -rf repo &&
@@ -687,8 +684,8 @@ test_expect_success PERL 'required process filter should process multiple packet
687684
)
688685
'
689686

690-
test_expect_success PERL 'required process filter with clean error should fail' '
691-
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
687+
test_expect_success 'required process filter with clean error should fail' '
688+
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
692689
test_config_global filter.protocol.required true &&
693690
rm -rf repo &&
694691
mkdir repo &&
@@ -706,8 +703,8 @@ test_expect_success PERL 'required process filter with clean error should fail'
706703
)
707704
'
708705

709-
test_expect_success PERL 'process filter should restart after unexpected write failure' '
710-
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
706+
test_expect_success 'process filter should restart after unexpected write failure' '
707+
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
711708
rm -rf repo &&
712709
mkdir repo &&
713710
(
@@ -761,8 +758,8 @@ test_expect_success PERL 'process filter should restart after unexpected write f
761758
)
762759
'
763760

764-
test_expect_success PERL 'process filter should not be restarted if it signals an error' '
765-
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
761+
test_expect_success 'process filter should not be restarted if it signals an error' '
762+
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
766763
rm -rf repo &&
767764
mkdir repo &&
768765
(
@@ -804,8 +801,8 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
804801
)
805802
'
806803

807-
test_expect_success PERL 'process filter abort stops processing of all further files' '
808-
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
804+
test_expect_success 'process filter abort stops processing of all further files' '
805+
test_config_global filter.protocol.process "test-tool rot13-filter --log=debug.log clean smudge" &&
809806
rm -rf repo &&
810807
mkdir repo &&
811808
(
@@ -861,10 +858,10 @@ test_expect_success PERL 'invalid process filter must fail (and not hang!)' '
861858
)
862859
'
863860

864-
test_expect_success PERL 'delayed checkout in process filter' '
865-
test_config_global filter.a.process "rot13-filter.pl a.log clean smudge delay" &&
861+
test_expect_success 'delayed checkout in process filter' '
862+
test_config_global filter.a.process "test-tool rot13-filter --log=a.log clean smudge delay" &&
866863
test_config_global filter.a.required true &&
867-
test_config_global filter.b.process "rot13-filter.pl b.log clean smudge delay" &&
864+
test_config_global filter.b.process "test-tool rot13-filter --log=b.log clean smudge delay" &&
868865
test_config_global filter.b.required true &&
869866
870867
rm -rf repo &&
@@ -940,8 +937,8 @@ test_expect_success PERL 'delayed checkout in process filter' '
940937
)
941938
'
942939

943-
test_expect_success PERL 'missing file in delayed checkout' '
944-
test_config_global filter.bug.process "rot13-filter.pl bug.log clean smudge delay" &&
940+
test_expect_success 'missing file in delayed checkout' '
941+
test_config_global filter.bug.process "test-tool rot13-filter --log=bug.log clean smudge delay" &&
945942
test_config_global filter.bug.required true &&
946943
947944
rm -rf repo &&
@@ -960,8 +957,8 @@ test_expect_success PERL 'missing file in delayed checkout' '
960957
grep "error: .missing-delay\.a. was not filtered properly" git-stderr.log
961958
'
962959

963-
test_expect_success PERL 'invalid file in delayed checkout' '
964-
test_config_global filter.bug.process "rot13-filter.pl bug.log clean smudge delay" &&
960+
test_expect_success 'invalid file in delayed checkout' '
961+
test_config_global filter.bug.process "test-tool rot13-filter --log=bug.log clean smudge delay" &&
965962
test_config_global filter.bug.required true &&
966963
967964
rm -rf repo &&
@@ -990,10 +987,10 @@ do
990987
mode_prereq='UTF8_NFD_TO_NFC' ;;
991988
esac
992989

993-
test_expect_success PERL,SYMLINKS,$mode_prereq \
990+
test_expect_success SYMLINKS,$mode_prereq \
994991
"delayed checkout with $mode-collision don't write to the wrong place" '
995992
test_config_global filter.delay.process \
996-
"\"$TEST_ROOT/rot13-filter.pl\" --always-delay delayed.log clean smudge delay" &&
993+
"test-tool rot13-filter --always-delay --log=delayed.log clean smudge delay" &&
997994
test_config_global filter.delay.required true &&
998995
999996
git init $mode-collision &&
@@ -1026,12 +1023,12 @@ do
10261023
'
10271024
done
10281025

1029-
test_expect_success PERL,SYMLINKS,CASE_INSENSITIVE_FS \
1026+
test_expect_success SYMLINKS,CASE_INSENSITIVE_FS \
10301027
"delayed checkout with submodule collision don't write to the wrong place" '
10311028
git init collision-with-submodule &&
10321029
(
10331030
cd collision-with-submodule &&
1034-
git config filter.delay.process "\"$TEST_ROOT/rot13-filter.pl\" --always-delay delayed.log clean smudge delay" &&
1031+
git config filter.delay.process "test-tool rot13-filter --always-delay --log=delayed.log clean smudge delay" &&
10351032
git config filter.delay.required true &&
10361033
10371034
# We need Git to treat the submodule "a" and the
@@ -1062,11 +1059,11 @@ test_expect_success PERL,SYMLINKS,CASE_INSENSITIVE_FS \
10621059
)
10631060
'
10641061

1065-
test_expect_success PERL 'setup for progress tests' '
1062+
test_expect_success 'setup for progress tests' '
10661063
git init progress &&
10671064
(
10681065
cd progress &&
1069-
git config filter.delay.process "rot13-filter.pl delay-progress.log clean smudge delay" &&
1066+
git config filter.delay.process "test-tool rot13-filter --log=delay-progress.log clean smudge delay" &&
10701067
git config filter.delay.required true &&
10711068
10721069
echo "*.a filter=delay" >.gitattributes &&
@@ -1132,12 +1129,12 @@ do
11321129
'
11331130
done
11341131

1135-
test_expect_success PERL 'delayed checkout correctly reports the number of updated entries' '
1132+
test_expect_success 'delayed checkout correctly reports the number of updated entries' '
11361133
rm -rf repo &&
11371134
git init repo &&
11381135
(
11391136
cd repo &&
1140-
git config filter.delay.process "../rot13-filter.pl delayed.log clean smudge delay" &&
1137+
git config filter.delay.process "test-tool rot13-filter --log=delayed.log clean smudge delay" &&
11411138
git config filter.delay.required true &&
11421139
11431140
echo "*.a filter=delay" >.gitattributes &&

0 commit comments

Comments
 (0)