This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[testsuite] check for languages consistently


I've dusted off this patch from some time ago, it makes the way gdb tests for target compilers consistent. currently, (missing) ada tests fail with:
UNSUPPORTED: gdb.ada/tasks.exp: Ada compilation failed: default_target_compile
: Can't find gnatmake.


whereas missing fortran and java tests fail with:
UNTESTED: gdb.fortran/array-element.exp: Couldn't compile array-element.f
UNTESTED: gdb.java/jmain.exp: Couldn't compile /scratch/nathan/fsf/src/gdb-mai
nline/gdb/testsuite/gdb.java/jmain.java

This is inconsistent. My understanding is that 'UNSUPPORTED' is the appropriate failure mode, as the test depends on conditionally available feature, which is not present. UNTESTED is for when the testcase is not complete.

This patch changes the testsuite so that all cases of one of those compilers missing produces:

UNSUPPORTED: gdb.java/jmain.exp: compilation jmain.java

tested on i686-pc-linux-gnu where ada, java and fortran compilers were not present.

ok?

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery

2009-11-03  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/jmisc1.exp, gdb.java/jprint.exp,
	gdb.java/jv-print.exp, gdb.java/jmain.exp: Add language skip,
	adjust gdb_compile invocations.

Index: gdb.ada/array_return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/array_return.exp,v
retrieving revision 1.10
diff -c -3 -p -r1.10 array_return.exp
*** gdb.ada/array_return.exp	3 Jan 2009 05:57:58 -0000	1.10
--- gdb.ada/array_return.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 19,32 ****
  
  load_lib "ada.exp"
  
  set testdir "array_return"
  set testfile "${testdir}/p"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
!   return -1
  }
  
  gdb_exit
--- 19,34 ----
  
  load_lib "ada.exp"
  
+ if { [skip_ada_tests] } { return -1 }
+ 
  set testdir "array_return"
  set testfile "${testdir}/p"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
!     return -1
  }
  
  gdb_exit
Index: gdb.ada/arrayidx.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/arrayidx.exp,v
retrieving revision 1.9
diff -c -3 -p -r1.9 arrayidx.exp
*** gdb.ada/arrayidx.exp	3 Jan 2009 05:57:58 -0000	1.9
--- gdb.ada/arrayidx.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 19,32 ****
  
  load_lib "ada.exp"
  
  set testdir "arrayidx"
  set testfile "${testdir}/p"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
!   return -1
  }
  
  gdb_exit
--- 19,34 ----
  
  load_lib "ada.exp"
  
+ if { [skip_ada_tests] } { return -1 }
+ 
  set testdir "arrayidx"
  set testfile "${testdir}/p"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
!     return -1
  }
  
  gdb_exit
Index: gdb.ada/exec_changed.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/exec_changed.exp,v
retrieving revision 1.9
diff -c -3 -p -r1.9 exec_changed.exp
*** gdb.ada/exec_changed.exp	3 Jan 2009 05:57:58 -0000	1.9
--- gdb.ada/exec_changed.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 19,24 ****
--- 19,26 ----
  
  load_lib "ada.exp"
  
+ if { [skip_ada_tests] } { return -1 }
+ 
  set testdir "exec_changed"
  file mkdir ${objdir}/${subdir}/${testdir}
  
*************** set testfile1 "${testdir}/first"
*** 27,34 ****
  set srcfile1 ${srcdir}/${subdir}/${testfile1}.adb
  set binfile1 ${objdir}/${subdir}/${testfile1}$EXEEXT
  
! if {[gdb_compile_ada "${srcfile1}" "${binfile1}" executable [list debug ]] != "" } {
!   return -1
  }
  
  # Build the second test program
--- 29,36 ----
  set srcfile1 ${srcdir}/${subdir}/${testfile1}.adb
  set binfile1 ${objdir}/${subdir}/${testfile1}$EXEEXT
  
! if {[gdb_compile_ada "${srcfile1}" "${binfile1}" executable {debug}] != ""} {
!     return -1
  }
  
  # Build the second test program
*************** set testfile2 "${testdir}/second"
*** 36,43 ****
  set srcfile2 ${srcdir}/${subdir}/${testfile2}.adb
  set binfile2 ${objdir}/${subdir}/${testfile2}$EXEEXT
  
! if {[gdb_compile_ada "${srcfile2}" "${binfile2}" executable [list debug ]] != "" } {
!   return -1
  }
  
  # Start with a fresh gdb.
--- 38,45 ----
  set srcfile2 ${srcdir}/${subdir}/${testfile2}.adb
  set binfile2 ${objdir}/${subdir}/${testfile2}$EXEEXT
  
! if {[gdb_compile_ada "${srcfile2}" "${binfile2}" executable {debug}] != ""} {
!     return -1
  }
  
  # Start with a fresh gdb.
Index: gdb.ada/fixed_points.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/fixed_points.exp,v
retrieving revision 1.11
diff -c -3 -p -r1.11 fixed_points.exp
*** gdb.ada/fixed_points.exp	19 Mar 2009 14:08:50 -0000	1.11
--- gdb.ada/fixed_points.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 19,32 ****
  
  load_lib "ada.exp"
  
  set testdir "fixed_points"
  set testfile "${testdir}/fixed_points"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
!   return -1
  }
  
  gdb_exit
--- 19,34 ----
  
  load_lib "ada.exp"
  
+ if { [skip_ada_tests] } { return -1 }
+ 
  set testdir "fixed_points"
  set testfile "${testdir}/fixed_points"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
!     return -1
  }
  
  gdb_exit
Index: gdb.ada/null_record.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/null_record.exp,v
retrieving revision 1.13
diff -c -3 -p -r1.13 null_record.exp
*** gdb.ada/null_record.exp	3 Jan 2009 05:57:58 -0000	1.13
--- gdb.ada/null_record.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 19,32 ****
  
  load_lib "ada.exp"
  
  set testdir "null_record"
  set testfile "${testdir}/null_record"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
!   return -1
  }
  
  gdb_exit
--- 19,34 ----
  
  load_lib "ada.exp"
  
+ if { [skip_ada_tests] } { return -1 }
+ 
  set testdir "null_record"
  set testfile "${testdir}/null_record"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
!     return -1
  }
  
  gdb_exit
Index: gdb.ada/packed_array.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/packed_array.exp,v
retrieving revision 1.10
diff -c -3 -p -r1.10 packed_array.exp
*** gdb.ada/packed_array.exp	3 Jan 2009 05:57:58 -0000	1.10
--- gdb.ada/packed_array.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 19,32 ****
  
  load_lib "ada.exp"
  
  set testdir "packed_array"
  set testfile "${testdir}/pa"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
!   return -1
  }
  
  gdb_exit
--- 19,34 ----
  
  load_lib "ada.exp"
  
+ if { [skip_ada_tests] } { return -1 }
+ 
  set testdir "packed_array"
  set testfile "${testdir}/pa"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
!     return -1
  }
  
  gdb_exit
Index: gdb.ada/start.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/start.exp,v
retrieving revision 1.9
diff -c -3 -p -r1.9 start.exp
*** gdb.ada/start.exp	3 Jan 2009 05:57:58 -0000	1.9
--- gdb.ada/start.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 19,32 ****
  
  load_lib "ada.exp"
  
  set testdir "start"
  set testfile "${testdir}/dummy"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
!   return -1
  }
  
  gdb_exit
--- 19,34 ----
  
  load_lib "ada.exp"
  
+ if { [skip_ada_tests] } { return -1 }
+ 
  set testdir "start"
  set testfile "${testdir}/dummy"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
!     return -1
  }
  
  gdb_exit
Index: gdb.ada/watch_arg.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/watch_arg.exp,v
retrieving revision 1.7
diff -c -3 -p -r1.7 watch_arg.exp
*** gdb.ada/watch_arg.exp	3 Jan 2009 05:57:58 -0000	1.7
--- gdb.ada/watch_arg.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 19,32 ****
  
  load_lib "ada.exp"
  
  set testdir "watch_arg"
  set testfile "${testdir}/watch"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
!   return -1
  }
  
  gdb_exit
--- 19,34 ----
  
  load_lib "ada.exp"
  
+ if { [skip_ada_tests] } { return -1 }
+ 
  set testdir "watch_arg"
  set testfile "${testdir}/watch"
  set srcfile ${srcdir}/${subdir}/${testfile}.adb
  set binfile ${objdir}/${subdir}/${testfile}
  
  file mkdir ${objdir}/${subdir}/${testdir}
! if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
!     return -1
  }
  
  gdb_exit
Index: gdb.fortran/array-element.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/array-element.exp,v
retrieving revision 1.7
diff -c -3 -p -r1.7 array-element.exp
*** gdb.fortran/array-element.exp	3 Jan 2009 05:58:04 -0000	1.7
--- gdb.fortran/array-element.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 22,33 ****
  	strace $tracelevel
  }
  
  set testfile "array-element"
  set srcfile ${testfile}.f
  set binfile ${objdir}/${subdir}/${testfile}
  
! if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
!     untested "Couldn't compile ${srcfile}"
      return -1
  }
  
--- 22,35 ----
  	strace $tracelevel
  }
  
+ if { [skip_fortran_tests] } { return -1 }
+ 
  set testfile "array-element"
  set srcfile ${testfile}.f
  set binfile ${objdir}/${subdir}/${testfile}
  
! if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
! 	 executable {debug f77}] != ""} {
      return -1
  }
  
Index: gdb.fortran/derived-type.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/derived-type.exp,v
retrieving revision 1.8
diff -c -3 -p -r1.8 derived-type.exp
*** gdb.fortran/derived-type.exp	7 Jan 2009 12:39:13 -0000	1.8
--- gdb.fortran/derived-type.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 22,33 ****
  	strace $tracelevel
  }
  
  set testfile "derived-type"
  set srcfile ${testfile}.f90
  set binfile ${objdir}/${subdir}/${testfile}
  
! if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
!     untested "Couldn't compile ${srcfile}"
      return -1
  }
  
--- 22,35 ----
  	strace $tracelevel
  }
  
+ if { [skip_fortran_tests] } { return -1 }
+ 
  set testfile "derived-type"
  set srcfile ${testfile}.f90
  set binfile ${objdir}/${subdir}/${testfile}
  
! if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
! 	 executable {debug f77}] != ""} {
      return -1
  }
  
Index: gdb.fortran/exprs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/exprs.exp,v
retrieving revision 1.12
diff -c -3 -p -r1.12 exprs.exp
*** gdb.fortran/exprs.exp	3 Jan 2009 05:58:04 -0000	1.12
--- gdb.fortran/exprs.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 21,26 ****
--- 21,28 ----
  	strace $tracelevel
  }
  
+ if { [skip_fortran_tests] } { continue }
+ 
  set prms_id 0
  set bug_id 0
  
Index: gdb.fortran/subarray.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/subarray.exp,v
retrieving revision 1.8
diff -c -3 -p -r1.8 subarray.exp
*** gdb.fortran/subarray.exp	7 Jan 2009 12:39:13 -0000	1.8
--- gdb.fortran/subarray.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 22,33 ****
  	strace $tracelevel
  }
  
  set testfile "subarray"
  set srcfile ${testfile}.f
  set binfile ${objdir}/${subdir}/${testfile}
  
! if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
!     untested "Couldn't compile ${srcfile}"
      return -1
  }
  
--- 22,35 ----
  	strace $tracelevel
  }
  
+ if { [skip_fortran_tests] } { return -1 }
+ 
  set testfile "subarray"
  set srcfile ${testfile}.f
  set binfile ${objdir}/${subdir}/${testfile}
  
! if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
! 	executable {debug f77}] != ""} {
      return -1
  }
  
Index: gdb.fortran/types.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/types.exp,v
retrieving revision 1.11
diff -c -3 -p -r1.11 types.exp
*** gdb.fortran/types.exp	3 Jan 2009 05:58:04 -0000	1.11
--- gdb.fortran/types.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 21,26 ****
--- 21,28 ----
  	strace $tracelevel
  }
  
+ if { [skip_fortran_tests] } { continue }
+ 
  set prms_id 0
  set bug_id 0
  
Index: gdb.java/jmain.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.java/jmain.exp,v
retrieving revision 1.9
diff -c -3 -p -r1.9 jmain.exp
*** gdb.java/jmain.exp	3 Jan 2009 05:58:05 -0000	1.9
--- gdb.java/jmain.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 22,33 ****
  
  load_lib "java.exp"
  
  set testfile "jmain"
  set srcfile ${srcdir}/$subdir/${testfile}.java
  set binfile ${objdir}/${subdir}/${testfile}
! if  { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
!     untested "Couldn't compile ${srcfile}"
!     return -1
  }
  
  set prms_id 0
--- 22,34 ----
  
  load_lib "java.exp"
  
+ if { [skip_java_tests] } { continue }
+ 
  set testfile "jmain"
  set srcfile ${srcdir}/$subdir/${testfile}.java
  set binfile ${objdir}/${subdir}/${testfile}
! if {[compile_java_from_source ${srcfile} ${binfile} "-g"] != ""} {
!     continue
  }
  
  set prms_id 0
Index: gdb.java/jmisc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.java/jmisc.exp,v
retrieving revision 1.12
diff -c -3 -p -r1.12 jmisc.exp
*** gdb.java/jmisc.exp	3 Jan 2009 05:58:05 -0000	1.12
--- gdb.java/jmisc.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 22,33 ****
  
  load_lib "java.exp"
  
  set testfile "jmisc"
  set srcfile ${srcdir}/$subdir/${testfile}.java
  set binfile ${objdir}/${subdir}/${testfile}
! if  { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
!     untested "Couldn't compile ${srcfile}"
!     return -1
  }
  
  # Set the current language to java.  This counts as a test.  If it
--- 22,34 ----
  
  load_lib "java.exp"
  
+ if { [skip_java_tests] } { continue }
+ 
  set testfile "jmisc"
  set srcfile ${srcdir}/$subdir/${testfile}.java
  set binfile ${objdir}/${subdir}/${testfile}
! if {[compile_java_from_source ${srcfile} ${binfile} "-g"] != ""} {
!     continue
  }
  
  # Set the current language to java.  This counts as a test.  If it
Index: gdb.java/jprint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.java/jprint.exp,v
retrieving revision 1.8
diff -c -3 -p -r1.8 jprint.exp
*** gdb.java/jprint.exp	3 Jan 2009 05:58:05 -0000	1.8
--- gdb.java/jprint.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 22,33 ****
  
  load_lib "java.exp"
  
  set testfile "jprint"
  set srcfile ${srcdir}/$subdir/${testfile}.java
  set binfile ${objdir}/${subdir}/${testfile}
! if  { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
!     untested "Couldn't compile ${srcfile}"
!     return -1
  }
  
  # Set the current language to java.  This counts as a test.  If it
--- 22,34 ----
  
  load_lib "java.exp"
  
+ if { [skip_java_tests] } { continue }
+ 
  set testfile "jprint"
  set srcfile ${srcdir}/$subdir/${testfile}.java
  set binfile ${objdir}/${subdir}/${testfile}
! if {[compile_java_from_source ${srcfile} ${binfile} "-g"] != ""} {
!     continue
  }
  
  # Set the current language to java.  This counts as a test.  If it
Index: gdb.java/jv-print.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.java/jv-print.exp,v
retrieving revision 1.10
diff -c -3 -p -r1.10 jv-print.exp
*** gdb.java/jv-print.exp	3 Jan 2009 05:58:05 -0000	1.10
--- gdb.java/jv-print.exp	3 Nov 2009 16:08:44 -0000
*************** if $tracelevel then {
*** 17,22 ****
--- 17,26 ----
  	strace $tracelevel
  }
  
+ load_lib "java.exp"
+ 
+ if { [skip_java_tests] } { continue }
+ 
  set prms_id 0
  set bug_id 0
  
Index: gdb.mi/mi-var-child-f.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-child-f.exp,v
retrieving revision 1.9
diff -c -3 -p -r1.9 mi-var-child-f.exp
*** gdb.mi/mi-var-child-f.exp	3 Jan 2009 05:58:06 -0000	1.9
--- gdb.mi/mi-var-child-f.exp	3 Nov 2009 16:08:44 -0000
***************
*** 18,23 ****
--- 18,25 ----
  load_lib mi-support.exp
  set MIFLAGS "-i=mi"
  
+ if { [skip_fortran_tests] } { return -1 }
+ 
  gdb_exit
  if [mi_gdb_start] {
      continue
*************** if [mi_gdb_start] {
*** 26,33 ****
  set testfile "array"
  set srcfile ${testfile}.f
  set binfile ${objdir}/${subdir}/${testfile}
! if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } {
!     untested "Couldn't compile ${srcfile}"
      return -1
  }
  
--- 28,35 ----
  set testfile "array"
  set srcfile ${testfile}.f
  set binfile ${objdir}/${subdir}/${testfile}
! if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
! 	 executable {debug f77}] != ""} {
      return -1
  }
  
Index: lib/ada.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/ada.exp,v
retrieving revision 1.10
diff -c -3 -p -r1.10 ada.exp
*** lib/ada.exp	3 Jan 2009 05:58:08 -0000	1.10
--- lib/ada.exp	3 Nov 2009 16:08:44 -0000
*************** proc gdb_compile_ada {source dest type o
*** 423,431 ****
      # gdb_compile to determine whether the build has succeeded or not.
      # We therefore simply check whether the dest file has been created
      # or not. Unless not present, the build has succeeded.
!     if ![file exists $dest] {
!         unsupported "Ada compilation failed: $result"
!         return "Ada compilation failed."
!     }
  }
  
--- 423,430 ----
      # gdb_compile to determine whether the build has succeeded or not.
      # We therefore simply check whether the dest file has been created
      # or not. Unless not present, the build has succeeded.
!     if [file exists $dest] { set result "" }
!     gdb_compile_test $source $result
!     return $result
  }
  
Index: lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.124
diff -c -3 -p -r1.124 gdb.exp
*** lib/gdb.exp	2 Nov 2009 17:28:16 -0000	1.124
--- lib/gdb.exp	3 Nov 2009 16:08:44 -0000
*************** proc default_gdb_start { } {
*** 1241,1246 ****
--- 1241,1264 ----
      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]"
+     } elseif { [regexp {.*: command not found[\r|\n]*$} $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
  # test C++.
  
*************** proc skip_fortran_tests {} {
*** 1266,1271 ****
--- 1284,1301 ----
      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
+ }
+ 
  # Return a 1 if we should skip shared library tests.
  
  proc skip_shlib_tests {} {
*************** proc gdb_compile {source dest type optio
*** 1836,1844 ****
  
      regsub "\[\r\n\]*$" "$result" "" result;
      regsub "^\[\r\n\]*" "$result" "" result;
! 
!     if { $result != "" && [lsearch $options quiet] == -1} {
! 	clone_output "gdb compile failed, $result"
      }
      return $result;
  }
--- 1866,1880 ----
  
      regsub "\[\r\n\]*$" "$result" "" result;
      regsub "^\[\r\n\]*" "$result" "" result;
!     
!     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"
! 	}
      }
      return $result;
  }
Index: lib/java.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/java.exp,v
retrieving revision 1.12
diff -c -3 -p -r1.12 java.exp
*** lib/java.exp	6 Jul 2009 19:14:01 -0000	1.12
--- lib/java.exp	3 Nov 2009 16:08:44 -0000
*************** proc java_init { args } {
*** 90,120 ****
  #
  proc compile_java_from_source { srcfile binfile compile_args } {
      global GCJ_UNDER_TEST
-     global runtests
      global java_initialized
  
      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"
      lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]"
      if { $compile_args != "" } {
  	lappend args "additional_flags=$compile_args"
      }
  
!     if { $compile_args != "" } {
! 	set errname "$errname $compile_args"
!     }
! 
!     set x [target_compile $srcfile ${binfile} executable $args]
!     if { $x != "" } {
! 	verbose "target_compile failed: $x" 2
! 	return "$errname compilation from source";
!     }
  }
  
  # Local Variables:
--- 90,108 ----
  #
  proc compile_java_from_source { srcfile binfile compile_args } {
      global GCJ_UNDER_TEST
      global java_initialized
  
      if { $java_initialized != 1 } { java_init }
  
      set args "compiler=$GCJ_UNDER_TEST"
      lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]"
      if { $compile_args != "" } {
  	lappend args "additional_flags=$compile_args"
      }
  
!     set result [target_compile $srcfile ${binfile} executable $args]
!     gdb_compile_test $srcfile $result
!     return $result
  }
  
  # Local Variables:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]