Commit 6b8788e4 authored by Michael Widenius's avatar Michael Widenius

Reverted unittest/unit.pl back to Test::Harness as some of our build machines...

Reverted unittest/unit.pl back to Test::Harness as some of our build machines didn't support the new recommended TAP::Harness module

unittest/mytap/tap.c:
  Fixed output for some tests that didn't call plan()
parent 5cf6ccd2
...@@ -190,7 +190,7 @@ static signal_entry install_signal[]= { ...@@ -190,7 +190,7 @@ static signal_entry install_signal[]= {
}; };
int skip_big_tests= 1; int skip_big_tests= 1;
ulong start_time; ulong start_time= 0;
void void
plan(int count) plan(int count)
...@@ -335,9 +335,12 @@ int exit_status() ...@@ -335,9 +335,12 @@ int exit_status()
diag("Failed %d tests!", g_test.failed); diag("Failed %d tests!", g_test.failed);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
end_timer(start_time, buff); if (start_time)
printf("Test took %s\n", buff); {
fflush(stdout); end_timer(start_time, buff);
printf("Test took %s\n", buff);
fflush(stdout);
}
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
use TAP::Harness; use Test::Harness;
use File::Find; use File::Find;
use Getopt::Long; use Getopt::Long;
...@@ -37,11 +37,10 @@ unit - Run unit tests in directory ...@@ -37,11 +37,10 @@ unit - Run unit tests in directory
=cut =cut
my $big= $ENV{'MYTAP_CONFIG'} eq 'big'; my $big= $ENV{'MYTAP_CONFIG'} eq 'big';
my $verbose= 0;
my $result = GetOptions ( my $result = GetOptions (
"big!" => \$big, "big!" => \$big,
"verbose!" => \$verbose, "verbose!" => \$Test::Harness::verbose,
); );
$ENV{'MYTAP_CONFIG'} = $big ? 'big' : ''; $ENV{'MYTAP_CONFIG'} = $big ? 'big' : '';
...@@ -103,14 +102,8 @@ sub run_cmd (@) { ...@@ -103,14 +102,8 @@ sub run_cmd (@) {
if (@files > 0) { if (@files > 0) {
# Removing the first './' from the file names # Removing the first './' from the file names
foreach (@files) { s!^\./!! } foreach (@files) { s!^\./!! }
$ENV{'HARNESS_PERL_SWITCHES'} .= ' -e "exec @ARGV"';
my %args = ( $Test::Harness::Timer = 1;
verbosity => $verbose, runtests @files;
timer => 1,
exec => [ "/bin/sh", "-c" ],
);
my $harness= TAP::Harness->new( \%args );
$harness->runtests(@files);
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment