aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/fileio.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-08-23 12:18:39 -0600
committerTom Tromey <tromey@redhat.com>2013-11-04 11:02:08 -0700
commitb44b82afd9ec85bff726e294b0d0065efb5179e0 (patch)
tree52339fdfe89268df470e3d472625dcae3aa52e10 /gdb/testsuite/gdb.base/fileio.exp
parent59b28c5dd267407c63968cb18d9f3c5aa78fa2ba (diff)
downloadgdb-b44b82afd9ec85bff726e294b0d0065efb5179e0.zip
gdb-b44b82afd9ec85bff726e294b0d0065efb5179e0.tar.gz
gdb-b44b82afd9ec85bff726e294b0d0065efb5179e0.tar.bz2
update fileio test
This updates the fileio test to be parallel-safe. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.base/fileio.c (test_open, test_write, test_read) (test_lseek, test_close, test_stat, test_fstat) (test_isatty, test_system, test_rename, test_unlink): Use OUTDIR define. * gdb.base/fileio.exp: Define OUTDIR during compilation. Use standard_output_file.
Diffstat (limited to 'gdb/testsuite/gdb.base/fileio.exp')
-rw-r--r--gdb/testsuite/gdb.base/fileio.exp24
1 files changed, 15 insertions, 9 deletions
diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp
index ded043f..b9dfb38 100644
--- a/gdb/testsuite/gdb.base/fileio.exp
+++ b/gdb/testsuite/gdb.base/fileio.exp
@@ -23,7 +23,15 @@ if [target_info exists gdb,nofileio] {
standard_testfile
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+if {[is_remote host]} {
+ set outdir .
+} else {
+ set outdir [standard_output_file {}]
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+ executable \
+ [list debug "additional_flags=-DOUTDIR=\"$outdir/\""]] != "" } {
untested fileio.exp
return -1
}
@@ -35,8 +43,11 @@ if [get_compiler_info] {
return -1
}
-remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
-remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
+set dir2 [standard_output_file dir2.fileio.test]
+if {[file exists $dir2] && ![file writable $dir2]} {
+ system "chmod +w $dir2"
+}
+system "rm -rf [standard_output_file *.fileio.test]"
set oldtimeout $timeout
set timeout [expr "$timeout + 60"]
@@ -78,7 +89,7 @@ gdb_test continue \
gdb_test "continue" ".*" ""
-catch "system \"chmod -f -w nowrt.fileio.test\""
+catch "system \"chmod -f -w [standard_output_file nowrt.fileio.test]\""
gdb_test continue \
"Continuing\\..*open 5:.*EACCES$stop_msg" \
@@ -241,11 +252,6 @@ gdb_test continue \
"Time(2) returns feasible values"
gdb_exit
-# Wait till GDB really exits.
-sleep 1
-
-remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
-remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
set timeout $oldtimeout
return 0