From 62f2f198cdf2e006f27f61dfa6210d276d7a8e37 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Thu, 13 May 2021 16:56:03 +0100 Subject: gdb/testsuite: resolve duplicate test names in gdb.guile/*.exp This commit resolves almost all of the remaining duplicate test names in gdb.guile/*.exp. This is done by either: - Making use of with_test_prefix, - Giving tests a unique name, - Extending the existing name to make it unique, - Not printing PASS lines for simple setup commands (e.g. loading support modules, or adjusting GDB internal settings not relating to guile). gdb/testsuite/ChangeLog: * gdb.guile/scm-frame-args.exp: Add with_test_prefix to resolve duplicate test names. * gdb.guile/scm-parameter.exp: Provide test names to avoid duplicate names based on the command being run. * gdb.guile/scm-symbol.exp: Extend test name to make it unique. * gdb.guile/scm-type.exp (restart_gdb): Don't print PASS line when loading a support module. (test_equality): Update test name to match the actual test, making the name unique in the process. * gdb.guile/scm-value.exp (test_value_in_inferior): Add test names to resolve duplicate tests. (test_inferior_function_call): Likewise. (test_subscript_regression): Likewise. --- gdb/testsuite/gdb.guile/scm-value.exp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'gdb/testsuite/gdb.guile/scm-value.exp') diff --git a/gdb/testsuite/gdb.guile/scm-value.exp b/gdb/testsuite/gdb.guile/scm-value.exp index 982b9bf..bd5b149 100644 --- a/gdb/testsuite/gdb.guile/scm-value.exp +++ b/gdb/testsuite/gdb.guile/scm-value.exp @@ -132,21 +132,26 @@ proc test_value_in_inferior {} { gdb_test "gu (print (value-lazy? inval))" \ "#t" gdb_test "gu (define inval2 (value-add inval 1))" \ - "ERROR: Cannot access memory at address 0x0.*" $test + "ERROR: Cannot access memory at address 0x0.*" \ + "$test, using value in value-add" gdb_test "gu (value-fetch-lazy! inval))" \ - "ERROR: Cannot access memory at address 0x0.*" $test + "ERROR: Cannot access memory at address 0x0.*" \ + "$test, using value in value-fetch-lazy!" } gdb_test_no_output "gu (define argc-lazy (parse-and-eval \"argc\"))" gdb_test_no_output "gu (define argc-notlazy (parse-and-eval \"argc\"))" gdb_test_no_output "gu (value-fetch-lazy! argc-notlazy)" - gdb_test "gu (print (value-lazy? argc-lazy))" "= #t" + gdb_test "gu (print (value-lazy? argc-lazy))" "= #t" \ + "argc-lazy is initially lazy" gdb_test "gu (print (value-lazy? argc-notlazy))" "= #f" gdb_test "print argc" "= 1" "sanity check argc" - gdb_test "gu (print (value-lazy? argc-lazy))" "= #t" + gdb_test "gu (print (value-lazy? argc-lazy))" "= #t" \ + "argc-lazy is still lazy after argc is printed" gdb_test_no_output "set argc=2" gdb_test "gu (print argc-notlazy)" "= 1" gdb_test "gu (print argc-lazy)" "= 2" - gdb_test "gu (print (value-lazy? argc-lazy))" "= #f" + gdb_test "gu (print (value-lazy? argc-lazy))" "= #f" \ + "argc-lazy is no longer lazy" # Test string fetches, both partial and whole. gdb_test "print st" "\"divide et impera\"" @@ -239,7 +244,8 @@ proc test_inferior_function_call {} { "= void" # Correct inferior call with arguments. - gdb_test "p/x fp2" "= $hex.*" + gdb_test "p/x fp2" "= $hex.*" \ + "place fp2 into value history, the first time" gdb_scm_test_silent_cmd "gu (define fp2 (history-ref 0))" \ "get fp2 value from history" gdb_scm_test_silent_cmd "gu (set! fp2 (value-dereference fp2))" \ @@ -255,7 +261,8 @@ proc test_inferior_function_call {} { "ERROR: .*: Wrong type argument in position 1 \\(expecting function \\(value of TYPE_CODE_FUNC\\)\\): .*" # Incorrect number of arguments. - gdb_test "p/x fp2" "= $hex.*" + gdb_test "p/x fp2" "= $hex.*" \ + "place fp2 into value history, the second time" gdb_scm_test_silent_cmd "gu (define fp3 (history-ref 0))" \ "get fp3 value from history" gdb_scm_test_silent_cmd "gu (set! fp3 (value-dereference fp3))" \ @@ -334,7 +341,7 @@ proc test_subscript_regression {exefile lang} { } gdb_breakpoint [gdb_get_line_number "break to inspect struct and union"] - gdb_continue_to_breakpoint "break to inspect struct and union" + gdb_continue_to_breakpoint "break to inspect struct and union in $lang" gdb_scm_test_silent_cmd "gu (define intv (make-value 1))" \ "Create int value for subscript test" -- cgit v1.1