diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-22 07:14:53 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-22 07:14:53 +0000 |
| commit | e32638158eade5ffb5c1d3884f1f6c76bc2e4c72 (patch) | |
| tree | 173dacf5d424f802b24bc491f512bcdbaaeb8592 /libjava/testsuite/lib/libjava.exp | |
| parent | d6782d58350eef45e51556dfdd8dee620c2f4dda (diff) | |
| download | ppe42-gcc-e32638158eade5ffb5c1d3884f1f6c76bc2e4c72.tar.gz ppe42-gcc-e32638158eade5ffb5c1d3884f1f6c76bc2e4c72.zip | |
* lib/libjava.exp (gcj_invoke): Moved...
* libjava.jni/jni.exp: ...from here.
* libjava.cni/shortfield.out: New file.
* libjava.cni/shortfield.java: New file.
* libjava.cni/natshortfield.cc: New file.
* libjava.cni/natlongfield.cc: New file.
* libjava.cni/longfield.out: New file.
* libjava.cni/longfield.java: New file.
* libjava.cni/cni.exp: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64702 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/testsuite/lib/libjava.exp')
| -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 6be5ec67662..972b7be64cc 100644 --- a/libjava/testsuite/lib/libjava.exp +++ b/libjava/testsuite/lib/libjava.exp @@ -457,6 +457,50 @@ proc gcj_link {program main files {options {}}} { return 1 } +# Invoke the program and see what happens. Return 0 on failure. +proc gcj_invoke {program expectFile ld_library_additions} { + global env + set lib_path $env(LD_LIBRARY_PATH) + + set newval . + if {[llength $ld_library_additions] > 0} { + append newval :[join $ld_library_additions :] + } + append newval :$lib_path + + setenv LD_LIBRARY_PATH $newval + setenv SHLIB_PATH $newval + + verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)" + + set result [libjava_load ./$program] + set status [lindex $result 0] + set output [lindex $result 1] + + # Restore setting + setenv LD_LIBRARY_PATH $lib_path + setenv SHLIB_PATH $lib_path + + if {$status != "pass"} { + verbose "got $output" + fail "$program run" + untested "$program output" + return 0 + } + + set id [open $expectFile r] + set expected [read $id] + close $id + + if {! [string compare $output $expected]} { + pass "$program output" + return 1 + } else { + fail "$program 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. |

