]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
Test improvements
authorMichal Sojka <michal.sojka@cvut.cz>
Wed, 12 Sep 2018 10:16:05 +0000 (12:16 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Wed, 12 Sep 2018 13:54:15 +0000 (15:54 +0200)
- we test --fit flag
- we do not rerun tests if the log is up to date
- vot2016.zip is not downloaded in vot2016 directory already exists

.gitignore
Makefile

index 738e2779154f6b560c825c816970227f728c5b4e..fc8c279688ddadf602a7cca9f67cc26e46189eb6 100644 (file)
@@ -3,5 +3,5 @@ build*
 main_test.cpp
 src/complexmat_cv.hpp
 *TODO*
-
+/vot2016/
 *.kdev4
index 8ce0c8154de96fcf1742521a2eb291ee48a3111d..cb5d1feb76c3a79530aab79ba3017b7e6a2f3528 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@
 
 BUILDS = opencvfft-st opencvfft-async opencvfft-openmp fftw fftw-async fftw-openmp fftw-big fftw-big-openmp cufftw cufftw-big cufftw-big-openmp cufft cufft-openmp cufft-big cufft-big-openmp
 TESTSEQ = bag ball1 car1
+TESTFLAGS = default fit128
 
 all: $(foreach build,$(BUILDS),build-$(build)/kcf_vot)
 
@@ -32,7 +33,7 @@ build-%/build.ninja:
        cd $(@D) && cmake $(CMAKE_OPTS) $(CMAKE_OTPS_$*) ..
 
 .PHONY: FORCE
-build-%/kcf_vot: build-%/build.ninja FORCE
+build-%/kcf_vot: build-%/build.ninja $(shell git ls-files)
        @echo '############################################################'
        cmake --build $(@D)
 
@@ -48,24 +49,31 @@ clean:
 print-test-results = grep ^Average $(1)|sed -E -e 's|build-(.*)/kcf_vot-(.*).log:|\2;\1;|'|sort|column -t -s';'
 
 test: $(BUILDS:%=test-%)
-       @echo "Summary test results:
-       @$(call print-test-results,$(foreach build,$(BUILDS),$(foreach seq,$(TESTSEQ),build-$(build)/kcf_vot-$(seq).log)))
+       @echo; echo "Summary test results:"
+       @$(call print-test-results,$(foreach build,$(BUILDS),\
+                                  $(foreach seq,$(TESTSEQ),\
+                                  $(foreach f,$(TESTFLAGS),build-$(build)/kcf_vot-$(seq)-$(f).log))))
 
 $(BUILDS:%=test-%): test-%:
-       @$(call print-test-results,$(foreach seq,$(TESTSEQ),build-$*/kcf_vot-$(seq).log))
+       @$(call print-test-results,$(foreach seq,$(TESTSEQ),\
+                                  $(foreach f,$(TESTFLAGS),build-$*/kcf_vot-$(seq)-$(f).log)))
 
 # Usage: testcase <build> <seq>
 define testcase
 test-$(1): test-$(1)-$(2)
-test-$(1)-$(2): build-$(1)/kcf_vot
-       $$< vot2016/$(2) | tee $$(<)-$(2).log
+test-$(1)-$(2): $(foreach f,$(TESTFLAGS),build-$(1)/kcf_vot-$(2)-$(f).log)
+$(foreach f,$(TESTFLAGS),build-$(1)/kcf_vot-$(2)-$(f).log): build-$(1)/kcf_vot $$(filter-out %/output.txt,$$(wildcard vot2016/$(2)/*)) | vot2016/$(2)
+       $$< $$(if $$(@:%fit128.log=),,--fit=128) vot2016/$(2) > $$@
+       cat $$@
 endef
 
 $(foreach build,$(BUILDS),$(foreach seq,$(TESTSEQ),$(eval $(call testcase,$(build),$(seq)))))
 
-vot2016: vot2016.zip
-       unzip -d $@ -q $^ || :
+vot2016 $(TESTSEQ:%=vot2016/%): vot2016.zip
+       unzip -d vot2016 -q $^
        for i in $$(ls -d vot2016/*/); do ( echo Creating $${i}images.txt; cd $$i; ls *.jpg > images.txt ); done
 
+.INTERMEDIATE: vot2016.zip
+.SECONDARY:    vot2016.zip
 vot2016.zip:
        wget http://data.votchallenge.net/vot2016/vot2016.zip