From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7109 invoked by alias); 25 Oct 2013 20:24:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 7094 invoked by uid 89); 25 Oct 2013 20:24:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Oct 2013 20:24:02 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9PKLFeO011736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 25 Oct 2013 16:21:15 -0400 Received: from barimba.redhat.com (ovpn-113-54.phx2.redhat.com [10.3.113.54]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9PKLAJY000870; Fri, 25 Oct 2013 16:21:15 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v3 09/17] update checkpoint test Date: Fri, 25 Oct 2013 20:24:00 -0000 Message-Id: <1382732464-28121-10-git-send-email-tromey@redhat.com> In-Reply-To: <1382732464-28121-1-git-send-email-tromey@redhat.com> References: <1382732464-28121-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-10/txt/msg00828.txt.bz2 This fixes the "checkpoint" test to use the standard output directory. This makes the test be parallel-safe. ~ChangeLog~ 2013-10-24 Tom Tromey * gdb.base/checkpoint.c (main): Use PI_TXT and COPY1_TXT defines. * gdb.base/checkpoint.exp: Define PI_TXT and COPY1_TXT during compilation. Use prepare_for_testing, standard_output_file. --- gdb/testsuite/ChangeLog | 7 +++++++ gdb/testsuite/gdb.base/checkpoint.c | 6 +++--- gdb/testsuite/gdb.base/checkpoint.exp | 30 ++++++++++++++++-------------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/gdb/testsuite/gdb.base/checkpoint.c b/gdb/testsuite/gdb.base/checkpoint.c index c287094..d498047 100644 --- a/gdb/testsuite/gdb.base/checkpoint.c +++ b/gdb/testsuite/gdb.base/checkpoint.c @@ -28,8 +28,8 @@ main() long i; int c = 0; - in = fopen ("pi.txt", "r"); - out = fopen ("copy1.txt", "w"); + in = fopen (PI_TXT, "r"); + out = fopen (COPY1_TXT, "w"); if (!in || !out) { @@ -54,6 +54,6 @@ main() fclose (in); fclose (out); printf ("Deleting copy.\n"); /* breakpoint 3 */ - unlink ("copy1.txt"); + unlink (COPY1_TXT); exit (0); /* breakpoint 4 */ } diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp index b86fead..f1af471 100644 --- a/gdb/testsuite/gdb.base/checkpoint.exp +++ b/gdb/testsuite/gdb.base/checkpoint.exp @@ -27,23 +27,25 @@ if {![istarget "*-*-linux*"]} then { 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 - -clean_restart ${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"] @@ -148,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" # @@ -201,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" # @@ -214,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 @@ -370,4 +372,4 @@ verbose "Timeout now $timeout sec." # Finished: cleanup # -remote_exec build "rm -f pi.txt" +remote_exec host "rm -f $pi_txt" -- 1.8.1.4