all test cases are now run through a wrapper script which traps
STDOUT/STDERR, and echos the output only on a test failure. This supports the usage of Test::More or Test::Harness without breaking the existing test suite behavior. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8535 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e0c0819f9d
commit
94796829eb
2 changed files with 19 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ LANGUAGE = perl5
|
|||
#PERL = valgrind @PERL@
|
||||
PERL = @PERL@
|
||||
SCRIPTSUFFIX = _runme.pl
|
||||
TEST_RUNNER = run-perl-test.pl
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -46,8 +47,9 @@ include $(srcdir)/../common.mk
|
|||
# a file is found which has _runme.pl appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then ( \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(PERL) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX);) \
|
||||
fi;
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(PERL) $(TEST_RUNNER) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ; ) \
|
||||
fi; \
|
||||
|
||||
|
||||
# Clean: remove the generated .pm file
|
||||
%.clean:
|
||||
|
|
|
|||
15
SWIG/Examples/test-suite/perl5/run-perl-test.pl
Executable file
15
SWIG/Examples/test-suite/perl5/run-perl-test.pl
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/perl
|
||||
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
|
||||
if $running_under_some_shell;
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
my $command = shift @ARGV;
|
||||
|
||||
my $output = `perl $command`;
|
||||
|
||||
die "SWIG Perl test failed: \n\n$output\n"
|
||||
if $?;
|
||||
|
||||
exit(0);
|
||||
Loading…
Add table
Add a link
Reference in a new issue