perf lint: add make test-lint to perf tests

Perf tests have not been linted for some time. They've grown some seq instead of test_seq. This runs the existing lints on the perf tests as well. Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nipunn Koorapati committed Oct 20, 2020 at 13:41 UTC ed5a24573d8caf222dbb81a46dc97a4459928e2d
3 files changed +11 -7
t/Makefile
+4 -3
@@ -34,6 +34,7 @@ CHAINLINTTMP_SQ = $(subst ','\'',$(CHAINLINTTMP))
34 T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
35 TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
36 THELPERS = $(sort $(filter-out $(T),$(wildcard *.sh)))
37 +TPERF = $(sort $(wildcard perf/p[0-9][0-9][0-9][0-9]-*.sh))
38 CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.test)))
39 CHAINLINT = sed -f chainlint.sed
40
@@ -81,17 +82,17 @@ test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
82 test-lint-filenames
83
84 test-lint-duplicates:
84 - @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
85 + @dups=`echo $(T) $(TPERF) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
86 test -z "$$dups" || { \
87 echo >&2 "duplicate test numbers:" $$dups; exit 1; }
88
89 test-lint-executable:
89 - @bad=`for i in $(T); do test -x "$$i" || echo $$i; done` && \
90 + @bad=`for i in $(T) $(TPERF); do test -x "$$i" || echo $$i; done` && \
91 test -z "$$bad" || { \
92 echo >&2 "non-executable tests:" $$bad; exit 1; }
93
94 test-lint-shell-syntax:
94 - @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS)
95 + @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS) $(TPERF)
96
97 test-lint-filenames:
98 @# We do *not* pass a glob to ls-files but use grep instead, to catch
t/perf/Makefile
+4 -1
@@ -1,7 +1,7 @@
1 -include ../../config.mak
2 export GIT_TEST_OPTIONS
3
4 -all: perf
4 +all: test-lint perf
5
6 perf: pre-clean
7 ./run
@@ -12,4 +12,7 @@ pre-clean:
12 clean:
13 rm -rf build "trash directory".* test-results
14
15 +test-lint:
16 + $(MAKE) -C .. test-lint
17 +
18 .PHONY: all perf pre-clean clean
t/perf/p3400-rebase.sh
+3 -3
@@ -9,16 +9,16 @@ test_expect_success 'setup rebasing on top of a lot of changes' '
9 git checkout -f -B base &&
10 git checkout -B to-rebase &&
11 git checkout -B upstream &&
12 - for i in $(seq 100)
12 + for i in $(test_seq 100)
13 do
14 # simulate huge diffs
15 echo change$i >unrelated-file$i &&
16 - seq 1000 >>unrelated-file$i &&
16 + test_seq 1000 >>unrelated-file$i &&
17 git add unrelated-file$i &&
18 test_tick &&
19 git commit -m commit$i unrelated-file$i &&
20 echo change$i >unrelated-file$i &&
21 - seq 1000 | tac >>unrelated-file$i &&
21 + test_seq 1000 | tac >>unrelated-file$i &&
22 git add unrelated-file$i &&
23 test_tick &&
24 git commit -m commit$i-reverse unrelated-file$i ||