Reconfigure and tidy up the testFailure stuff
Many variables renamed. Generated files are now named .log for .gitignore Actions are now defined in CONFIG_BASE variables.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,7 +7,6 @@
|
||||
/include/
|
||||
/templates/
|
||||
/configure/*.local
|
||||
/.tests-failed
|
||||
O.*/
|
||||
/QtC-*
|
||||
*.orig
|
||||
|
||||
@@ -83,14 +83,18 @@ REPLACEVAR = $(PERL) $(TOOLS)/replaceVAR.pl
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Tools for testing
|
||||
TAPTOJUNIT = $(PERL) $(TOOLS)/tap-to-junit-xml.pl
|
||||
PROVE = $(PERL) $(TOOLS)/epicsProve.pl
|
||||
PROVE.tap = $(PROVE) --ext .tap --exec "$(CAT)"
|
||||
TAPS_FAILED_LOG = .taps-failed.log
|
||||
TESTS_FAILED_LOG = .tests-failed.log
|
||||
TESTS_FAILED_PATH = $(abspath $(TOP)/$(TESTS_FAILED_LOG))
|
||||
|
||||
TEST_FAILURE_FILE = $(abspath $(TOP)/.tests-failed)
|
||||
PROVE_FAILURE = echo $(abspath .)>> $(TEST_FAILURE_FILE)
|
||||
TAPS_FAILURE_FILE = .taps-failed
|
||||
TAPFILE_FAILURE = echo $@>> $(TAPS_FAILURE_FILE)
|
||||
TAPTOJUNIT = $(PERL) $(TOOLS)/tap-to-junit-xml.pl
|
||||
PROVE = $(PERL) $(TOOLS)/epicsProve.pl --failures --color
|
||||
PROVE.tap = $(PROVE) --ext .tap --exec "$(CAT)"
|
||||
TESTFAILURES = $(PERL) $(TOOLS)/testFailures.pl
|
||||
SHOWTESTFAILURES = $(TESTFAILURES) $(TESTS_FAILED_PATH) $(TAPS_FAILED_LOG)
|
||||
|
||||
PROVE_FAILURE = echo $(abspath .)>> $(TESTS_FAILED_PATH)
|
||||
TAPFILE_FAILURE = echo $@>> $(TAPS_FAILED_LOG)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# private versions of lex/yacc from EPICS
|
||||
|
||||
@@ -339,8 +339,8 @@ runtests: run-tap-tests
|
||||
run-tap-tests: $(TESTSCRIPTS.t)
|
||||
ifneq ($(TESTSCRIPTS.t),)
|
||||
ifdef RUNTESTS_ENABLED
|
||||
$(ECHO) "$(PROVE) --failures --color $^"
|
||||
@$(PROVE) --failures --color $^ || $(PROVE_FAILURE)
|
||||
$(ECHO) "$(PROVE) $^"
|
||||
@$(PROVE) $^ || $(PROVE_FAILURE)
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -351,8 +351,8 @@ test-results: tap-results
|
||||
tap-results: $(TAPFILES)
|
||||
ifneq ($(strip $(TAPFILES)),)
|
||||
ifdef RUNTESTS_ENABLED
|
||||
$(ECHO) "$(PROVE.tap) --failures --color $^"
|
||||
@$(PROVE.tap) --failures --color $^ || $(PROVE_FAILURE)
|
||||
$(ECHO) "$(PROVE.tap) $^"
|
||||
@$(PROVE.tap) $^ || $(PROVE_FAILURE)
|
||||
endif
|
||||
|
||||
CURRENT_TAPFILES := $(wildcard $(TAPFILES))
|
||||
@@ -360,8 +360,8 @@ CURRENT_JUNITFILES := $(wildcard $(JUNITFILES))
|
||||
endif
|
||||
|
||||
clean-tests:
|
||||
ifneq ($(CURRENT_TAPFILES),)
|
||||
$(RM) $(CURRENT_TAPFILES) $(TAPS_FAILURE_FILE)
|
||||
ifneq ($(CURRENT_TAPFILES)$(TAPS_FAILED_LOG),)
|
||||
$(RM) $(CURRENT_TAPFILES) $(TAPS_FAILED_LOG)
|
||||
endif
|
||||
ifneq ($(CURRENT_JUNITFILES),)
|
||||
$(RM) $(CURRENT_JUNITFILES)
|
||||
|
||||
@@ -37,9 +37,9 @@ uninstall$(DIVIDER)%:
|
||||
|
||||
before-runtests before-test-results: rm-failure-file
|
||||
rm-failure-file:
|
||||
@$(RM) $(TEST_FAILURE_FILE)
|
||||
@$(RM) $(TESTS_FAILED_PATH)
|
||||
runtests test-results:
|
||||
$(PERL) $(TOOLS)/testFailures.pl $(TEST_FAILURE_FILE)
|
||||
$(SHOWTESTFAILURES)
|
||||
|
||||
help:
|
||||
@echo "Usage: gnumake [options] [target] ..."
|
||||
|
||||
@@ -16,28 +16,30 @@ use warnings;
|
||||
|
||||
use File::Basename;
|
||||
|
||||
die "Usage: testFailures.pl /path/to/base/.tests-failed\n"
|
||||
unless @ARGV == 1;
|
||||
die "Usage: testFailures.pl /path/to/top/.tests-failed.log .taps-failed.log\n"
|
||||
unless @ARGV == 2;
|
||||
|
||||
my $path = shift;
|
||||
my $base = dirname($path);
|
||||
my ($dirlog, $faillog) = @ARGV;
|
||||
my $top = dirname($dirlog);
|
||||
|
||||
open(my $failures, '<', $path) or
|
||||
# No file means success.
|
||||
open(my $logfile, '<', $dirlog) or
|
||||
exit 0;
|
||||
my @failures = dedup(<$failures>);
|
||||
close $failures;
|
||||
chomp @failures;
|
||||
my @faildirs = dedup(<$logfile>);
|
||||
close $logfile;
|
||||
chomp @faildirs;
|
||||
|
||||
exit 0 unless @failures;
|
||||
# Empty file also means success.
|
||||
exit 0 unless grep {$_} @faildirs;
|
||||
|
||||
print "\nTests failed:\n";
|
||||
for my $dir (@failures) {
|
||||
print "\nTests failed in:\n";
|
||||
for my $dir (@faildirs) {
|
||||
my $reldir = $dir;
|
||||
$reldir =~ s($base/)();
|
||||
print " In $reldir:\n";
|
||||
open(my $taps, '<', "$dir/.taps-failed") or next;
|
||||
my @taps = dedup(<$taps>);
|
||||
close $taps;
|
||||
$reldir =~ s($top/)();
|
||||
print " $reldir\n";
|
||||
open(my $taplog, '<', "$dir/$faillog") or next;
|
||||
my @taps = dedup(<$taplog>);
|
||||
close $taplog;
|
||||
chomp @taps;
|
||||
print '', (map {" $_\n"} @taps), "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user