-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
+ }