cvs -q diff -u
Index: config/gen/makefiles/imcc.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles/imcc.in,v
retrieving revision 1.35
diff -u -r1.35 imcc.in
--- config/gen/makefiles/imcc.in	5 Oct 2003 11:30:39 -0000	1.35
+++ config/gen/makefiles/imcc.in	10 Jan 2004 16:37:22 -0000
@@ -1,37 +1,56 @@
 RM_F = ${rm_f}
 PERL = ${perl}
 
+###############################################################################
+#
+# MAKE CONFIGURATION:
+#
+###############################################################################
+
+# This is set to  MAKE=$make if your $make command doesn't
+# do it for you.
+#
+MAKE_C = $(PERL) -e 'chdir shift @ARGV; system q{$(MAKE)}, @ARGV; exit $$? >> 8;'
+
 all :
 	@echo "Don't make imcc, make parrot"
 
 testclean:
 	$(RM_F)  \
-	        t/*/*.out t/*/*.imc \
-		t/*/*.pbc t/*/*.o t/*/*.stabs.s t/*/*.pasm
+    t/*/*.out \
+    t/*/*.imc \
+    t/*/*.pbc \
+    t/*/*.o \
+    t/*/*.stabs.s \
+    t/*/*.pasm
 
 clean:	testclean
-	$(RM_F) core \
-	        *${o} \
-	        imcparser.output
+	$(RM_F) \
+    core \
+    *.o \
+    imcparser.output
 
 realclean: clean
 	$(RM_F) Makefile
 
 test:
-	$(PERL) t/harness
+	$(MAKE_C) .. test_imcc
+
+fulltest:
+	$(MAKE_C) .. fulltest_imcc
 
 testj:
-	$(PERL) t/harness -j
+	$(MAKE_C) .. testj_imcc
 
 testP:
-	$(PERL) t/harness -P
+	$(MAKE_C) .. testP_imcc
 
 testb:
-	$(PERL) t/harness -b
+	$(MAKE_C) .. testb_imcc
 
 testS:
-	$(PERL) t/harness -S
+	$(MAKE_C) .. testS_imcc
 
 testr:
-	$(PERL) t/harness -r
+	$(MAKE_C) .. testr_imcc
 
Index: config/gen/makefiles/root.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles/root.in,v
retrieving revision 1.178
diff -u -r1.178 root.in
--- config/gen/makefiles/root.in	9 Jan 2004 11:43:27 -0000	1.178
+++ config/gen/makefiles/root.in	10 Jan 2004 16:37:28 -0000
@@ -1,3 +1,5 @@
+# $Id$
+
 ###############################################################################
 #
 # INSTALL CONFIGURATIONS:
@@ -7,7 +9,7 @@
 VERSION     = ${VERSION}${DEVEL}
 
 BUILDPREFIX =
-PREFIX      = /usr/local/parrot/${VERSION}
+PREFIX      = /usr/local/parrot/$(VERSION)
 EXEC_PREFIX = $(PREFIX)
 BINDIR      = $(EXEC_PREFIX)/bin
 LIBDIR      = $(EXEC_PREFIX)/lib
@@ -397,7 +399,16 @@
 	@echo ""
 	@echo "Testing:"
 	@echo "  test:              Run the test suite."
-	@echo "  fulltest:          Run a fuller test suite."
+	@echo "  test_imcc:         Run the test suite only for IMCC tests."
+	@echo "  fulltest:          Run test suite with various options."
+	@echo "  fulltest_imcc:     Run IMCC test suite with various options."
+	@echo "  src_tests:         Run test in C-file."
+	@echo ""
+	@echo "Creating reports:"
+	@echo "  ok:                Print a report."
+	@echo "  okfile:            Save a report into 'parrot.ok."
+	@echo "  nok:               Print a report."
+	@echo "  nokfile:           Save a report into 'parrot.nok."
 	@echo ""
 	@echo "Cleaning:"
 	@echo "  clean:             Basic cleaning up."
@@ -855,61 +866,77 @@
 # The --running-make-test argument is currently used by long-running tests
 # to disable GC_DEBUG.
 EXTRA_TEST_ARGS = --gc-debug --running-make-test
-TEST_FILES = t/op/*.t t/pmc/*.t t/native_pbc/*.t
-SRC_TEST_FILES = t/src/*.t
-
-test : $(TEST_PROG) test_prep testb test_imcc src_tests
-
-fulltest : $(TEST_PROG) test_prep fulltest_dummy fulltest_imcc
+IMCC_TEST_FILES = imcc/t/*/*.t 
+TEST_FILES      = t/op/*.t t/pmc/*.t t/native_pbc/*.t $(IMCC_TEST_FILES)
+SRC_TEST_FILES  = t/src/*.t
+
+# Run test cases with a single call of t/harness
+# Users have to look at only one report.
+test : test_prep
+	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(TEST_PROG_ARGS) -b $(TEST_FILES) $(SRC_TEST_FILES)
 
-fulltest_dummy : src_tests testg testP testj testS testb testr
+fulltest :  testg testP testj testS testb testr src_tests
 
 # Common prep for all test targets
-test_prep : $(LIBPARROT) $(TEST_PROG)
+test_prep : $(TEST_PROG)
 
 # src tests
 src_tests :
 	$(PERL) t/harness $(SRC_TEST_FILES)
 
 # normal (cgoto) runloop
-testg :
+testg : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(TEST_PROG_ARGS) $(TEST_FILES)
 
 # prederef / CGP runloop
-testP :
+testP : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(TEST_PROG_ARGS) -P $(TEST_FILES)
 
 # JIT core
-testj :
+testj : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(TEST_PROG_ARGS) -j $(TEST_FILES)
 
 # switched core
-testS :
+testS : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(TEST_PROG_ARGS) -S $(TEST_FILES)
 
 # bounds checking slow core
-testb :
+testb : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(TEST_PROG_ARGS) -b $(TEST_FILES)
 
 # normal core, write and run pbc
-testr :
+testr : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(TEST_PROG_ARGS) --run-pbc $(TEST_FILES)
-mopstest :
+
+# Running a benchmark
+mopstest : test_prep
 	$(TEST_PROG) $(TEST_PROG_ARGS) examples/assembly/mops.pasm
 
-lifetest :
+# Running the game of live
+lifetest : test_prep
 	$(TEST_PROG) $(TEST_PROG_ARGS) examples/assembly/life.pasm
 
-test_imcc :
-	$(MAKE_C) $(IMCC_DIR) test
+# Running the IMCC test suite
+test_imcc : 
+	$(PERL) t/harness $(IMCC_TEST_FILES)
+
+testj_imcc:
+	$(PERL) t/harness -j $(IMCC_TEST_FILES)
+
+testP_imcc:
+	$(PERL) t/harness -P $(IMCC_TEST_FILES)
+
+testb_imcc:
+	$(PERL) t/harness -b $(IMCC_TEST_FILES)
+
+testS_imcc:
+	$(PERL) t/harness -S $(IMCC_TEST_FILES)
+
+testr_imcc:
+	$(PERL) t/harness -r $(IMCC_TEST_FILES)
+
 
-fulltest_imcc :
-	$(MAKE_C) $(IMCC_DIR) test
-	$(MAKE_C) $(IMCC_DIR) testj
-	$(MAKE_C) $(IMCC_DIR) testP
-	$(MAKE_C) $(IMCC_DIR) testS
-	$(MAKE_C) $(IMCC_DIR) testb
-	$(MAKE_C) $(IMCC_DIR) testr
+fulltest_imcc : test_imcc testj_imcc testP_imcc testS_imcc testb_imcc testr_imcc
 
 # For reporting success or failure with different configurations
 ok:
Index: imcc/TestCompiler.pm
===================================================================
RCS file: /cvs/public/parrot/imcc/TestCompiler.pm,v
retrieving revision 1.18
diff -u -r1.18 TestCompiler.pm
--- imcc/TestCompiler.pm	23 Oct 2003 17:23:00 -0000	1.18
+++ imcc/TestCompiler.pm	10 Jan 2004 16:37:38 -0000
@@ -90,15 +90,17 @@
 	my $TEST_PROG_ARGS = $ENV{TEST_PROG_ARGS} || '';
 	my $s = $PConfig{slash};
 	my $exe = $PConfig{exe};
-	my $PARROT = $ENV{PARROT} || "..${s}parrot$exe";	# XXX
+	#my $PARROT = $ENV{PARROT} || "..${s}parrot$exe";	# XXX
+	my $PARROT = $ENV{PARROT} || "parrot$exe";	# XXX
 
 	if ($gen_pasm) {
 	    system("$PARROT $opt -o $out_f $by_f");
 	}
-	elsif ($TEST_PROG_ARGS =~ /-r/) {
+	elsif ($TEST_PROG_ARGS =~ /-r /) {
 	    my $pbc_f = per_test('.pbc',$count);
-	    $TEST_PROG_ARGS =~ s/-r//;
-	    Parrot::Test::_run_command("$PARROT ${TEST_PROG_ARGS} -o $pbc_f -r -r $by_f",
+	    $TEST_PROG_ARGS =~ s/--run-pbc / /;
+	    $TEST_PROG_ARGS =~ s/-r/ /;
+	    Parrot::Test::_run_command("$PARROT ${TEST_PROG_ARGS} -o $pbc_f -r $by_f",
 		STDOUT => $out_f, STDERR => $out_f);
 	}
 	else {
Index: imcc/t/syn/file.t
===================================================================
RCS file: /cvs/public/parrot/imcc/t/syn/file.t,v
retrieving revision 1.17
diff -u -r1.17 file.t
--- imcc/t/syn/file.t	27 Oct 2003 14:49:50 -0000	1.17
+++ imcc/t/syn/file.t	10 Jan 2004 16:37:39 -0000
@@ -3,7 +3,7 @@
 use TestCompiler tests => 12;
 use Parrot::Config;
 
-my $PARROT = "..$PConfig{slash}parrot$PConfig{exe}";
+my $PARROT = "parrot$PConfig{exe}";
 
 # include file tests
 
Index: t/harness
===================================================================
RCS file: /cvs/public/parrot/t/harness,v
retrieving revision 1.17
diff -u -r1.17 harness
--- t/harness	21 Oct 2003 18:34:15 -0000	1.17
+++ t/harness	10 Jan 2004 16:37:46 -0000
@@ -1,25 +1,56 @@
 #! perl -w
 # $Id: harness,v 1.17 2003/10/21 18:34:15 boemmels Exp $
 
+# Mike Lambert stole parrot/t/harness for perl6/t/harness
+# Leo Toetsch stole perl6/t/harness for imcc/t/harness
+# Bernhard Schmalhofer merged imcc/t/harness back into parrot/t/harness
+
 use strict;
-use lib 'lib';
-use Test::Harness qw(runtests);
+use lib qw(lib imcc);
 
-#
-# Suck the switches into the TEST_PROG_ARGS evar:
-#
+use Getopt::Std;
+use Test::Harness qw(runtests);
 
+# handle the long options
 $ENV{RUNNING_MAKE_TEST} = grep { $_ eq '--running-make-test' } @ARGV;
 @ARGV = grep { $_ ne '--running-make-test' } @ARGV;
+$ENV{PARROT_QUICKTEST} = grep { $_ eq 'quick' } @ARGV;
+@ARGV = grep { $_ ne 'quick' } @ARGV;
+my $gc_debug = grep { $_ eq '--gc-debug' } @ARGV;
+@ARGV = grep { $_ ne '--gc-debug' } @ARGV;
+my $run_pbc = grep { $_ eq '--run-pbc' } @ARGV;
+@ARGV = grep { $_ ne '--run-pbc' } @ARGV;
 
-$ENV{TEST_PROG_ARGS} = join(' ', grep { /^-/ } @ARGV);
-@ARGV = grep { ! /^-/ } @ARGV;
+# Suck the short options into the TEST_PROG_ARGS evar:
+my %opts;
+getopts('wgjPSbvdr?hO:', \%opts);
+if ($opts{'?'} || $opts{h}) {
+	print <<"EOF";
+perl t/harness [options] [testfiles]
+        -w ... warnings on
+	-g ... disable CGoto
+	-j ... run JIT
+	-P ... run Prederef or CGP
+	-S ... run Switched
+	-b ... run bounds checked
+	-v ... run verbose
+	-d ... run debug
+	-r ... assemble to PBC run PBC
+	-O[012] optimize
+EOF
+	exit;
+}
 
-$ENV{PARROT_QUICKTEST} = grep $_ eq 'quick', @ARGV;
-@ARGV = grep $_ ne 'quick', @ARGV;
+my $args = join(' ', map { "-$_" } keys %opts );
+$args =~ s/-O/-O$opts{O}/ if ($opts{O});
+$args .= ' --gc-debug'    if $gc_debug;
+$args .= ' --run-pbc'     if $run_pbc;
+$ENV{TEST_PROG_ARGS} = $args;
 
 # Pass in a list of tests to run on the command line, else run all the tests.
-my @tests = @ARGV
-            ? map { glob $_ } @ARGV
-            : map { glob( "t/$_/*.t" ) } qw(src op pmc native_pbc) ;
+my @default_tests = ( ( map { glob( "t/$_/*.t" ) } qw(op pmc native_pbc) ),
+                      glob( "imcc/t/*/*.t" ),
+                      glob( "t/src/*.t" ),
+                    );
+my @tests = @ARGV ? map { glob( $_ ) } @ARGV : @default_tests;
 runtests(@tests);
