Author: bernhard
Date: Thu Oct 27 15:04:13 2005
New Revision: 9603
Modified:
trunk/MANIFEST.SKIP
trunk/config/gen/makefiles/languages.in
trunk/config/gen/makefiles/root.in
trunk/languages/ (props changed)
trunk/languages/testall
trunk/t/harness
Log:
Add targets 'smoke' and 'smoke-clean' to languages/Makefile.
Make languages-smoke should send smoke report to smoke server.
Modified: trunk/MANIFEST.SKIP
==============================================================================
--- trunk/MANIFEST.SKIP (original)
+++ trunk/MANIFEST.SKIP Thu Oct 27 15:04:13 2005
@@ -1,5 +1,5 @@
# $Id$
-# generated by gen_manifest_skip.pl Thu Oct 20 23:55:34 2005
+# generated by gen_manifest_skip.pl Fri Oct 28 00:02:24 2005
#
# Please update t/src/manifest.t when adding patterns here
\B\.svn\b
@@ -222,6 +222,7 @@
^examples/pasm/hello/
^examples/pasm/hello\.pbc$
^examples/pasm/hello\.pbc/
+# generated from svn:ignore of 'examples/pge/'
# generated from svn:ignore of 'examples/pir/'
# generated from svn:ignore of 'examples/pni/'
# generated from svn:ignore of 'examples/sdl/'
@@ -319,6 +320,8 @@
^languages/Makefile/
^languages/.*\.tmp$
^languages/.*\.tmp/
+^languages/languages_smoke\.html$
+^languages/languages_smoke\.html/
# generated from svn:ignore of 'languages/BASIC/'
# generated from svn:ignore of 'languages/BASIC/compiler/'
# generated from svn:ignore of 'languages/BASIC/compiler/samples/'
@@ -816,6 +819,7 @@
# generated from svn:ignore of 'runtime/parrot/library/Getopt/'
^runtime/parrot/library/Getopt/.*\.pbc$
^runtime/parrot/library/Getopt/.*\.pbc/
+# generated from svn:ignore of 'runtime/parrot/library/JSON/'
# generated from svn:ignore of 'runtime/parrot/library/PGE/'
^runtime/parrot/library/PGE/.*\.pbc$
^runtime/parrot/library/PGE/.*\.pbc/
Modified: trunk/config/gen/makefiles/languages.in
==============================================================================
--- trunk/config/gen/makefiles/languages.in (original)
+++ trunk/config/gen/makefiles/languages.in Thu Oct 27 15:04:13 2005
@@ -44,6 +44,12 @@ help:
@echo ""
@echo " help: Print this help message."
@echo ""
+ @echo " smoke: Run the test suite and send smoke.html to "
+ @echo " http://smoke.parrotcode.org/"
+ @echo ""
+ @echo " smoke-clean: clean up smoke.html"
+ @echo ""
+ @echo ""
@echo "Following languages are available:"
@echo " $(LANGUAGES)"
@echo "A particular language <lang> can be built, tested and cleand up"
@@ -54,7 +60,14 @@ help:
@echo ""
test: all
- $(PERL) -I ../lib testall
+ $(PERL) testall
+
+smoke: all
+ $(PERL) testall --html
+ $(PERL) ../util/smokeserv-client.pl languages_smoke.html
+
+smoke-clean :
+ $(RM_F) languages_smoke.html
clean: \
BASIC.clean \
@@ -75,7 +88,8 @@ clean: \
regex.clean \
scheme.clean \
tcl.clean \
- urm.clean
+ urm.clean \
+ smoke-clean
#
@@ -96,9 +110,9 @@ Zcode : Zcode.dummy
Zcode.dummy:
# Do nothing. make Zcode requires an Inform compiler
Zcode.test:
- $(MAKE_C) Zcode test
+ - $(MAKE_C) Zcode test
Zcode.clean:
- $(MAKE_C) Zcode clean
+ - $(MAKE_C) Zcode clean
bc : bc.dummy
bc.dummy:
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in (original)
+++ trunk/config/gen/makefiles/root.in Thu Oct 27 15:04:13 2005
@@ -632,6 +632,7 @@ help :
@echo " compilers: Proxy for default target of compilers/pge"
@echo " languages: Proxy for default target of
languages/Makefile"
@echo " languages-test: Proxy for target 'test' of
languages/Makefile"
+ @echo " languages-smoke: Proxy for target 'test' of
languages/Makefile"
@echo " languages-clean: Proxy for target 'clean' of
languages/Makefile"
@echo ""
@echo "fetch from source repository:"
@@ -1175,6 +1176,9 @@ languages.dummy :
languages-test :
$(MAKE_C) languages test
+languages-smoke :
+ $(MAKE_C) languages smoke
+
languages-clean :
$(MAKE_C) languages clean
Modified: trunk/languages/testall
==============================================================================
--- trunk/languages/testall (original)
+++ trunk/languages/testall Thu Oct 27 15:04:13 2005
@@ -4,9 +4,13 @@
use strict;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+
use Data::Dumper;
use File::Spec;
-use Test::Harness;
+use Test::Harness();
+use Parrot::Config qw/%PConfig/;
=head1 languages harness
@@ -34,6 +38,10 @@ e.g., C<cd languages/tcl && t/joe_test.t
=back
+=head1 TODO
+
+There is too much overlap with ../t/harness.
+
=head1 AUTHOR
Will "Coke" Coleda
@@ -50,6 +58,12 @@ have already been built.
=cut
+
+# Step 0: handle command line args
+
+my $html = grep { $_ eq '--html' } @ARGV;
[EMAIL PROTECTED] = grep { $_ ne '--html' } @ARGV;
+
# Step 1: find harness files for testable languages
# These could all be tested:
@@ -88,15 +102,61 @@ my @harnesses =
# Step 2: Get a listing of files from these harnesses.
-my @testfiles;
+my @tests;
foreach my $harness (@harnesses) {
- my $perl = "$^X -I" . File::Spec->join(File::Spec->updir,"lib");
+ my $perl = "$^X -I" . File::Spec->join(File::Spec->updir(), 'lib');
open(FILES, "$perl $harness --files |");
- push @testfiles, <FILES>;
+ push @tests, <FILES>;
close(FILES);
}
-chomp(@testfiles);
+chomp(@tests);
# Step 3: test.
-runtests(@testfiles);
+unless ($html) {
+ Test::Harness::runtests(@tests);
+} else {
+ my @smoke_config_vars = qw(
+ osname
+ archname
+ cc
+ 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 $languages = join( q{ }, @unified_testable_languages );
+ my $v = Test::TAP::HTMLMatrix->new(
+ $model,
+ join("\n",
+ "languages: $languages",
+ "duration: $duration",
+ "branch: unknown",
+ "Parrot languages: yes",
+ "harness_args: languages",
+ map { "$_: $PConfig{$_}" } sort @smoke_config_vars),
+ );
+
+ $v->has_inline_css(1); # no separate css file
+
+ open HTML, ">", "languages_smoke.html";
+ print HTML $v->html();
+ close HTML;
+
+ print "smoke.html has been generated.\n";
+}
+
Modified: trunk/t/harness
==============================================================================
--- trunk/t/harness (original)
+++ trunk/t/harness Thu Oct 27 15:04:13 2005
@@ -82,7 +82,7 @@ use strict;
use lib qw(lib imcc);
use Getopt::Std;
-use Test::Harness qw(runtests);
+use Test::Harness();
use Parrot::Config qw/%PConfig/;
@@ -136,7 +136,7 @@ my @default_tests = ( ( map { glob( "t/$
my @tests = @ARGV ? map { glob( $_ ) } @ARGV : @default_tests;
unless ($html) {
- runtests(@tests);
+ Test::Harness::runtests(@tests);
} else {
my @smoke_config_vars = qw(
osname
@@ -156,9 +156,9 @@ unless ($html) {
};
die "You must have Test::TAP::HTMLMatrix installed.\n\n$@" if $@;
- my $start = time;
+ my $start = time();
my $model = Test::TAP::Model::Visual->new_with_tests(@tests);
- my $end = time;
+ my $end = time();
my $duration = $end - $start;