Skip to content

Commit 06a1d91

Browse files
authored
Add promote-failed targets to the Makefiles (#144)
* Add a `make -C testsuite promote-failed` target This target promotes all tests that failed on the previous run; it's good for after running `make -C testsuite parallel`, for example. * Add a `make -f Makefile.jst promote-failed` target Calls out to `make -C testsuite promote-failed`
1 parent d04eb58 commit 06a1d91

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

Makefile.common-jst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,14 @@ test: install_for_test
295295
fi \
296296
fi)
297297

298+
promote-failed:
299+
(export OCAMLSRCDIR=$$(pwd)/_runtest; \
300+
export CAML_LD_LIBRARY_PATH=$$(pwd)/_runtest/lib/ocaml/stublibs; \
301+
if $$(which gfortran > /dev/null 2>&1); then \
302+
export LIBRARY_PATH=$$(dirname $$(gfortran -print-file-name=libgfortran.a)); \
303+
fi; \
304+
cd _runtest/testsuite && make promote-failed)
305+
298306
runtest-upstream: test
299307

300308
test-one: install_for_test

testsuite/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ default:
145145
@echo " promote DIR=p promote the output for the tests located in path p"
146146
@echo " promote LIST=f promote the output for the tests listed in f (one \
147147
per line)"
148+
@echo " promote-failed promote all the tests that failed in the previous run"
148149
@echo " lib build library modules"
149150
@echo " tools build test tools"
150151
@echo " clean delete generated files"
@@ -348,3 +349,12 @@ clean:
348349
report:
349350
@if [ ! -f $(TESTLOG) ]; then echo "No $(TESTLOG) file."; exit 1; fi
350351
@$(AWK) -f ./summarize.awk < $(TESTLOG)
352+
353+
.PHONY: promote-failed
354+
promote-failed: lib tools
355+
@if [ ! -f $(TESTLOG) ]; then echo "No $(TESTLOG) file."; exit 1; fi
356+
@for test in \
357+
$$(awk -f ./summarize.awk -v only_report_failed_tests=1 < $(TESTLOG)); \
358+
do \
359+
$(MAKE) promote TEST="$$test"; \
360+
done

testsuite/summarize.awk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ END {
143143
if (errored){
144144
printf ("\n#### Some fatal error occurred during testing.\n\n");
145145
exit (3);
146+
}else if (only_report_failed_tests){
147+
for (key in RESULTS){
148+
if (RESULTS[key] == "f"){
149+
split(key, key_parts);
150+
test_file = key_parts[1];
151+
gsub("'", "", test_file);
152+
printf("%s\n", test_file);
153+
}
154+
}
146155
}else{
147156
for (key in SKIPPED){
148157
if (!SKIPPED[key]){

0 commit comments

Comments
 (0)