fix argv0-symlink.exp for parallel mode
authorTom Tromey <tromey@redhat.com>
Fri, 18 Oct 2013 19:12:32 +0000 (13:12 -0600)
committerTom Tromey <tromey@redhat.com>
Mon, 4 Nov 2013 18:02:10 +0000 (11:02 -0700)
argv0-symlink.exp doesn't work properly if standard_output_file puts
files into a per-test subdirectory.  That's because it assumes that
files appear in $subdir, which is no longer true.

This patch fixes the problem by computing the correct directory at
runtime.

Tested both with and without GDB_PARALLEL on x86-64 Fedora 18.

2013-11-04  Tom Tromey  <tromey@redhat.com>

* gdb.base/argv0-symlink.exp: Compute executable's directory
dynamically.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/argv0-symlink.exp

index d058ed0b59e16174c93ddba173302fb3686729c1..f60e65703f9d6fe958be1c74fc5723f9cc5ca696 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-04  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.base/argv0-symlink.exp: Compute executable's directory
+       dynamically.
+
 2013-11-04  Tom Tromey  <tromey@redhat.com>
 
        * gdb.asm/asm-source.exp: Use standard_output_file.
index cf5785c856e18988c8a1a352a37e49fa19f58d2a..e4efe19d784ad6f32b0d8edc7457e5144b7746bc 100644 (file)
@@ -37,7 +37,14 @@ if ![runto_main] {
 }
 
 gdb_test {print argv[0]} "/$filelink\"" $test
-gdb_test "info inferiors" "/$subdir/$filelink *" "$test for info inferiors"
+
+# For a link named /PATH/TO/DIR/LINK, we want to check the output
+# against "/DIR/LINK", but computed in a way that doesn't make
+# assumptions about the test directory layout.
+set full_filelink [standard_output_file $filelink]
+set lastdir [file tail [file dirname $full_filelink]]
+
+gdb_test "info inferiors" "/$lastdir/$filelink *" "$test for info inferiors"
 
 
 set test "kept directory symbolic link name"
@@ -65,4 +72,4 @@ if ![is_remote target] {
     setup_kfail "*-*-*" gdb/15934
 }
 gdb_test {print argv[0]} "/$dirlink/$filelink\"" $test
-gdb_test "info inferiors" "/$subdir/$filelink *" "$test for info inferiors"
+gdb_test "info inferiors" "/$lastdir/$filelink *" "$test for info inferiors"
This page took 0.037194 seconds and 4 git commands to generate.