diff options
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/mytap/tap.c | 11 | ||||
-rw-r--r-- | unittest/unit.pl | 17 |
2 files changed, 12 insertions, 16 deletions
diff --git a/unittest/mytap/tap.c b/unittest/mytap/tap.c index 4bb501e54dc..e0e42c6eb5e 100644 --- a/unittest/mytap/tap.c +++ b/unittest/mytap/tap.c @@ -190,7 +190,7 @@ static signal_entry install_signal[]= { }; int skip_big_tests= 1; -ulong start_time; +ulong start_time= 0; void plan(int count) @@ -335,9 +335,12 @@ int exit_status() diag("Failed %d tests!", g_test.failed); return EXIT_FAILURE; } - end_timer(start_time, buff); - printf("Test took %s\n", buff); - fflush(stdout); + if (start_time) + { + end_timer(start_time, buff); + printf("Test took %s\n", buff); + fflush(stdout); + } return EXIT_SUCCESS; } diff --git a/unittest/unit.pl b/unittest/unit.pl index 23ec954f720..9900f47f374 100644 --- a/unittest/unit.pl +++ b/unittest/unit.pl @@ -14,7 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -use TAP::Harness; +use Test::Harness; use File::Find; use Getopt::Long; @@ -37,11 +37,10 @@ unit - Run unit tests in directory =cut my $big= $ENV{'MYTAP_CONFIG'} eq 'big'; -my $verbose= 0; my $result = GetOptions ( "big!" => \$big, - "verbose!" => \$verbose, + "verbose!" => \$Test::Harness::verbose, ); $ENV{'MYTAP_CONFIG'} = $big ? 'big' : ''; @@ -103,14 +102,8 @@ sub run_cmd (@) { if (@files > 0) { # Removing the first './' from the file names foreach (@files) { s!^\./!! } - - my %args = ( - verbosity => $verbose, - timer => 1, - exec => [ "/bin/sh", "-c" ], - ); - my $harness= TAP::Harness->new( \%args ); - $harness->runtests(@files); + $ENV{'HARNESS_PERL_SWITCHES'} .= ' -e "exec @ARGV"'; + $Test::Harness::Timer = 1; + runtests @files; } } - |