warn if "source" fails to open the file when from_tty == 0
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / langs.exp
index e4f345025424ca5e56a02387b7cd436305e28142..b2cb52baa1371fb4f7a65085d65ddec370e6f93e 100644 (file)
@@ -1,5 +1,4 @@
-#   Copyright (C) 1997, 1998, 2007, 2008, 2009, 2010, 2011
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1997-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if $tracelevel then {
-       strace $tracelevel
-}
-
 
-set testfile langs
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile langs0.c langs1.c langs2.c
 
 if [is_remote host] {
     remote_download host ${srcdir}/${subdir}/langs1.f
@@ -28,24 +22,9 @@ if [is_remote host] {
 }
 
 
-if  { [gdb_compile "${srcdir}/${subdir}/langs0.c" "${binfile}0.o" object {debug}] != "" } {
-     untested langs.exp
-     return -1
-}
-
-if  { [gdb_compile "${srcdir}/${subdir}/langs1.c" "${binfile}1.o" object {debug}] != "" } {
-     untested langs.exp
-     return -1
-}
-
-if  { [gdb_compile "${srcdir}/${subdir}/langs2.c" "${binfile}2.o" object {debug}] != "" } {
-     untested langs.exp
-     return -1
-}
-
-if  { [gdb_compile "${binfile}0.o ${binfile}1.o ${binfile}2.o" ${binfile} executable {debug}] != "" } {
-     untested langs.exp
-     return -1
+if {[prepare_for_testing ${testfile}.exp ${testfile} \
+        [list $srcfile $srcfile2 $srcfile3] {debug}]} {
+    return -1
 }
 
 set oldtimeout $timeout
@@ -55,15 +34,10 @@ set timeout 10
 
 # Create and source the file that provides information about the compiler
 # used to compile the test case.
-if [get_compiler_info ${binfile}] {
-    return -1;
+if [get_compiler_info] {
+    return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
-
 gdb_test_multiple "b langs0" "break on nonexistent function in langs.exp" {
        -re "Function \"langs0\" not defined\..*Make breakpoint pending on future shared library load.*y or .n.. $" {
 
This page took 0.024985 seconds and 4 git commands to generate.