Index: gdb/testsuite/gdb.base/checkpoint.exp |
diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp |
index fabe39d53eca5ee4113cc704e875b6c514ee9491..f1af47125b4b05716c827bb56ddb7b7a5c0005cf 100644 |
--- a/gdb/testsuite/gdb.base/checkpoint.exp |
+++ b/gdb/testsuite/gdb.base/checkpoint.exp |
@@ -1,4 +1,4 @@ |
-# Copyright 2005, 2007-2012 Free Software Foundation, Inc. |
+# Copyright 2005-2013 Free Software Foundation, Inc. |
# This program is free software; you can redistribute it and/or modify |
# it under the terms of the GNU General Public License as published by |
@@ -25,30 +25,27 @@ if {![istarget "*-*-linux*"]} then { |
} |
-set testfile "checkpoint" |
-set srcfile ${testfile}.c |
-set binfile ${objdir}/${subdir}/${testfile} |
+standard_testfile .c |
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { |
+set pi_txt [gdb_remote_download host ${srcdir}/${subdir}/pi.txt] |
+if {[is_remote host]} { |
+ set copy1_txt copy1.txt |
+} else { |
+ set copy1_txt [standard_output_file copy1.txt] |
+} |
+ |
+if {[prepare_for_testing ${testfile}.exp $testfile $srcfile \ |
+ [list debug "additional_flags=-DPI_TXT=\"$pi_txt\" -DCOPY1_TXT=\"$copy1_txt\""]]} { |
untested checkpoint.exp |
return -1 |
} |
-# Start with a fresh gdb |
- |
-gdb_exit |
-gdb_start |
-gdb_reinitialize_dir $srcdir/$subdir |
-gdb_load ${binfile} |
- |
global gdb_prompt |
# |
# This tests gdb checkpoint and restart. |
# |
-remote_download host ${srcdir}/${subdir}/pi.txt pi.txt |
- |
runto_main |
set break1_loc [gdb_get_line_number "breakpoint 1"] |
set break2_loc [gdb_get_line_number "breakpoint 2"] |
@@ -153,8 +150,8 @@ gdb_test "restart 0" "Switching to .*breakpoint 2.*" "restart 0 one" |
gdb_breakpoint $break3_loc |
gdb_test "continue" "breakpoint 3.*" "break3 one" |
-gdb_test "shell diff -s pi.txt copy1.txt" \ |
- "Files pi.txt and copy1.txt are identical.*" \ |
+gdb_test "shell diff -s $pi_txt $copy1_txt" \ |
+ "Files .*pi.txt and .*copy1.txt are identical.*" \ |
"Diff input and output one" |
# |
@@ -206,8 +203,8 @@ gdb_test "continue 1100" "breakpoint 1.*" "breakpoint 1 7 one" |
gdb_test "step" "if .c == EOF.*" "step in 7 two" |
gdb_test "print lines" " = 1162.*" "verify lines 7 two" |
-gdb_test "shell diff -s pi.txt copy1.txt" \ |
- "Files pi.txt and copy1.txt are identical.*" \ |
+gdb_test "shell diff -s $pi_txt $copy1_txt" \ |
+ "Files .*pi.txt and .*copy1.txt are identical.*" \ |
"Diff input and output two" |
# |
@@ -219,8 +216,8 @@ gdb_test "restart 0" "Switching to .*breakpoint 3.*" "restart 0 one" |
gdb_breakpoint $break4_loc |
gdb_test "continue" "breakpoint 4.*" "break4 one" |
-gdb_test "shell diff pi.txt copy1.txt" \ |
- "diff: copy1.txt: No such file or directory" \ |
+gdb_test "shell diff $pi_txt $copy1_txt" \ |
+ "diff: .*copy1.txt: No such file or directory" \ |
"delete copy1" |
delete_breakpoints |
@@ -230,39 +227,39 @@ gdb_test "restart 1" "if .c == EOF.*" "restart 1 three" |
gdb_test "continue" "breakpoint 2.*" "break2 1 one" |
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 1" |
-gdb_test "restart 2" "if .c == EOF.*" "restart 1 three" |
+gdb_test "restart 2" "if .c == EOF.*" "restart 2 three" |
gdb_test "continue" "breakpoint 2.*" "break2 2 one" |
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 2" |
-gdb_test "restart 3" "if .c == EOF.*" "restart 1 three" |
+gdb_test "restart 3" "if .c == EOF.*" "restart 3 three" |
gdb_test "continue" "breakpoint 2.*" "break2 3 one" |
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 3" |
-gdb_test "restart 4" "if .c == EOF.*" "restart 1 three" |
+gdb_test "restart 4" "if .c == EOF.*" "restart 4 three" |
gdb_test "continue" "breakpoint 2.*" "break2 4 one" |
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 4" |
-gdb_test "restart 5" "if .c == EOF.*" "restart 1 three" |
+gdb_test "restart 5" "if .c == EOF.*" "restart 5 three" |
gdb_test "continue" "breakpoint 2.*" "break2 5 one" |
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 5" |
-gdb_test "restart 6" "if .c == EOF.*" "restart 1 three" |
+gdb_test "restart 6" "if .c == EOF.*" "restart 6 three" |
gdb_test "continue" "breakpoint 2.*" "break2 6 one" |
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 6" |
-gdb_test "restart 7" "if .c == EOF.*" "restart 1 three" |
+gdb_test "restart 7" "if .c == EOF.*" "restart 7 three" |
gdb_test "continue" "breakpoint 2.*" "break2 7 one" |
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 7" |
-gdb_test "restart 8" "if .c == EOF.*" "restart 1 three" |
+gdb_test "restart 8" "if .c == EOF.*" "restart 8 three" |
gdb_test "continue" "breakpoint 2.*" "break2 8 one" |
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 8" |
-gdb_test "restart 9" "if .c == EOF.*" "restart 1 three" |
+gdb_test "restart 9" "if .c == EOF.*" "restart 9 three" |
gdb_test "continue" "breakpoint 2.*" "break2 9 one" |
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 9" |
-gdb_test "restart 10" "if .c == EOF.*" "restart 1 three" |
+gdb_test "restart 10" "if .c == EOF.*" "restart 10 three" |
gdb_test "continue" "breakpoint 2.*" "break2 10 one" |
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 10" |
@@ -375,4 +372,4 @@ verbose "Timeout now $timeout sec." |
# Finished: cleanup |
# |
-remote_exec build "rm -f pi.txt" |
+remote_exec host "rm -f $pi_txt" |