diff options
author | Kyle Galloway <kgallowa@gcc.gnu.org> | 2007-01-25 14:19:05 +0000 |
---|---|---|
committer | Kyle Galloway <kgallowa@gcc.gnu.org> | 2007-01-25 14:19:05 +0000 |
commit | 05296a28103564cf997ab72b5b733cadb74cfe74 (patch) | |
tree | 70a7ee7248f268a6818681493213cb640b51ef17 /libjava/testsuite/lib | |
parent | 6bfcbf0d48e8e9e71abb7302f677ab5bd32286e0 (diff) | |
download | gcc-05296a28103564cf997ab72b5b733cadb74cfe74.zip gcc-05296a28103564cf997ab72b5b733cadb74cfe74.tar.gz gcc-05296a28103564cf997ab72b5b733cadb74cfe74.tar.bz2 |
jvmti-interp.exp: New file.
2007-01-25 Kyle Galloway <kgallowa@redhat.com>
* libjava/testsuite/libjava.jvmti/jvmti-interp.exp: New file.
* libjava/testsuite/libjava.jvmti/interp: New folder.
* libjava/testsuite/lib/libjava.exp (exec_gij): New Method.
From-SVN: r121172
Diffstat (limited to 'libjava/testsuite/lib')
-rw-r--r-- | libjava/testsuite/lib/libjava.exp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp index 853b25e..e20365a 100644 --- a/libjava/testsuite/lib/libjava.exp +++ b/libjava/testsuite/lib/libjava.exp @@ -494,6 +494,50 @@ proc gcj_invoke {program expectFile ld_library_additions} { } } +proc exec_gij {jarfile expectFile ld_library_additions} { + global env + global libjava_ld_library_path + global ld_library_path + + set ld_library_path "$libjava_ld_library_path" + if {[llength $ld_library_additions] > 0} { + append ld_library_path :[join $ld_library_additions :] + } + + set_ld_library_path_env_vars + if [info exists env(LD_LIBRARY_PATH)] { + verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)" + } + + set gij [libjava_find_gij] + set classname [file rootname [file tail $jarfile]] + + set result [libjava_load $gij "-cp $jarfile" "$classname"] + set status [lindex $result 0] + set output [lindex $result 1] + + restore_ld_library_path_env_vars + + if {$status != "pass"} { + verbose "got $output" + fail "$classname run" + untested "$classname output" + return 0 + } + + set id [open $expectFile r] + set expected [read $id] + close $id + + if [! [string compare $output $expected]] { + pass "$classname output" + return 1 + } else { + fail "$classname output" + return 0 + } +} + # Invoke a program and check its output. EXECUTABLE is the program; # ARGS are the arguments to the program. Returns 1 if tests passed # (or things were left untested), 0 otherwise. |