]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.base/auxv.exp
Fix some duplicate test names
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / auxv.exp
index b1d066208f4fe0fb212f9c233c4ffa34ba91c6b2..07c07c451e823afa4d303f8d9b7ebe4a25022971 100644 (file)
@@ -1,6 +1,6 @@
 # Test `info auxv' and related functionality.
 
-# Copyright (C) 1992-2013 Free Software Foundation, Inc.
+# Copyright (C) 1992-2020 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
@@ -24,44 +24,41 @@ if { ! [istarget "*-*-linux*"] && ! [istarget "*-*-solaris*"] } {
 }
 
 
-set testfile "auxv"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-set corefile ${objdir}/${subdir}/${testfile}.corefile
-set gcorefile ${objdir}/${subdir}/${testfile}.gcore
+standard_testfile .c
+
+set corefile ${binfile}.corefile
+set gcorefile ${binfile}.gcore
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
                  {debug additional_flags=-DUSE_RLIMIT}] != ""
      && [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
                  {debug}] != "" } {
-    untested "couldn't compile ${srcdir}/${subdir}/${srcfile}"
+    untested "failed to compile"
     return -1
 }
 
 # Use a fresh directory to confine the native core dumps.
-# Make it the working directory for gdb and its child.
-set coredir "${objdir}/${subdir}/coredir.[getpid]"
+# Make it the working directory for the inferior.
+set coredir [standard_output_file coredir.[getpid]]
 file mkdir $coredir
 set core_works [expr [isnative] && ! [is_remote target]]
 
 # Run GDB on the test program up to where it will dump core.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set width 0"
 
 if {$core_works} {
-    if {[gdb_test "cd $coredir" ".*Working directory .*" \
-            "cd to temporary directory for core dumps"]} {
+    if {[gdb_test_no_output "set cwd $coredir" \
+            "set cwd to temporary directory for core dumps"]} {
        set core_works 0
     }
 }
 
-if { ![runto_main] } then {
-    gdb_suppress_tests
+if ![runto_main] then {
+    fail "can't run to main"
+    return 0
 }
 set print_core_line [gdb_get_line_number "ABORT;"]
 gdb_test "tbreak $print_core_line"
@@ -129,8 +126,8 @@ set live_data [fetch_auxv "info auxv on live process"]
 set gcore_works [gdb_gcore_cmd "$gcorefile" "gcore"]
 
 # Let the program continue and die.
-gdb_test continue ".*Program received signal.*"
-gdb_test continue ".*Program terminated with signal.*"
+gdb_test continue ".*Program received signal.*" "continue until signal"
+gdb_test continue ".*Program terminated with signal.*" "continue and terminate"
 
 # Now collect the core dump it left.
 set test "generate native core dump"