diff options
author | Tom Tromey <tromey@redhat.com> | 2003-11-10 21:30:10 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2003-11-10 21:30:10 +0000 |
commit | 9472b498ddcf6e3495c15fbd683e36ea542458bc (patch) | |
tree | 0bc5d5364e12e76e5abaeca7cd197657a558fbc7 /libjava/testsuite/libjava.jar | |
parent | 9596236a48a791fd47e057d842bdb12622e27751 (diff) | |
download | gcc-9472b498ddcf6e3495c15fbd683e36ea542458bc.zip gcc-9472b498ddcf6e3495c15fbd683e36ea542458bc.tar.gz gcc-9472b498ddcf6e3495c15fbd683e36ea542458bc.tar.bz2 |
For PR java/12996:
* libjava.jar/simple.jar: New file.
* libjava.jar/simple.xfail: New file.
* libjava.jar/simple.out: New file.
* libjava.jar/simple.java: New file.
* libjava.jar/jar.exp: New file.
From-SVN: r73426
Diffstat (limited to 'libjava/testsuite/libjava.jar')
-rw-r--r-- | libjava/testsuite/libjava.jar/jar.exp | 59 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jar/simple.jar | bin | 0 -> 700 bytes | |||
-rw-r--r-- | libjava/testsuite/libjava.jar/simple.java | 7 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jar/simple.out | 1 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jar/simple.xfail | 1 |
5 files changed, 68 insertions, 0 deletions
diff --git a/libjava/testsuite/libjava.jar/jar.exp b/libjava/testsuite/libjava.jar/jar.exp new file mode 100644 index 0000000..70a176e --- /dev/null +++ b/libjava/testsuite/libjava.jar/jar.exp @@ -0,0 +1,59 @@ +# Tests for .jar files. + +# Compile a single .jar file to an executable. +# Returns 0 on failure. +proc gcj_jar_link {jarfile mainclass} { +} + +proc gcj_jar_compile_one {jarfile mainclass} { + set base [file rootname [file tail $jarfile]] + set out [file rootname $jarfile].out + + if {! [gcj_link $base $mainclass [list $jarfile]]} { + return + } + + gcj_invoke $base $out {} +} + +proc gcj_jar_interpret {jarfile} { + global INTERPRETER srcdir + + set gij [libjava_find_gij] + # libjava_find_gij will return `gij' if it couldn't find the + # program; in this case we want to skip the test. + if {$INTERPRETER != "yes" || $gij == "gij"} { + untested "$jarfile execution - gij test" + untested "$jarfile output - gij test" + return + } + + set opts(_) {} + set out [file rootname $jarfile].out + libjava_invoke $jarfile "gij test" opts $gij {} $out \ + -jar $jarfile +} + +proc gcj_jar_run {} { + global srcdir subdir + foreach jar [lsort [glob -nocomplain ${srcdir}/${subdir}/*.jar]] { + set xff [file rootname $jar].xfail + set main {} + set interp 1 + foreach item [libjava_read_xfail $xff] { + if {[string match main=* $item]} { + set main [string range $item 5 end] + break + } elseif {$item == "no-interpret"} { + set interp 0 + } + } + + gcj_jar_compile_one $jar $main + if {$interp} { + gcj_jar_interpret $jar + } + } +} + +gcj_jar_run diff --git a/libjava/testsuite/libjava.jar/simple.jar b/libjava/testsuite/libjava.jar/simple.jar Binary files differnew file mode 100644 index 0000000..e11666f --- /dev/null +++ b/libjava/testsuite/libjava.jar/simple.jar diff --git a/libjava/testsuite/libjava.jar/simple.java b/libjava/testsuite/libjava.jar/simple.java new file mode 100644 index 0000000..848ebe1 --- /dev/null +++ b/libjava/testsuite/libjava.jar/simple.java @@ -0,0 +1,7 @@ +public class simple +{ + public static void main(String[] args) + { + System.out.println("hi"); + } +} diff --git a/libjava/testsuite/libjava.jar/simple.out b/libjava/testsuite/libjava.jar/simple.out new file mode 100644 index 0000000..45b983b --- /dev/null +++ b/libjava/testsuite/libjava.jar/simple.out @@ -0,0 +1 @@ +hi diff --git a/libjava/testsuite/libjava.jar/simple.xfail b/libjava/testsuite/libjava.jar/simple.xfail new file mode 100644 index 0000000..478dfc7 --- /dev/null +++ b/libjava/testsuite/libjava.jar/simple.xfail @@ -0,0 +1 @@ +main=simple |