This is the mail archive of the gdb-cvs@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]

[binutils-gdb] Fix unstable test names in gdb.base/startup-with-shell.exp


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=10389c2c8b56b2519441e55bf16f77882fb897cb

commit 10389c2c8b56b2519441e55bf16f77882fb897cb
Author: Pedro Alves <palves@redhat.com>
Date:   Tue Oct 24 10:43:33 2017 +0100

    Fix unstable test names in gdb.base/startup-with-shell.exp
    
    Currently, if you diff testsuite/gdb.sum of two builds in different
    directories you see these spurious hunks:
    
      -PASS: gdb.base/startup-with-shell.exp: touch /home/pedro/gdb1/build/gdb/testsuite/outputs/gdb.base/startup-with-shell/unique-file.unique-extension
      +PASS: gdb.base/startup-with-shell.exp: touch /home/pedro/gdb2/build/gdb/testsuite/outputs/gdb.base/startup-with-shell/unique-file.unique-extension
    
      -PASS: gdb.base/startup-with-shell.exp: startup_with_shell = on; run_args = *.unique-extension: set args /home/pedro/gdb1/build/gdb/testsuite/outputs/gdb.base/startup-with-shell/*.unique-extension
      +PASS: gdb.base/startup-with-shell.exp: startup_with_shell = on; run_args = *.unique-extension: set args /home/pedro/gdb2/build/gdb/testsuite/outputs/gdb.base/startup-with-shell/*.unique-extension
    
      -PASS: gdb.base/startup-with-shell.exp: startup_with_shell = off; run_args = *.unique-extension: set args /home/pedro/gdb1/build/gdb/testsuite/outputs/gdb.base/startup-with-shell/*.unique-extension
      +PASS: gdb.base/startup-with-shell.exp: startup_with_shell = off; run_args = *.unique-extension: set args /home/pedro/gdb2/build/gdb/testsuite/outputs/gdb.base/startup-with-shell/*.unique-extension
    
    Since the run_args arguments are already shown in the test prefix, we
    can change the "set args" test name to literally "set args $run_args".
    I.e., after this commit we'll show:
    
      PASS: gdb.base/startup-with-shell.exp: startup_with_shell = on; run_args = *.unique-extension: set args $run_args
      PASS: gdb.base/startup-with-shell.exp: startup_with_shell = off; run_args = *.unique-extension: set args $run_args
      PASS: gdb.base/startup-with-shell.exp: startup_with_shell = on; run_args = $TEST: set args $run_args
      PASS: gdb.base/startup-with-shell.exp: startup_with_shell = off; run_args = $TEST: set args $run_args
    
    gdb/testsuite/ChangeLog:
    2017-10-24  Pedro Alves  <palves@redhat.com>
    
    	* gdb.base/startup-with-shell.exp ('touch $unique_file'): Don't
    	include the unstable output directory name in the test's name.
    	(initial_setup_simple) <'set args'>: Use custom test name.

Diff:
---
 gdb/testsuite/ChangeLog                       | 6 ++++++
 gdb/testsuite/gdb.base/startup-with-shell.exp | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index a8c4d81..36c2b95 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
 2017-10-24  Pedro Alves  <palves@redhat.com>
 
+	* gdb.base/startup-with-shell.exp ('touch $unique_file'): Don't
+	include the unstable output directory name in the test's name.
+	(initial_setup_simple) <'set args'>: Use custom test name.
+
+2017-10-24  Pedro Alves  <palves@redhat.com>
+
 	* gdb.arch/arc-tdesc-cpu.exp ('set tdesc filename'): Use gdb_test
 	with explicit test name.
 
diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp
index af06c88..29a4ec5 100644
--- a/gdb/testsuite/gdb.base/startup-with-shell.exp
+++ b/gdb/testsuite/gdb.base/startup-with-shell.exp
@@ -37,7 +37,9 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
 set unique_file [standard_output_file "unique-file.unique-extension"]
 set unique_file_dir [standard_output_file ""]
 
-run_on_host "touch $unique_file" "touch" "$unique_file"
+run_on_host \
+    "touch OUTPUT_DIR/unique-file.unique-extension" \
+    "touch" "$unique_file"
 
 # Initial setup for simple test (wildcard expansion, variable substitution).
 
@@ -48,7 +50,8 @@ proc initial_setup_simple { startup_with_shell run_args } {
 
     gdb_test_no_output "set startup-with-shell $startup_with_shell"
 
-    gdb_test_no_output "set args $run_args"
+    gdb_test_no_output "set args $run_args" \
+	"set args \$run_args"
 
     set test "inferior started"
     if { [runto_main] } {


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