From patchwork Thu Feb 18 23:16:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Stump X-Patchwork-Id: 10911 Received: (qmail 60429 invoked by alias); 18 Feb 2016 23:20:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 60410 invoked by uid 89); 18 Feb 2016 23:20:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=BAYES_20, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:MHil, H*c:HpplH, 737, 467 X-HELO: resqmta-po-01v.sys.comcast.net Received: from resqmta-po-01v.sys.comcast.net (HELO resqmta-po-01v.sys.comcast.net) (96.114.154.160) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 18 Feb 2016 23:20:22 +0000 Received: from resomta-po-12v.sys.comcast.net ([96.114.154.236]) by resqmta-po-01v.sys.comcast.net with comcast id KzLL1s00356HXL001zLLpx; Thu, 18 Feb 2016 23:20:20 +0000 Received: from [IPv6:2001:558:6045:a4:40c6:7199:cd03:b02d] ([IPv6:2001:558:6045:a4:40c6:7199:cd03:b02d]) by resomta-po-12v.sys.comcast.net with comcast id KzLJ1s00R2ztT3H01zLKbU; Thu, 18 Feb 2016 23:20:20 +0000 From: Mike Stump Subject: test case names in gdb testsuite Message-Id: Date: Thu, 18 Feb 2016 15:16:47 -0800 To: gdb-patches@sourceware.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) So, the design of the tests suite was to have portable names that can survive prefix changes. In the gdb test suite, I see: PASS: gdb.base/break-fun-addr.exp: /home/mrs/work/binutils-machine/gdb/testsuite/outputs/gdb.base/break-fun-addr/break-fun-addr1: break *main PASS: gdb.base/break-fun-addr.exp: /home/mrs/work/binutils-machine/gdb/testsuite/outputs/gdb.base/break-fun-addr/break-fun-addr1: run to breakpoint at *main PASS: gdb.base/break-fun-addr.exp: /home/mrs/work/binutils-machine/gdb/testsuite/outputs/gdb.base/break-fun-addr/break-fun-addr1: p $pc == main FAIL: gdb.base/break-fun-addr.exp: /home/mrs/work/binutils-machine/gdb/testsuite/outputs/gdb.base/break-fun-addr/break-fun-addr2: run to breakpoint at *main PASS: gdb.base/break-fun-addr.exp: /home/mrs/work/binutils-machine/gdb/testsuite/outputs/gdb.base/break-fun-addr/break-fun-addr2: p $pc == main and” PASS: gdb.python/py-completion.exp: source /home/mrs/work/binutils-machine/gdb/testsuite/../../../binutils/gdb/testsuite/gdb.python/py-completion.py PASS: gdb.python/py-completion.exp: source /home/mrs/work/binutils-machine/gdb/testsuite/../../../binutils/gdb/testsuite/gdb.python/py-completion.py which are the only violations of the general rule I see. I’m doing tool validating, and noticed the account name that did the test in the PASS:/FAIL: lines. This causes failures when comparing across different testing accounts. gcc, the reset of binutils and newlib don’t have this problem, gdb is the last tool to do this. So, for the first group, this: produces: PASS: gdb.python/py-completion.exp: source gdb.python/py-completion.py PASS: gdb.python/py-completion.exp: completefileinit completion PASS: gdb.python/py-completion.exp: discard #1 PASS: gdb.python/py-completion.exp: completefilemethod completion PASS: gdb.python/py-completion.exp: discard #2 PASS: gdb.python/py-completion.exp: completefilecommandcond completion PASS: gdb.python/py-completion.exp: source gdb.python/py-completion.py PASS: gdb.python/py-completion.exp: list all completions of 'complete completel' PASS: gdb.python/py-completion.exp: discard #3 PASS: gdb.python/py-completion.exp: list all completions of 'complete completelimit1 c' PASS: gdb.python/py-completion.exp: discard #4 PASS: gdb.python/py-completion.exp: tab-complete 'completelimit1 c' PASS: gdb.python/py-completion.exp: discard #5 PASS: gdb.python/py-completion.exp: list all completions of 'complete completelimit2 c’ Ok? The inline text won’t make it though patch, so, here is the attached version that will. diff --git a/gdb/testsuite/gdb.base/break-fun-addr.exp b/gdb/testsuite/gdb.base/break-fun-addr.exp index e8bed3f..96043ef 100644 --- a/gdb/testsuite/gdb.base/break-fun-addr.exp +++ b/gdb/testsuite/gdb.base/break-fun-addr.exp @@ -46,7 +46,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {d clean_restart ${binfile1} -with_test_prefix "${binfile1}" { +with_test_prefix "${subdir}/${gdb_test_file_name}/${testfile1}" { gdb_test "break *main" \ "Breakpoint.*at.* file .*$srcfile1, line .*" \ @@ -73,7 +73,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {d # start a new debugging session with a different executable. gdb_load ${binfile2} -with_test_prefix "${binfile2}" { +with_test_prefix "${subdir}/${gdb_test_file_name}/${testfile2}" { gdb_run_cmd gdb_test "" \ diff --git a/gdb/testsuite/gdb.python/py-completion.exp b/gdb/testsuite/gdb.python/py-completion.exp index 900d6f5..d8376d4 100644 --- a/gdb/testsuite/gdb.python/py-completion.exp +++ b/gdb/testsuite/gdb.python/py-completion.exp @@ -23,7 +23,7 @@ gdb_start # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } -gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" +gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" "source ${subdir}/${testfile}.py" # Create a temporary directory set testdir "[standard_output_file "py-completion-testdir"]/" @@ -73,7 +73,7 @@ gdb_test_multiple "" "completefilecommandcond completion" { # with the expected output of the below tests in a buggy gdb. gdb_exit gdb_start -gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" +gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" "source ${subdir}/${testfile}.py" gdb_test_sequence "complete completel" \ "list all completions of 'complete completel'" { diff --git a/gdb/testsuite/gdb.base/break-fun-addr.exp b/gdb/testsuite/gdb.base/break-fun-addr.exp index e8bed3f..96043ef 100644 --- a/gdb/testsuite/gdb.base/break-fun-addr.exp +++ b/gdb/testsuite/gdb.base/break-fun-addr.exp @@ -46,7 +46,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {d clean_restart ${binfile1} -with_test_prefix "${binfile1}" { +with_test_prefix "${subdir}/${gdb_test_file_name}/${testfile1}" { gdb_test "break *main" \ "Breakpoint.*at.* file .*$srcfile1, line .*" \ @@ -73,7 +73,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {d # start a new debugging session with a different executable. gdb_load ${binfile2} -with_test_prefix "${binfile2}" { +with_test_prefix "${subdir}/${gdb_test_file_name}/${testfile2}" { gdb_run_cmd gdb_test "” \ should fix it. This avoids the parallel names and the prefix. The test case names now look like: PASS: gdb.base/break-fun-addr.exp: gdb.base/break-fun-addr/break-fun-addr1: break *main PASS: gdb.base/break-fun-addr.exp: gdb.base/break-fun-addr/break-fun-addr1: run to breakpoint at *main PASS: gdb.base/break-fun-addr.exp: gdb.base/break-fun-addr/break-fun-addr1: p $pc == main PASS: gdb.base/break-fun-addr.exp: gdb.base/break-fun-addr/break-fun-addr2: p $pc == main which is preferred. For the second one, this: diff --git a/gdb/testsuite/gdb.python/py-completion.exp b/gdb/testsuite/gdb.python/py-completion.exp index 900d6f5..d8376d4 100644 --- a/gdb/testsuite/gdb.python/py-completion.exp +++ b/gdb/testsuite/gdb.python/py-completion.exp @@ -23,7 +23,7 @@ gdb_start # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } -gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" +gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" "source ${subdir}/${testfile}.py" # Create a temporary directory set testdir "[standard_output_file "py-completion-testdir"]/" @@ -73,7 +73,7 @@ gdb_test_multiple "" "completefilecommandcond completion" { # with the expected output of the below tests in a buggy gdb. gdb_exit gdb_start -gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" +gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" "source ${subdir}/${testfile}.py" gdb_test_sequence "complete completel" \ "list all completions of 'complete completel'” {