This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: jacks test suite


I'm checking this in.

This adds simple support for the Jacks test suite to libgcj.  If you
put a copy of Jacks into <srcdir>/libjava/testsuite/libjava.jacks/jacks,
the libgcj test suite will automatically run it.

You can find Jacks here:

http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html

Jacks is a test suite for Java compiler front ends.  It is GPL.

Currently we don't do all that well on Jacks:

    Total 4699
    Passed 3713
    Skipped 167
    Failed 819

The test wrapper itself is a bit ugly.  Jacks can't be run outside its
source tree.  So, we make a copy of the tree in order to do our work.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* libjava.jacks/jacks.exp: New file.

Index: libjava.jacks/jacks.exp
===================================================================
RCS file: libjava.jacks/jacks.exp
diff -N libjava.jacks/jacks.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libjava.jacks/jacks.exp 6 Nov 2002 00:55:25 -0000
@@ -0,0 +1,81 @@
+# Run the Jacks test suite.
+# See http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html
+
+proc gcj_jacks_write {filename} {
+  global GCJ_UNDER_TEST
+
+  set gcjl [split $GCJ_UNDER_TEST]
+  set gcj_cmd [lindex $gcjl 0]
+  set rest [join [lreplace $gcjl 0 0]]
+  append rest " -C"
+
+  set fd [open $filename w]
+  puts $fd "set JAVAC $gcj_cmd"
+  puts $fd "set JAVA_CLASSPATH \"\""
+  puts $fd "set JAVAC_FLAGS [list $rest]"
+  puts $fd "set JAVA [list [libjava_find_gij]]"
+  puts $fd "set JAVA_FLAGS \"\""
+  puts $fd "set JAVAC_ENCODING_FLAG --encoding="
+  puts $fd "set tcltest::testConstraints(encoding) 1"
+  puts $fd "set tcltest::testConstraints(gcj) 1"
+  # "Time-consuming JVM limitation tests".
+  # puts $fd "set tcltest::testConstraints(jvm) 1"
+  close $fd
+}
+
+proc gcj_jacks_parse {file} {
+  if {[catch {open $file} fd]} {
+    verbose "couldn't parse Jacks output: $fd"
+    return
+  }
+
+  while {! [eof $fd]} {
+    set line [gets $fd]
+    if {[string match RESULT* $line]} {
+      set linelist [split $line]
+      if {[lindex $linelist 2] == "PASSED"} {
+	pass [lindex $linelist 1]
+      } else {
+	fail [lindex $linelist 1]
+      }
+    }
+  }
+
+  close $fd
+}
+
+proc gcj_jacks_run {} {
+  global srcdir
+
+  if {! [file isdirectory $srcdir/libjava.jacks/jacks]} {
+    # No tests.
+    verbose "Jacks tests not found"
+    return
+  }
+
+  # Jacks forces us to do this.  You can't run it from a separate
+  # tree.
+  verbose "Copying Jacks..."
+  catch {system "rm -rf jacks"}
+  catch {system "cp -r $srcdir/libjava.jacks/jacks jacks"}
+
+  set here [pwd]
+  cd jacks
+
+  verbose "Writing Jacks setup file"
+  gcj_jacks_write gcj_setup
+
+  verbose "Running Jacks..."
+  if {[catch {exec ./jacks gcj} msg]} {
+    verbose "jacks invocation failure: $msg"
+    fail "running jacks"
+  } else {
+    pass "running jacks"
+
+    gcj_jacks_parse logging/gcj.log
+  }
+
+  cd $here
+}
+
+gcj_jacks_run


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]