aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2014-10-19 21:07:29 +0000
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>2014-10-19 21:07:29 +0000
commit17a8a7aa55e5846ee14132dfd4773d183c6a3f42 (patch)
tree771e4818348b069acfda14a8d50dac0039c0fcf0
parent565fad70aa35e354b628c5f94639e543a631e8e8 (diff)
downloadgcc-17a8a7aa55e5846ee14132dfd4773d183c6a3f42.zip
gcc-17a8a7aa55e5846ee14132dfd4773d183c6a3f42.tar.gz
gcc-17a8a7aa55e5846ee14132dfd4773d183c6a3f42.tar.bz2
Fix race in libstdc++ testsuite
* testsuite/lib/libstdc++.exp (v3-copy-file): New proc split from ... (v3-copy-files): ... this. Update. (check_v3_target_fileio): Fix race on cin_unget-1.txt file. From-SVN: r216444
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp29
2 files changed, 23 insertions, 12 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index bc8468f..fcaaea0 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-19 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
+
+ * testsuite/lib/libstdc++.exp (v3-copy-file): New proc split from ...
+ (v3-copy-files): ... this. Update.
+ (check_v3_target_fileio): Fix race on cin_unget-1.txt file.
+
2014-10-17 Jonathan Wakely <jwakely@redhat.com>
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index f14d1a7..3d9913b 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -65,19 +65,24 @@ proc v3track { var n } {
verbose "++ $var is $val" $n
}
+# Copy file to the target.
+proc v3-copy-file {src dst} {
+ if { [catch { set symlink [file readlink $src] } x] } then {
+ remote_download target $src $dst
+ } else {
+ if { [regexp "^/" "$symlink"] } then {
+ remote_download target $symlink $dst
+ } else {
+ set dirname [file dirname $f]
+ remote_download target $dirname/$symlink $dst
+ }
+ }
+}
+
# Called by v3-init below. "Static" to this file.
proc v3-copy-files {srcfiles} {
foreach f $srcfiles {
- if { [catch { set symlink [file readlink $f] } x] } then {
- remote_download target $f
- } else {
- if { [regexp "^/" "$symlink"] } then {
- remote_download target $symlink
- } else {
- set dirname [file dirname $f]
- remote_download target $dirname/$symlink
- }
- }
+ v3-copy-file $f [file tail $f]
}
}
@@ -690,8 +695,8 @@ proc check_v3_target_fileio { } {
# the file functions
set src fileio[pid].cc
set exe fileio[pid].x
- set testfile "cin_unget-1.txt"
- v3-copy-files "$srcdir/data/$testfile"
+ set testfile "cin_unget-1.[pid].txt"
+ v3-copy-file "$srcdir/data/cin_unget-1.txt" "$testfile"
set f [open $src "w"]
puts $f "#include <sys/types.h>"