Add make targets test-results and clean-tests

These are mainly intended for CI builds.
This commit is contained in:
Andrew Johnson
2017-05-19 15:22:54 -05:00
parent dcadeac903
commit 672fd16ec8
5 changed files with 51 additions and 10 deletions

View File

@@ -134,7 +134,7 @@ ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += browse
ACTIONS += runtests tapfiles junitfiles
ACTIONS += runtests tapfiles clean-tests test-results junitfiles
actionArchTargets = $(foreach x, $(ACTIONS),\ $(foreach arch,$(BUILD_ARCHS), $(x)$(DIVIDER)$(arch)))
@@ -150,6 +150,7 @@ buildInstall : build
rebuild: clean install
.PHONY: all inc build install clean rebuild buildInstall
.PHONY: runtests tapfiles clean-tests test-results junitfiles
$(actionArchTargets) $(BUILD_ARCHS):install
$(cleanArchTargets):clean

View File

@@ -14,7 +14,7 @@ ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += browse
ACTIONS += runtests tapfiles junitfiles
ACTIONS += runtests tapfiles clean-tests test-results junitfiles
#ACTIONS += rebuild
actionArchTargets = $(foreach action, $(ACTIONS), \

View File

@@ -354,6 +354,21 @@ testspec: $(TESTSCRIPTS)
$(if $^, @echo Tests: $^ >> $@)
$(if $(TESTSPEC_$(OS_CLASS)), @echo "Harness: $(TESTSPEC_$(OS_CLASS))" >> $@)
test-results: tapfiles
ifneq ($(TAPFILES),)
ifdef RUNTESTS_ENABLED
prove --failures --ext .tap --exec cat --color $(TAPFILES)
endif
endif
clean-tests:
ifneq ($(TAPFILES),)
$(RM) $(TAPFILES)
endif
ifneq ($(JUNITFILES),)
$(RM) $(JUNITFILES)
endif
tapfiles: $(TESTSCRIPTS) $(TAPFILES)
junitfiles: $(JUNITFILES)
@@ -499,7 +514,7 @@ $(INSTALL_TEMPLATES_SUBDIR)/%: %
.PRECIOUS: $(COMMON_INC)
.PHONY: all inc build install clean rebuild buildInstall
.PHONY: runtests tapfiles junitfiles
.PHONY: runtests tapfiles clean-tests test-results junitfiles
.PHONY: checkRelease warnRelease noCheckRelease
endif # BASE_RULES_BUILD

View File

@@ -9,7 +9,7 @@
ARCHS += $(BUILD_ARCHS)
ACTIONS += inc build install buildInstall clean realclean archclean
ACTIONS += runtests tapfiles junitfiles
ACTIONS += runtests tapfiles clean-tests test-results junitfiles
dirActionArchTargets = $(foreach dir, $(DIRS), \
$(foreach action, $(ACTIONS), \

View File

@@ -14,13 +14,38 @@
<!-- Insert new items immediately below here ... -->
<h3>Self-test JUnit XML Output</h3>
<h3>New test-related make targets</h3>
<p>This release adds a new make target <tt>junitfiles</tt> which if necessary
runs the self-tests and then converts the TAP (Perl Test-Anything-Protocol)
output files (as generated by the <tt>tapfiles</tt> target) into the more
commonly-recognized JUnit XML format. The program that performs this conversion
needs the Perl module <q><tt>XML::Generator</tt></q> to have been installed.</p>
<p>This release adds several new make targets intended for use by developers
and Continuous Integration systems which simplify the task of running the
built-in self-test programs and viewing the results. Since these targets are
intended for limited use they can have requirements for the build host which
go beyond the standard minimum set needed to build and run Base.</p>
<blockquote>
<h4><tt>test-results</tt> &mdash; Summarize test results</h4>
<p>The new make target <tt>test-results</tt> will run the self-tests if
necessary to generate a TAP file for each test, then summarizes the TAP output
files in each test directory in turn, displaying the details of any failures.
This step uses the program <q>prove</q> which comes with Perl, but also needs
<q>cat</q> to be provided in the default search path so will not work on most
Windows systems.</p>
<h4><tt>junitfiles</tt> &mdash; Convert test results to JUnit XML Format</h4>
<p>The new make target <tt>junitfiles</tt> will run the self-tests if necessary
and then convert the TAP output files into the more commonly-supported JUnit
XML format. The program that performs this conversion needs the Perl module
<q><tt>XML::Generator</tt></q> to have been installed.</p>
<h4><tt>clean-tests</tt> &mdash; Delete test result files</h4>
<p>The new make target <tt>clean-tests</tt> removes any test result files from
previous test runs. It cleans both TAP and JUnit XML files.</p>
</blockquote>
<h3>Fix DNS related crash on exit</h3>