Skip to content

Commit ed5a245

Browse files
nipunn1313gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 89afd5f commit ed5a245

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

t/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ CHAINLINTTMP_SQ = $(subst ','\'',$(CHAINLINTTMP))
3434
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
3535
TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
3636
THELPERS = $(sort $(filter-out $(T),$(wildcard *.sh)))
37+
TPERF = $(sort $(wildcard perf/p[0-9][0-9][0-9][0-9]-*.sh))
3738
CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.test)))
3839
CHAINLINT = sed -f chainlint.sed
3940

@@ -81,17 +82,17 @@ test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
8182
test-lint-filenames
8283

8384
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` && \
8586
test -z "$$dups" || { \
8687
echo >&2 "duplicate test numbers:" $$dups; exit 1; }
8788

8889
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` && \
9091
test -z "$$bad" || { \
9192
echo >&2 "non-executable tests:" $$bad; exit 1; }
9293

9394
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)
9596

9697
test-lint-filenames:
9798
@# We do *not* pass a glob to ls-files but use grep instead, to catch

t/perf/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-include ../../config.mak
22
export GIT_TEST_OPTIONS
33

4-
all: perf
4+
all: test-lint perf
55

66
perf: pre-clean
77
./run
@@ -12,4 +12,7 @@ pre-clean:
1212
clean:
1313
rm -rf build "trash directory".* test-results
1414

15+
test-lint:
16+
$(MAKE) -C .. test-lint
17+
1518
.PHONY: all perf pre-clean clean

t/perf/p3400-rebase.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ test_expect_success 'setup rebasing on top of a lot of changes' '
99
git checkout -f -B base &&
1010
git checkout -B to-rebase &&
1111
git checkout -B upstream &&
12-
for i in $(seq 100)
12+
for i in $(test_seq 100)
1313
do
1414
# simulate huge diffs
1515
echo change$i >unrelated-file$i &&
16-
seq 1000 >>unrelated-file$i &&
16+
test_seq 1000 >>unrelated-file$i &&
1717
git add unrelated-file$i &&
1818
test_tick &&
1919
git commit -m commit$i unrelated-file$i &&
2020
echo change$i >unrelated-file$i &&
21-
seq 1000 | tac >>unrelated-file$i &&
21+
test_seq 1000 | tac >>unrelated-file$i &&
2222
git add unrelated-file$i &&
2323
test_tick &&
2424
git commit -m commit$i-reverse unrelated-file$i ||

0 commit comments

Comments
 (0)