Commit 17a8a7aa by Maxim Kuvyrkov Committed by Maxim Kuvyrkov

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
parent 565fad70
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> 2014-10-17 Jonathan Wakely <jwakely@redhat.com>
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc: * testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
......
...@@ -65,19 +65,24 @@ proc v3track { var n } { ...@@ -65,19 +65,24 @@ proc v3track { var n } {
verbose "++ $var is $val" $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. # Called by v3-init below. "Static" to this file.
proc v3-copy-files {srcfiles} { proc v3-copy-files {srcfiles} {
foreach f $srcfiles { foreach f $srcfiles {
if { [catch { set symlink [file readlink $f] } x] } then { v3-copy-file $f [file tail $f]
remote_download target $f
} else {
if { [regexp "^/" "$symlink"] } then {
remote_download target $symlink
} else {
set dirname [file dirname $f]
remote_download target $dirname/$symlink
}
}
} }
} }
...@@ -690,8 +695,8 @@ proc check_v3_target_fileio { } { ...@@ -690,8 +695,8 @@ proc check_v3_target_fileio { } {
# the file functions # the file functions
set src fileio[pid].cc set src fileio[pid].cc
set exe fileio[pid].x set exe fileio[pid].x
set testfile "cin_unget-1.txt" set testfile "cin_unget-1.[pid].txt"
v3-copy-files "$srcdir/data/$testfile" v3-copy-file "$srcdir/data/cin_unget-1.txt" "$testfile"
set f [open $src "w"] set f [open $src "w"]
puts $f "#include <sys/types.h>" puts $f "#include <sys/types.h>"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment