Back-ported the tapfiles build target from 3.15

This is the version that works on Windows.
This commit is contained in:
Andrew Johnson
2015-02-13 11:16:24 -06:00
parent 02aa7e2f73
commit 26ab431c0a
6 changed files with 30 additions and 8 deletions

View File

@@ -134,7 +134,7 @@ ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += browse
ACTIONS += runtests
ACTIONS += runtests tapfiles
actionArchTargets = $(foreach x, $(ACTIONS),\ $(foreach arch,$(BUILD_ARCHS), $(x)$(DIVIDER)$(arch)))

View File

@@ -17,7 +17,7 @@ ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += browse
ACTIONS += runtests
ACTIONS += runtests tapfiles
#ACTIONS += rebuild
actionPart = $(word 1, $(subst $(DIVIDER), ,$@))

View File

@@ -96,6 +96,8 @@ ifneq (,$(strip $(TESTS)))
TARGETS += testspec
endif
TAPFILES += $(TESTSCRIPTS:.t=.tap)
#---------------------------------------------------------------
# Libraries
#
@@ -142,7 +144,8 @@ clean::
@$(RM) *.i *$(OBJ) *.a $(TESTPRODNAME) $(LIBNAME) $(SHRLIBNAME) \
$(INC) $(TARGETS) $(DLL_LINK_LIBNAME) $(TDS) \
*.out MakefileInclude $(LOADABLE_SHRLIBNAME) *.manifest *.exp \
$(COMMON_INC) $(HDEPENDS_FILES) $(PRODTARGETS) $(TESTSCRIPTS)
$(COMMON_INC) $(HDEPENDS_FILES) $(PRODTARGETS) \
$(TESTSCRIPTS) $(TAPFILES)
ifdef RES
@$(RM) *$(RES)
endif
@@ -338,16 +341,22 @@ testspec: $(TESTSCRIPTS)
$(if $^, @echo Tests: $^ >> $@)
$(if $(TESTSPEC_$(OS_CLASS)), @echo "Harness: $(TESTSPEC_$(OS_CLASS))" >> $@)
tapfiles: $(TESTSCRIPTS) $(TAPFILES)
# A .tap file is the output from running the associated test script
%.tap: %.t
-$(PERL) $< -tap > $@
# If there's a perl test script (.plt) available, use it
%.t: ../%.plt
@$(RM) $@
@$(CP) $< $@
$(CP) $< $@
# Some versions of Test::Harness expect test programs in perl only.
# Test programs (.t files) must be written in Perl.
# Generate a perl program to exec the real test binary.
%.t: %$(EXE)
%.t: %$(EXE) $(TOOLS)/makeTestfile.pl
@$(RM) $@
@$(PERL) $(TOOLS)/makeTestfile.pl $@ $<
$(PERL) $(TOOLS)/makeTestfile.pl $@ $<
#---------------------------------------------------------------
## Install rules for BIN_INSTALLS and LIB_INSTALLS

View File

@@ -12,7 +12,8 @@
ARCHS += $(BUILD_ARCHS)
ACTIONS += inc build install buildInstall clean realclean archclean runtests
ACTIONS += inc build install buildInstall clean realclean archclean
ACTIONS += runtests tapfiles
dirPart = $(join $(dir $@), $(word 1, $(subst $(DIVIDER), ,$(notdir $@))))

View File

@@ -13,6 +13,15 @@
<!-- Insert new items immediately below here ... -->
<h3>Back-ported the <q>tapfiles</q> build target from 3.15</h3>
<p>This GNUmake target runs the same tests as the <q>runtests</q> target, but
instead of summarizing or displaying the output for each test script it creates
a <q>.tap</q> file inside the architecture build directory which contains the
detailed test output. The output file can be parsed by continuous integration
packages such as <a href="http://www.jenkins-ci.org/">Jenkins</a> to show the
test results.</p>
<h3>Fix buffer overflow in epicsStrnRawFromEscaped()</h3>
<p>Launchpad <a href="https://bugs.launchpad.net/bugs/1388313">bug

View File

@@ -12,6 +12,8 @@
# because some versions of the Perl test harness can only run test scripts
# that are actually written in Perl. The script we generate execs the
# real test program which must be in the same directory as the .t file.
# If the script is given an argument -tap it sets HARNESS_ACTIVE in the
# environment to make the epicsUnitTest code generate strict TAP output.
# Usage: makeTestfile.pl target.t executable
# target.t is the name of the Perl script to generate
@@ -25,6 +27,7 @@ open(my $OUT, '>', $target) or die "Can't create $target: $!\n";
print $OUT <<EOF;
#!/usr/bin/perl
\$ENV{HARNESS_ACTIVE} = 1 if scalar \@ARGV && shift eq '-tap';
exec './$exe' or die 'exec failed';
EOF