Unnecessary restore of timeout global at end of gdb.base/completion.exp
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / completion.exp
index 8d9eea5c093c414422801d8708ca62d079cb24c4..2a85df57a65d1ad0c71a13f7327e5554a1ca0f4a 100644 (file)
@@ -66,7 +66,6 @@ if ![runto_main] then {
         perror "tests suppressed"
 }
 
-set oldtimeout1 $timeout
 set timeout 30
 
 gdb_test_no_output "complete print values\[0\].x." \
@@ -105,9 +104,20 @@ gdb_test_multiple "target ctf" "" {
     }
 }
 
-foreach target_name ${targets} {
-    gdb_test "complete target ${target_name} ./gdb.base/completion" \
-       "target ${target_name} \\./gdb.base/completion.*\\./gdb.base/completion0\\.o.*\\./gdb.base/completion1\\.o.*"
+# Test artifacts are put in different locations depending on test
+# is a parallel run or not.  Firstly check file exists, and then
+# do the test on file completion.
+
+foreach dir1 [ list "./gdb.base" "./outputs/gdb.base/completion" ] {
+    if { [remote_file host exists ${dir1}/completion]
+        && [remote_file host exists ${dir1}/completion0.o]
+        && [remote_file host exists ${dir1}/completion1.o] } {
+       foreach target_name ${targets} {
+           gdb_test "complete target ${target_name} ${dir1}/completion" \
+               "target ${target_name} ${dir1}/completion.*${dir1}/completion0\\.o.*${dir1}/completion1\\.o.*"
+       }
+       break
+    }
 }
 
 #
@@ -736,7 +746,4 @@ gdb_test_multiple "" "$test" {
     }
 }
 
-# Restore globals modified in this test...
-set timeout $oldtimeout1
-
 return 0
This page took 0.025925 seconds and 4 git commands to generate.