Files
epics-base/src/tools/testFailures.pl
Andrew Johnson d41b3979fb Collect submodule test failures into the parent
Instead of displaying the failures from each submodule at the end
of testing that submodule, RULES_TOP suppresses the output when
it detects a parent module, and RULES_MODULES adds the children's
failure lists into the parent's list so they all get shown at the
end of the tests/results.
2020-05-27 01:43:40 -05:00

39 lines
1.4 KiB
Perl

#!/usr/bin/env perl
#*************************************************************************
# EPICS BASE is distributed subject to a Software License Agreement found
# in the file LICENSE that is included with this distribution.
#*************************************************************************
# This file may appear trivial, but it exists to let the build system
# fail the 'make test-results' target with a nice output including a
# summary of the directories where test failures were reported.
# Test results are collected from the .tap files fed to epicsProve.pl
# which returns with an exit status of 0 (success) if all tests passed
# or 1 (failure) if any of the .tap files contained failed tests.
# When epicsProve.pl indicates a failure, the directory that it was
# running in is appended to the file $(TOP)/.tests-failed which this
# program reads in after all the test directories have been visited.
# The exit status of this program is 1 (failure) if any tests failed,
# otherwise 0 (success).
use strict;
use warnings;
die "Usage: testFailures.pl .tests-failed\n"
unless @ARGV == 1;
# No file means success.
open FAILURES, '<', shift or
exit 0;
chomp(my @failures = <FAILURES>);
close FAILURES;
# A file with just empty lines also mean success
my @dirs = grep {$_} @failures;
exit 0 unless @dirs;
print "\nTest failures were reported in:\n",
(map {" $_\n"} @dirs), "\n\n";
exit 1;