]> git.ipfire.org Git - thirdparty/git.git/commitdiff
perf lint: add make test-lint to perf tests
authorNipunn Koorapati <nipunn@dropbox.com>
Tue, 20 Oct 2020 13:41:02 +0000 (13:41 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Oct 2020 19:52:23 +0000 (12:52 -0700)
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>
t/Makefile
t/perf/Makefile
t/perf/p3400-rebase.sh

index c83fd18861f31039bc14ec71a9a897b03359b2c7..882d26eee30b115f4c656e0ab5048f4e2e96319b 100644 (file)
@@ -34,6 +34,7 @@ CHAINLINTTMP_SQ = $(subst ','\'',$(CHAINLINTTMP))
 T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
 TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
 THELPERS = $(sort $(filter-out $(T),$(wildcard *.sh)))
+TPERF = $(sort $(wildcard perf/p[0-9][0-9][0-9][0-9]-*.sh))
 CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.test)))
 CHAINLINT = sed -f chainlint.sed
 
@@ -81,17 +82,17 @@ test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
        test-lint-filenames
 
 test-lint-duplicates:
-       @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
+       @dups=`echo $(T) $(TPERF) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
                test -z "$$dups" || { \
                echo >&2 "duplicate test numbers:" $$dups; exit 1; }
 
 test-lint-executable:
-       @bad=`for i in $(T); do test -x "$$i" || echo $$i; done` && \
+       @bad=`for i in $(T) $(TPERF); do test -x "$$i" || echo $$i; done` && \
                test -z "$$bad" || { \
                echo >&2 "non-executable tests:" $$bad; exit 1; }
 
 test-lint-shell-syntax:
-       @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS)
+       @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS) $(TPERF)
 
 test-lint-filenames:
        @# We do *not* pass a glob to ls-files but use grep instead, to catch
index 8c47155a7c86eebe4b8189601866b2b4df4a4f22..fcb0e8865e49335d5a9afe3941bcea2c58f4bcd8 100644 (file)
@@ -1,7 +1,7 @@
 -include ../../config.mak
 export GIT_TEST_OPTIONS
 
-all: perf
+all: test-lint perf
 
 perf: pre-clean
        ./run
@@ -12,4 +12,7 @@ pre-clean:
 clean:
        rm -rf build "trash directory".* test-results
 
+test-lint:
+       $(MAKE) -C .. test-lint
+
 .PHONY: all perf pre-clean clean
index d202aaed06fc6cba62a1955e790bbe324d365235..7a0bb294480a6d98ec3db506dff3eafa57cb30f0 100755 (executable)
@@ -9,16 +9,16 @@ test_expect_success 'setup rebasing on top of a lot of changes' '
        git checkout -f -B base &&
        git checkout -B to-rebase &&
        git checkout -B upstream &&
-       for i in $(seq 100)
+       for i in $(test_seq 100)
        do
                # simulate huge diffs
                echo change$i >unrelated-file$i &&
-               seq 1000 >>unrelated-file$i &&
+               test_seq 1000 >>unrelated-file$i &&
                git add unrelated-file$i &&
                test_tick &&
                git commit -m commit$i unrelated-file$i &&
                echo change$i >unrelated-file$i &&
-               seq 1000 | tac >>unrelated-file$i &&
+               test_seq 1000 | tac >>unrelated-file$i &&
                git add unrelated-file$i &&
                test_tick &&
                git commit -m commit$i-reverse unrelated-file$i ||