OLD | NEW |
1 # This testcase is part of GDB, the GNU debugger. | 1 # This testcase is part of GDB, the GNU debugger. |
2 # Copyright 2007-2012 Free Software Foundation, Inc. | 2 # Copyright 2007-2013 Free Software Foundation, Inc. |
3 | 3 |
4 # This program is free software; you can redistribute it and/or modify | 4 # This program is free software; you can redistribute it and/or modify |
5 # it under the terms of the GNU General Public License as published by | 5 # it under the terms of the GNU General Public License as published by |
6 # the Free Software Foundation; either version 3 of the License, or | 6 # the Free Software Foundation; either version 3 of the License, or |
7 # (at your option) any later version. | 7 # (at your option) any later version. |
8 # | 8 # |
9 # This program is distributed in the hope that it will be useful, | 9 # This program is distributed in the hope that it will be useful, |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 # GNU General Public License for more details. | 12 # GNU General Public License for more details. |
(...skipping 15 matching lines...) Expand all Loading... |
28 return -1 | 28 return -1 |
29 } | 29 } |
30 | 30 |
31 # Make sure we're disconnected, in case we're testing with an | 31 # Make sure we're disconnected, in case we're testing with an |
32 # extended-remote board, therefore already connected. | 32 # extended-remote board, therefore already connected. |
33 gdb_test "disconnect" ".*" | 33 gdb_test "disconnect" ".*" |
34 | 34 |
35 gdbserver_run "" | 35 gdbserver_run "" |
36 | 36 |
37 proc test_file_transfer { filename description } { | 37 proc test_file_transfer { filename description } { |
38 gdb_test "remote put \"$filename\" down-server" \ | 38 set up_server up-server |
| 39 set down_server down-server |
| 40 if {![is_remote host] && ![is_remote target]} { |
| 41 » set up_server [standard_output_file $up_server] |
| 42 » set down_server [standard_output_file $down_server] |
| 43 } |
| 44 |
| 45 gdb_test "remote put \"$filename\" $down_server" \ |
39 "Successfully sent .*" "put $description" | 46 "Successfully sent .*" "put $description" |
40 gdb_test "remote get down-server up-server" \ | 47 gdb_test "remote get $down_server $up_server" \ |
41 "Successfully fetched .*" "get $description" | 48 "Successfully fetched .*" "get $description" |
42 | 49 |
43 if { ![is_remote target] } { | 50 if { ![is_remote target] } { |
44 # If we can check the target copy of the file, do that too. | 51 # If we can check the target copy of the file, do that too. |
45 # This should catch symmetric errors in upload and download. | 52 # This should catch symmetric errors in upload and download. |
46 » set result [remote_exec host "cmp -s $filename down-server"] | 53 » set result [remote_exec host "cmp -s $filename $down_server"] |
47 if { [lindex $result 0] == 0 } { | 54 if { [lindex $result 0] == 0 } { |
48 pass "compare intermediate $description" | 55 pass "compare intermediate $description" |
49 } else { | 56 } else { |
50 fail "compare intermediate $description" | 57 fail "compare intermediate $description" |
51 } | 58 } |
52 } | 59 } |
53 | 60 |
54 set result [remote_exec host "cmp -s $filename up-server"] | 61 set result [remote_exec host "cmp -s $filename $up_server"] |
55 if { [lindex $result 0] == 0 } { | 62 if { [lindex $result 0] == 0 } { |
56 pass "compare $description" | 63 pass "compare $description" |
57 } else { | 64 } else { |
58 fail "compare $description" | 65 fail "compare $description" |
59 } | 66 } |
60 | 67 |
61 gdb_test "remote delete down-server" \ | 68 gdb_test "remote delete $down_server" \ |
62 "Successfully deleted .*" "deleted $description" | 69 "Successfully deleted .*" "deleted $description" |
63 | 70 |
64 if { ![is_remote target] } { | 71 if { ![is_remote target] } { |
65 » if { ! [remote_file target exists down-server] } { | 72 » if { ! [remote_file target exists $down_server] } { |
66 pass "verified deleted $description" | 73 pass "verified deleted $description" |
67 } else { | 74 } else { |
68 fail "verified deleted $description" | 75 fail "verified deleted $description" |
69 } | 76 } |
70 } | 77 } |
71 | 78 |
72 catch { file delete up-server } | 79 catch { file delete $up_server } |
73 } | 80 } |
74 | 81 |
75 test_file_transfer "$binfile" "binary file" | 82 test_file_transfer "$binfile" "binary file" |
76 test_file_transfer "$srcdir/$subdir/transfer.txt" "text file" | 83 test_file_transfer "$srcdir/$subdir/transfer.txt" "text file" |
OLD | NEW |