Author: coke
Date: Wed Sep 21 06:24:00 2005
New Revision: 9228

Modified:
   branches/leo-ctx5/config/gen/makefiles/root.in
   branches/leo-ctx5/t/harness
Log:
Fix the dependency for smoke.html, and update the harness with both the original
code from nothingmuch (missed earlier due to an overlooked svn conflict), as 
well as an update for harness_args (allow running the harness with no extra
args)



Modified: branches/leo-ctx5/config/gen/makefiles/root.in
==============================================================================
--- branches/leo-ctx5/config/gen/makefiles/root.in      (original)
+++ branches/leo-ctx5/config/gen/makefiles/root.in      Wed Sep 21 06:24:00 2005
@@ -1573,7 +1573,7 @@ tags.dummy:
 #
 ###############################################################################
 
-smoke.html : $(PARROT)
+smoke.html : all
        $(PERL) t/harness --html
 
 smoke-submit : smoke.html

Modified: branches/leo-ctx5/t/harness
==============================================================================
--- branches/leo-ctx5/t/harness (original)
+++ branches/leo-ctx5/t/harness Wed Sep 21 06:24:00 2005
@@ -70,6 +70,10 @@ Some test scripts run more quickly when 
 
 Invoke parrot with '--gc-debug'.
 
+=item C<--html>
+
+Emit a C<smoke.html> file instead of displaying results.
+
 =back
 
 =cut
@@ -80,6 +84,8 @@ use lib qw(lib imcc);
 use Getopt::Std;
 use Test::Harness qw(runtests);
 
+use Parrot::Config qw/%PConfig/;
+
 # handle the long options
 
 $ENV{RUNNING_MAKE_TEST} = grep { $_ eq '--running-make-test' } @ARGV;
@@ -88,6 +94,9 @@ $ENV{RUNNING_MAKE_TEST} = grep { $_ eq '
 my $gc_debug = grep { $_ eq '--gc-debug' } @ARGV;
 @ARGV = grep { $_ ne '--gc-debug' } @ARGV;
 
+my $html = grep { $_ eq '--html' } @ARGV;
[EMAIL PROTECTED] = grep { $_ ne '--html' } @ARGV;
+
 # Suck the short options into the TEST_PROG_ARGS evar:
 my %opts;
 getopts('wgjPCSefbvdr?hO:', \%opts);
@@ -108,6 +117,7 @@ perl t/harness [options] [testfiles]
     -O[012]    ... optimize
     --running-make-test
     --gc-debug
+    --html
 EOF
     exit;
 }
@@ -124,7 +134,51 @@ my @default_tests = ( ( map { glob( "t/$
                       glob( "t/library/*.t" ),
                     );
 my @tests = @ARGV ? map { glob( $_ ) } @ARGV : @default_tests;
-runtests(@tests);
+
+unless ($html) {
+    runtests(@tests);
+} else {
+    my @smoke_config_vars = qw(
+         osname
+      archname
+      build_dir
+      cpuarch
+      revision
+         VERSION
+         optimize
+         DEVEL
+    );
+
+    eval {
+        require Test::TAP::HTMLMatrix;
+        require Test::TAP::Model::Visual;
+    };
+
+    die "You must have Test::TAP::HTMLMatrix installed.\n\n$@" if $@;
+
+       my $start = time;
+    my $model = Test::TAP::Model::Visual->new_with_tests(@tests);
+       my $end = time;
+
+       my $duration = $end - $start;
+
+    my $v = Test::TAP::HTMLMatrix->new(
+        $model,
+        join("\n",
+                       "duration: $duration",
+            "branch: unknown",
+            "harness_args: " . (($args) ? $args : "N/A"),
+            map { "$_: $PConfig{$_}" } sort @smoke_config_vars),
+    );
+
+    $v->has_inline_css(1); # no separate css file
+
+    open HTML, ">", "smoke.html";
+    print HTML $v->html;
+    close HTML;
+
+    print "smoke.html has been generated.\n";
+}
 
 =head1 HISTORY
 

Reply via email to