aboutsummaryrefslogtreecommitdiff
path: root/libjava/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-11-06 01:02:19 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-11-06 01:02:19 +0000
commitf263ebdd7fb886c51ae6716863ad1c079e4eff1f (patch)
tree5311185595109bacadf9fc55e8131243a9acd3f1 /libjava/testsuite
parent0a288b9a2556ff6f64d42612f413269d85fff919 (diff)
downloadgcc-f263ebdd7fb886c51ae6716863ad1c079e4eff1f.zip
gcc-f263ebdd7fb886c51ae6716863ad1c079e4eff1f.tar.gz
gcc-f263ebdd7fb886c51ae6716863ad1c079e4eff1f.tar.bz2
* libjava.jacks/jacks.exp: New file.
From-SVN: r58850
Diffstat (limited to 'libjava/testsuite')
-rw-r--r--libjava/testsuite/ChangeLog4
-rw-r--r--libjava/testsuite/libjava.jacks/jacks.exp81
2 files changed, 85 insertions, 0 deletions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index b7c1548..7cdad4a0 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2002-11-05 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jacks/jacks.exp: New file.
+
2002-11-04 Tom Tromey <tromey@redhat.com>
* libjava.compile/pr7912.java: New file.
diff --git a/libjava/testsuite/libjava.jacks/jacks.exp b/libjava/testsuite/libjava.jacks/jacks.exp
new file mode 100644
index 0000000..4e49503
--- /dev/null
+++ b/libjava/testsuite/libjava.jacks/jacks.exp
@@ -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