tests: run sim tests in single JVM
Time for 07-simulation-base before:
real 116.79
user 25.92
sys 3.22
Time for 07-simulation-base after:
real 66.46
user 1.46
sys 0.15
Time for 17-tun-rpl-br before:
real 563.27
user 9.24
sys 1.29
Time for 17-tun-rpl-br after:
real 556.57
user 2.96
sys 0.69
@@ -58,7 +58,14 @@ endif
endif
.PHONY: all clean tests
-tests: $(TESTLOGS)
+
+# Perform a bash loop of $(RUNCOUNT) iterations.
+# Successful simulations do nothing, failures appends test+seed to summary.
+tests: $(TESTS)
+ @for (( SEED=$(BASESEED); SEED < $$(( $(BASESEED) + $(RUNCOUNT) )); SEED++ )); do \
+ $(GRADLE) --no-watch-fs --parallel --build-cache -p $(CONTIKI)/tools/cooja run --args="$(addprefix -nogui=,$(realpath $^)) -contiki=$(realpath $(CONTIKI)) -logdir=$(dir $(realpath $<)) -random-seed=$$SEED" || \
+ echo "TEST FAIL: $^ seed $$SEED" >> summary; \
+ done
# Last line of rule checks for existence of the file summary to decide if
# the test succeeded. Based on that, some output is echoed followed by using
@@ -69,13 +76,5 @@ summary: clean
@([ ! -f summary ] && echo "All tests OK" && touch summary) || \
(echo "Failures:" && cat summary && false)
-# Perform a bash loop of $(RUNCOUNT) iterations.
-# Successful simulations do nothing, failures appends test+seed to summary.
-%.testlog: %.csc
- @for (( SEED=$(BASESEED); SEED < $$(( $(BASESEED) + $(RUNCOUNT) )); SEED++ )); do \
- $(GRADLE) --no-watch-fs --parallel --build-cache -p $(CONTIKI)/tools/cooja run --args="-nogui=$(realpath $<) -contiki=$(realpath $(CONTIKI)) -logdir=$(dir $(realpath $<)) -random-seed=$$SEED" || \
- echo "TEST FAIL: $< seed $$SEED" >> summary; \
- done
-
clean:
$(Q)rm -f *.*log report summary
