2014-12-04 Yvan Roux <yvan.roux@linaro.org>
authoryroux <yroux@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Dec 2014 11:55:39 +0000 (11:55 +0000)
committerDongkyun, Son <dongkyun.s@samsung.com>
Sat, 6 Jun 2015 14:26:46 +0000 (23:26 +0900)
Backport from trunk r216444.
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218350 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog.linaro
libstdc++-v3/testsuite/lib/libstdc++.exp

index 26a0a50..63c521d 100644 (file)
@@ -1,3 +1,12 @@
+2014-12-04  Yvan Roux  <yvan.roux@linaro.org>
+
+       Backport from trunk r216444.
+       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-11-14  Yvan Roux  <yvan.roux@linaro.org>
 
        GCC Linaro 4.9-2014.11 released.
index 95954d8..1fc2bf5 100644 (file)
@@ -63,19 +63,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]
     }
 }
 
@@ -681,8 +686,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>"