libjava.exp (gcj_invoke): Moved...

* 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.

From-SVN: r64702
This commit is contained in:
Tom Tromey 2003-03-22 07:14:53 +00:00 committed by Tom Tromey
parent 442c0874ea
commit 6932a1994e
10 changed files with 252 additions and 44 deletions

View file

@ -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.