Commit 3f68457e by Andreas Tobler Committed by Andreas Tobler

libjava.exp (libjava_invoke): Add new argument ld_library_additions.

2004-05-10  Andreas Tobler  <a.tobler@schweiz.ch>

	* testsuite/lib/libjava.exp (libjava_invoke): Add new argument
	ld_library_additions. Adjust all calls to libjava_invoke to match
	the new argument.

	* testsuite/libjava.jni/jni.exp (gcj_jni_test_one): Pass stdc++
	path to cxxflagslist.
	Pass path of libstdc++ to libjava_invoke.

	* testsuite/libjava.jar/jar.exp (gcj_jar_inerpret): Adjust
	libjava_invoke arguments.

From-SVN: r81679
parent 3358cae0
2004-05-10 Andreas Tobler <a.tobler@schweiz.ch>
* testsuite/lib/libjava.exp (libjava_invoke): Add new argument
ld_library_additions. Adjust all calls to libjava_invoke to match
the new argument.
* testsuite/libjava.jni/jni.exp (gcj_jni_test_one): Pass stdc++
path to cxxflagslist.
Pass path of libstdc++ to libjava_invoke.
* testsuite/libjava.jar/jar.exp (gcj_jar_inerpret): Adjust
libjava_invoke arguments.
2004-05-10 Ranjit Mathew <rmathew@hotmail.com> 2004-05-10 Ranjit Mathew <rmathew@hotmail.com>
* testsuite/libjava.jacks/jacks.xfail: Update to reflect the current * testsuite/libjava.jacks/jacks.xfail: Update to reflect the current
......
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
load_lib "libgloss.exp" load_lib "libgloss.exp"
...@@ -495,7 +495,21 @@ proc gcj_invoke {program expectFile ld_library_additions} { ...@@ -495,7 +495,21 @@ proc gcj_invoke {program expectFile ld_library_additions} {
# Invoke a program and check its output. EXECUTABLE is the program; # Invoke a program and check its output. EXECUTABLE is the program;
# ARGS are the arguments to the program. Returns 1 if tests passed # ARGS are the arguments to the program. Returns 1 if tests passed
# (or things were left untested), 0 otherwise. # (or things were left untested), 0 otherwise.
proc libjava_invoke {errname testName optName executable inpfile resultfile args} { proc libjava_invoke {errname testName optName executable inpfile resultfile
ld_library_additions args} {
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
verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
upvar $optName opts upvar $optName opts
if {[info exists opts(no-exec)]} { if {[info exists opts(no-exec)]} {
...@@ -512,6 +526,10 @@ proc libjava_invoke {errname testName optName executable inpfile resultfile args ...@@ -512,6 +526,10 @@ proc libjava_invoke {errname testName optName executable inpfile resultfile args
set result [libjava_load $executable $args "$inpfile"] set result [libjava_load $executable $args "$inpfile"]
set status [lindex $result 0] set status [lindex $result 0]
set output [lindex $result 1] set output [lindex $result 1]
# Restore LD_LIBRARY_PATH setting.
setenv LD_LIBRARY_PATH $lib_path
if {[info exists opts(xfail-exec)]} then { if {[info exists opts(xfail-exec)]} then {
setup_xfail *-*-* setup_xfail *-*-*
} }
...@@ -658,7 +676,7 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile ...@@ -658,7 +676,7 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
set opts(xfail-output) x set opts(xfail-output) x
} }
if {[libjava_invoke $errname "source compiled test" opts $executable \ if {[libjava_invoke $errname "source compiled test" opts $executable \
$inpfile $resultfile]} { $inpfile $resultfile ""]} {
# Everything ok, so clean up. # Everything ok, so clean up.
eval gcj_cleanup $removeList eval gcj_cleanup $removeList
} }
...@@ -796,7 +814,7 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e ...@@ -796,7 +814,7 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
# program; in this case we want to skip the test. # program; in this case we want to skip the test.
if {$INTERPRETER == "yes" && $gij != "gij"} { if {$INTERPRETER == "yes" && $gij != "gij"} {
libjava_invoke $errname "gij test" opts $gij \ libjava_invoke $errname "gij test" opts $gij \
$inpfile $resultfile $main_name $inpfile $resultfile "" $main_name
} }
# Initial arguments. # Initial arguments.
...@@ -859,7 +877,7 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e ...@@ -859,7 +877,7 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
set opts(xfail-output) x set opts(xfail-output) x
} }
if {[libjava_invoke $errname "bytecode->native test" opts $executable \ if {[libjava_invoke $errname "bytecode->native test" opts $executable \
$inpfile $resultfile]} { $inpfile $resultfile ""]} {
# Everything ok, so clean up. # Everything ok, so clean up.
eval gcj_cleanup $removeList eval gcj_cleanup $removeList
} }
......
...@@ -31,7 +31,7 @@ proc gcj_jar_interpret {jarfile} { ...@@ -31,7 +31,7 @@ proc gcj_jar_interpret {jarfile} {
set opts(_) {} set opts(_) {}
set out [file rootname $jarfile].out set out [file rootname $jarfile].out
libjava_invoke $jarfile "gij test" opts $gij {} $out \ libjava_invoke $jarfile "gij test" opts $gij {} $out \
-jar $jarfile "" -jar $jarfile
} }
proc gcj_jar_run {} { proc gcj_jar_run {} {
......
...@@ -126,6 +126,9 @@ proc gcj_jni_test_one {file} { ...@@ -126,6 +126,9 @@ proc gcj_jni_test_one {file} {
} }
} }
lappend cxxflaglist $arg lappend cxxflaglist $arg
# In case the libstdc++ is not installed yet, we pass the build
# directory of it to the cxxflaglist.
lappend cxxflaglist "-L$cxxldlibflags"
} }
lappend cxxflaglist "-lstdc++" lappend cxxflaglist "-lstdc++"
...@@ -149,17 +152,19 @@ proc gcj_jni_test_one {file} { ...@@ -149,17 +152,19 @@ proc gcj_jni_test_one {file} {
# FIXME # FIXME
return 0 return 0
} }
# We purposely ignore errors here; we still want to run the other # We purposely ignore errors here; we still want to run the other
# appropriate tests. # appropriate tests.
set errname [file rootname [file tail $file]] set errname [file rootname [file tail $file]]
set gij [libjava_find_gij] set gij [libjava_find_gij]
# libjava_find_gij will return `gij' if it couldn't find the # libjava_find_gij will return `gij' if it couldn't find the
# program; in this case we want to skip the test. # program; in this case we want to skip the test.
if {$INTERPRETER == "yes" && $gij != "gij"} { # If the libraries are not installed yet, we have to pass them via
libjava_invoke $errname "gij test" opts $gij \ # cxxldlibflags to libjava_invoke.
"" $resultfile $main if {$INTERPRETER == "yes" && $gij != "gij"} {
} libjava_invoke $errname "gij test" opts $gij \
"" $resultfile $cxxldlibflags $main
}
# When we succeed we remove all our clutter. # When we succeed we remove all our clutter.
eval gcj_cleanup [glob -nocomplain -- ${main}.*] [list $main lib${main}.${so_extension}] eval gcj_cleanup [glob -nocomplain -- ${main}.*] [list $main lib${main}.${so_extension}]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment