* lib/gdb.exp (gdb_compile_test): New.

(skip_ada_tests, skip_java_tests): New.
	(gdb_compile): Use gdb_compile_test for f77.
	* lib/ada.exp (gdb_compile_ada): Use gdb_compile_test to record result.
	* lib/java.exp (compile_java_from_source): Remove runtests check,
	use gdb_compile_test to record result.
	* gdb.ada/packed_array.exp, gdb.ada/fixed_points.exp,
	gdb.ada/exec_changed.exp, gdb.ada/start.exp,
	gdb.ada/watch_arg.exp, gdb.ada/null_record.exp,
	gdb.ada/array_return.exp, gdb.ada/arrayidx.exp,
	gdb.mi/mi-var-child-f.exp, gdb.fortran/types.exp,
	gdb.fortran/array-element.exp, gdb.fortran/subarray.exp,
	gdb.fortran/derived-type.exp, gdb.fortran/exprs.exp,
	gdb.java/jmisc.exp, gdb.java/jprint.exp,
	gdb.java/jv-print.exp, gdb.java/jmain.exp: Add language skip,
	adjust gdb_compile invocations.
This commit is contained in:
Nathan Sidwell 2007-01-11 11:42:45 +00:00
parent 4b90047378
commit 147d6f8fa0
22 changed files with 132 additions and 57 deletions

View file

@ -1,3 +1,22 @@
2007-01-11 Nathan Sidwell <nathan@codesourcery.com>
* lib/gdb.exp (gdb_compile_test): New.
(skip_ada_tests, skip_java_tests): New.
(gdb_compile): Use gdb_compile_test for f77.
* lib/ada.exp (gdb_compile_ada): Use gdb_compile_test to record result.
* lib/java.exp (compile_java_from_source): Remove runtests check,
use gdb_compile_test to record result.
* gdb.ada/packed_array.exp, gdb.ada/fixed_points.exp,
gdb.ada/exec_changed.exp, gdb.ada/start.exp,
gdb.ada/watch_arg.exp, gdb.ada/null_record.exp,
gdb.ada/array_return.exp, gdb.ada/arrayidx.exp,
gdb.mi/mi-var-child-f.exp, gdb.fortran/types.exp,
gdb.fortran/array-element.exp, gdb.fortran/subarray.exp,
gdb.fortran/derived-type.exp, gdb.fortran/exprs.exp,
gdb.java/jmisc.exp, gdb.java/jprint.exp,
gdb.java/jv-print.exp, gdb.java/jmain.exp: Add language skip,
adjust gdb_compile invocations.
2007-01-09 Daniel Jacobowitz <dan@codesourcery.com> 2007-01-09 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.ada/catch_ex.exp: Call unsupported and stop if the runtime * gdb.ada/catch_ex.exp: Call unsupported and stop if the runtime

View file

@ -21,13 +21,15 @@ if $tracelevel then {
load_lib "ada.exp" load_lib "ada.exp"
if { [skip_ada_tests] } { return -1 }
set testdir "array_return" set testdir "array_return"
set testfile "${testdir}/p" set testfile "${testdir}/p"
set srcfile ${srcdir}/${subdir}/${testfile}.adb set srcfile ${srcdir}/${subdir}/${testfile}.adb
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
file mkdir ${objdir}/${subdir}/${testdir} file mkdir ${objdir}/${subdir}/${testdir}
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
return -1 return -1
} }

View file

@ -21,13 +21,15 @@ if $tracelevel then {
load_lib "ada.exp" load_lib "ada.exp"
if { [skip_ada_tests] } { return -1 }
set testdir "arrayidx" set testdir "arrayidx"
set testfile "${testdir}/p" set testfile "${testdir}/p"
set srcfile ${srcdir}/${subdir}/${testfile}.adb set srcfile ${srcdir}/${subdir}/${testfile}.adb
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
file mkdir ${objdir}/${subdir}/${testdir} file mkdir ${objdir}/${subdir}/${testdir}
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
return -1 return -1
} }

View file

@ -20,6 +20,8 @@ if $tracelevel then {
load_lib "ada.exp" load_lib "ada.exp"
if { [skip_ada_tests] } { return -1 }
set testdir "exec_changed" set testdir "exec_changed"
file mkdir ${objdir}/${subdir}/${testdir} file mkdir ${objdir}/${subdir}/${testdir}
@ -28,7 +30,7 @@ set testfile1 "${testdir}/first"
set srcfile1 ${srcdir}/${subdir}/${testfile1}.adb set srcfile1 ${srcdir}/${subdir}/${testfile1}.adb
set binfile1 ${objdir}/${subdir}/${testfile1}$EXEEXT set binfile1 ${objdir}/${subdir}/${testfile1}$EXEEXT
if {[gdb_compile_ada "${srcfile1}" "${binfile1}" executable [list debug ]] != "" } { if {[gdb_compile_ada "${srcfile1}" "${binfile1}" executable {debug}] != ""} {
return -1 return -1
} }
@ -37,7 +39,7 @@ set testfile2 "${testdir}/second"
set srcfile2 ${srcdir}/${subdir}/${testfile2}.adb set srcfile2 ${srcdir}/${subdir}/${testfile2}.adb
set binfile2 ${objdir}/${subdir}/${testfile2}$EXEEXT set binfile2 ${objdir}/${subdir}/${testfile2}$EXEEXT
if {[gdb_compile_ada "${srcfile2}" "${binfile2}" executable [list debug ]] != "" } { if {[gdb_compile_ada "${srcfile2}" "${binfile2}" executable {debug}] != ""} {
return -1 return -1
} }

View file

@ -21,13 +21,15 @@ if $tracelevel then {
load_lib "ada.exp" load_lib "ada.exp"
if { [skip_ada_tests] } { return -1 }
set testdir "fixed_points" set testdir "fixed_points"
set testfile "${testdir}/fixed_points" set testfile "${testdir}/fixed_points"
set srcfile ${srcdir}/${subdir}/${testfile}.adb set srcfile ${srcdir}/${subdir}/${testfile}.adb
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
file mkdir ${objdir}/${subdir}/${testdir} file mkdir ${objdir}/${subdir}/${testdir}
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
return -1 return -1
} }

View file

@ -21,13 +21,15 @@ if $tracelevel then {
load_lib "ada.exp" load_lib "ada.exp"
if { [skip_ada_tests] } { return -1 }
set testdir "null_record" set testdir "null_record"
set testfile "${testdir}/null_record" set testfile "${testdir}/null_record"
set srcfile ${srcdir}/${subdir}/${testfile}.adb set srcfile ${srcdir}/${subdir}/${testfile}.adb
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
file mkdir ${objdir}/${subdir}/${testdir} file mkdir ${objdir}/${subdir}/${testdir}
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
return -1 return -1
} }

View file

@ -21,13 +21,15 @@ if $tracelevel then {
load_lib "ada.exp" load_lib "ada.exp"
if { [skip_ada_tests] } { return -1 }
set testdir "packed_array" set testdir "packed_array"
set testfile "${testdir}/pa" set testfile "${testdir}/pa"
set srcfile ${srcdir}/${subdir}/${testfile}.adb set srcfile ${srcdir}/${subdir}/${testfile}.adb
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
file mkdir ${objdir}/${subdir}/${testdir} file mkdir ${objdir}/${subdir}/${testdir}
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
return -1 return -1
} }

View file

@ -21,13 +21,15 @@ if $tracelevel then {
load_lib "ada.exp" load_lib "ada.exp"
if { [skip_ada_tests] } { return -1 }
set testdir "start" set testdir "start"
set testfile "${testdir}/dummy" set testfile "${testdir}/dummy"
set srcfile ${srcdir}/${subdir}/${testfile}.adb set srcfile ${srcdir}/${subdir}/${testfile}.adb
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
file mkdir ${objdir}/${subdir}/${testdir} file mkdir ${objdir}/${subdir}/${testdir}
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
return -1 return -1
} }

View file

@ -21,13 +21,15 @@ if $tracelevel then {
load_lib "ada.exp" load_lib "ada.exp"
if { [skip_ada_tests] } { return -1 }
set testdir "watch_arg" set testdir "watch_arg"
set testfile "${testdir}/watch" set testfile "${testdir}/watch"
set srcfile ${srcdir}/${subdir}/${testfile}.adb set srcfile ${srcdir}/${subdir}/${testfile}.adb
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
file mkdir ${objdir}/${subdir}/${testdir} file mkdir ${objdir}/${subdir}/${testdir}
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
return -1 return -1
} }

View file

@ -23,12 +23,14 @@ if $tracelevel then {
strace $tracelevel strace $tracelevel
} }
if { [skip_fortran_tests] } { return -1 }
set testfile "array-element" set testfile "array-element"
set srcfile ${testfile}.f set srcfile ${testfile}.f
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } { if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
untested "Couldn't compile ${srcfile}" executable {debug f77}] != ""} {
return -1 return -1
} }

View file

@ -23,12 +23,14 @@ if $tracelevel then {
strace $tracelevel strace $tracelevel
} }
if { [skip_fortran_tests] } { return -1 }
set testfile "derived-type" set testfile "derived-type"
set srcfile ${testfile}.f90 set srcfile ${testfile}.f90
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } { if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
untested "Couldn't compile ${srcfile}" executable {debug f77}] != ""} {
return -1 return -1
} }

View file

@ -24,6 +24,8 @@ if $tracelevel then {
strace $tracelevel strace $tracelevel
} }
if { [skip_fortran_tests] } { continue }
set prms_id 0 set prms_id 0
set bug_id 0 set bug_id 0

View file

@ -23,12 +23,14 @@ if $tracelevel then {
strace $tracelevel strace $tracelevel
} }
if { [skip_fortran_tests] } { return -1 }
set testfile "subarray" set testfile "subarray"
set srcfile ${testfile}.f set srcfile ${testfile}.f
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } { if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
untested "Couldn't compile ${srcfile}" executable {debug f77}] != ""} {
return -1 return -1
} }

View file

@ -24,6 +24,8 @@ if $tracelevel then {
strace $tracelevel strace $tracelevel
} }
if { [skip_fortran_tests] } { continue }
set prms_id 0 set prms_id 0
set bug_id 0 set bug_id 0

View file

@ -23,12 +23,13 @@ if $tracelevel then {
load_lib "java.exp" load_lib "java.exp"
if { [skip_java_tests] } { continue }
set testfile "jmain" set testfile "jmain"
set srcfile ${srcdir}/$subdir/${testfile}.java set srcfile ${srcdir}/$subdir/${testfile}.java
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } { if {[compile_java_from_source ${srcfile} ${binfile} "-g"] != ""} {
untested "Couldn't compile ${srcfile}" continue
return -1
} }
set prms_id 0 set prms_id 0

View file

@ -26,12 +26,13 @@ if $tracelevel then {
load_lib "java.exp" load_lib "java.exp"
if { [skip_java_tests] } { continue }
set testfile "jmisc" set testfile "jmisc"
set srcfile ${srcdir}/$subdir/${testfile}.java set srcfile ${srcdir}/$subdir/${testfile}.java
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } { if {[compile_java_from_source ${srcfile} ${binfile} "-g"] != ""} {
untested "Couldn't compile ${srcfile}" continue
return -1
} }
# Set the current language to java. This counts as a test. If it # Set the current language to java. This counts as a test. If it

View file

@ -23,12 +23,13 @@ if $tracelevel then {
load_lib "java.exp" load_lib "java.exp"
if { [skip_java_tests] } { continue }
set testfile "jprint" set testfile "jprint"
set srcfile ${srcdir}/$subdir/${testfile}.java set srcfile ${srcdir}/$subdir/${testfile}.java
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } { if {[compile_java_from_source ${srcfile} ${binfile} "-g"] != ""} {
untested "Couldn't compile ${srcfile}" continue
return -1
} }
# Set the current language to java. This counts as a test. If it # Set the current language to java. This counts as a test. If it

View file

@ -21,6 +21,10 @@ if $tracelevel then {
strace $tracelevel strace $tracelevel
} }
load_lib "java.exp"
if { [skip_java_tests] } { continue }
set prms_id 0 set prms_id 0
set bug_id 0 set bug_id 0

View file

@ -20,6 +20,8 @@
load_lib mi-support.exp load_lib mi-support.exp
set MIFLAGS "-i=mi" set MIFLAGS "-i=mi"
if { [skip_fortran_tests] } { return -1 }
gdb_exit gdb_exit
if [mi_gdb_start] { if [mi_gdb_start] {
continue continue
@ -28,8 +30,8 @@ if [mi_gdb_start] {
set testfile "array" set testfile "array"
set srcfile ${testfile}.f set srcfile ${testfile}.f
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } { if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
untested "Couldn't compile ${srcfile}" executable {debug f77}] != ""} {
return -1 return -1
} }

View file

@ -425,9 +425,8 @@ proc gdb_compile_ada {source dest type options} {
# gdb_compile to determine whether the build has succeeded or not. # gdb_compile to determine whether the build has succeeded or not.
# We therefore simply check whether the dest file has been created # We therefore simply check whether the dest file has been created
# or not. Unless not present, the build has succeeded. # or not. Unless not present, the build has succeeded.
if ![file exists $dest] { if [file exists $dest] { set result "" }
unsupported "Ada compilation failed: $result" gdb_compile_test $source $result
return "Ada compilation failed." return $result
}
} }

View file

@ -1142,6 +1142,22 @@ proc default_gdb_start { } {
return 0; return 0;
} }
# Examine the output of compilation to determine whether compilation
# failed or not. If it failed determine whether it is due to missing
# compiler or due to compiler error. Report pass, fail or unsupported
# as appropriate
proc gdb_compile_test {src output} {
if { $output == "" } {
pass "compilation [file tail $src]"
} elseif { [regexp {^[a-zA-Z_0-9]+: Can't find [^ ]+\.$} $output] } {
unsupported "compilation [file tail $src]"
} else {
verbose -log "compilation failed: $output" 2
fail "compilation [file tail $src]"
}
}
# Return a 1 for configurations for which we don't even want to try to # Return a 1 for configurations for which we don't even want to try to
# test C++. # test C++.
@ -1152,7 +1168,6 @@ proc skip_cplus_tests {} {
if { [istarget "h8300-*-*"] } { if { [istarget "h8300-*-*"] } {
return 1 return 1
} }
# The C++ IO streams are too large for HC11/HC12 and are thus not # The C++ IO streams are too large for HC11/HC12 and are thus not
# available. The gdb C++ tests use them and don't compile. # available. The gdb C++ tests use them and don't compile.
if { [istarget "m6811-*-*"] } { if { [istarget "m6811-*-*"] } {
@ -1170,6 +1185,18 @@ proc skip_fortran_tests {} {
return 0 return 0
} }
# Return a 1 if I don't even want to try to test ada.
proc skip_ada_tests {} {
return 0
}
# Return a 1 if I don't even want to try to test java.
proc skip_java_tests {} {
return 0
}
# Run a test on the target to see if it supports vmx hardware. Return 0 if so, # Run a test on the target to see if it supports vmx hardware. Return 0 if so,
# 1 if it does not. Based on 'check_vmx_hw_available' from the GCC testsuite. # 1 if it does not. Based on 'check_vmx_hw_available' from the GCC testsuite.
@ -1520,9 +1547,16 @@ proc gdb_compile {source dest type options} {
set result [target_compile $source $dest $type $options]; set result [target_compile $source $dest $type $options];
regsub "\[\r\n\]*$" "$result" "" result; regsub "\[\r\n\]*$" "$result" "" result;
regsub "^\[\r\n\]*" "$result" "" result; regsub "^\[\r\n\]*" "$result" "" result;
if { $result != "" && [lsearch $options quiet] == -1} {
if {[lsearch $options quiet] < 0} {
# We shall update this on a per language basis, to avoid
# changing the entire testsuite in one go.
if {[lsearch $options f77] >= 0} {
gdb_compile_test $source $result
} elseif { $result != "" } {
clone_output "gdb compile failed, $result" clone_output "gdb compile failed, $result"
} }
}
return $result; return $result;
} }

View file

@ -91,31 +91,19 @@ proc java_init { args } {
# #
proc compile_java_from_source { srcfile binfile compile_args } { proc compile_java_from_source { srcfile binfile compile_args } {
global GCJ_UNDER_TEST global GCJ_UNDER_TEST
global runtests
global java_initialized global java_initialized
if { $java_initialized != 1 } { java_init } if { $java_initialized != 1 } { java_init }
set errname [file rootname [file tail $srcfile]]
if {! [runtest_file_p $runtests $errname]} {
return
}
set args "compiler=$GCJ_UNDER_TEST" set args "compiler=$GCJ_UNDER_TEST"
lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]" lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]"
if { $compile_args != "" } { if { $compile_args != "" } {
lappend args "additional_flags=$compile_args" lappend args "additional_flags=$compile_args"
} }
if { $compile_args != "" } { set result [target_compile $srcfile ${binfile} ${binfile} executable $args]
set errname "$errname $compile_args" gdb_compile_test $srcfile $result
} return $result
set x [target_compile $srcfile ${binfile} executable $args]
if { $x != "" } {
verbose "target_compile failed: $x" 2
return "$errname compilation from source";
}
} }
# Local Variables: # Local Variables: