Fix generation of .t files on Windows.

This commit is contained in:
Andrew Johnson
2008-08-27 15:56:37 +00:00
parent 721c91293d
commit 1b41f513fa
3 changed files with 34 additions and 3 deletions
+2 -3
View File
@@ -334,11 +334,10 @@ runtests: $(TESTSCRIPTS_$(BUILD_CLASS))
@$(CP) $< $@
# Some versions of Test::Harness expect test programs in perl only.
# Generate a 1-line perl program to exec the real test binary.
# Uses the $0 runtime path to itself to find the executable.
# Generate a perl program to exec the real test binary.
%.t: %$(EXE)
@$(RM) $@
@echo '($$e=$$0)=~s/.t$$/$(EXE)/;exec "./$$e" or die "exec failed";'>$@
@$(PERL) $(TOOLS)/makeTestfile.pl $@ $<
#---------------------------------------------------------------
## Install rules for BIN_INSTALLS and LIB_INSTALLS
+1
View File
@@ -33,6 +33,7 @@ PERL_SCRIPTS += installEpics.pl
PERL_SCRIPTS += makeDbDepends.pl
PERL_SCRIPTS += makeIncludeDbd.pl
PERL_SCRIPTS += makeMakefile.pl
PERL_SCRIPTS += makeTestfile.pl
PERL_SCRIPTS += mkmf.pl
PERL_SCRIPTS += munch.pl
PERL_SCRIPTS += replaceVAR.pl
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/perl
#*************************************************************************
# Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
# The makeTestfile.pl script generates a file $target.t which is needed
# 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.
# Usage: makeTestfile.pl target.t executable
# target.t is the name of the Perl script to generate
# executable is the name of the file the script runs
use strict;
my ($target, $exe) = @ARGV;
open(my $OUT, '>', $target) or die "Can't create $target: $!\n";
print $OUT <<EOF;
#!/usr/bin/perl
exec '$exe' or die 'exec failed';
EOF
close $OUT or die "Can't close $target: $!\n";