gdb/testsuite: resolve duplicate test names in gdb.guile/*.exp
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 13 May 2021 15:56:03 +0000 (16:56 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 13 May 2021 16:53:39 +0000 (17:53 +0100)
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/ChangeLog
gdb/testsuite/gdb.guile/scm-frame-args.exp
gdb/testsuite/gdb.guile/scm-parameter.exp
gdb/testsuite/gdb.guile/scm-symbol.exp
gdb/testsuite/gdb.guile/scm-type.exp
gdb/testsuite/gdb.guile/scm-value.exp

index afcf2acc0ff0de522f2ed7766e09c9d044abf749..287313f5d01f101341f91525baab0e5dc33b1a2d 100644 (file)
@@ -1,3 +1,19 @@
+2021-05-10  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * 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.
+
 2021-05-10  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * lib/guile.exp (gdb_scm_load_file): Use empty test name to
index f5c81747f0122b8dd3512f1e82fbd7f6d3c90f3f..89603cfc917b798de9b76aead0e7a47f668259fc 100644 (file)
@@ -37,37 +37,35 @@ gdb_breakpoint [gdb_get_line_number "break-here"]
 gdb_continue_to_breakpoint "break-here" ".* break-here .*"
 
 # Test all combinations with raw off.
-
 gdb_test_no_output "set print raw-frame-arguments off"
-
-gdb_test_no_output "set print frame-arguments none"
-gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
-    "frame pretty,none"
-
-#gdb_test_no_output "set guile print-stack full"
-
-gdb_test_no_output "set print frame-arguments scalars"
-gdb_test "frame" ".*foo \\(x=42, ss=super struct = {\[.\]{3}}\\).*" \
-    "frame pretty,scalars"
-
-gdb_test_no_output "set print frame-arguments all"
-gdb_test "frame" \
-    ".*foo \\(x=42, ss=super struct = {a = m=<1>, b = m=<2>}\\).*" \
-    "frame pretty,all"
+with_test_prefix "raw-frame-arguments=off" {
+    gdb_test_no_output "set print frame-arguments none"
+    gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
+       "frame pretty,none"
+
+    gdb_test_no_output "set print frame-arguments scalars"
+    gdb_test "frame" ".*foo \\(x=42, ss=super struct = {\[.\]{3}}\\).*" \
+       "frame pretty,scalars"
+
+    gdb_test_no_output "set print frame-arguments all"
+    gdb_test "frame" \
+       ".*foo \\(x=42, ss=super struct = {a = m=<1>, b = m=<2>}\\).*" \
+       "frame pretty,all"
+}
 
 # Test all combinations with raw on.
-
 gdb_test_no_output "set print raw-frame-arguments on"
-
-gdb_test_no_output "set print frame-arguments none"
-gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
-    "frame raw,none"
-
-gdb_test_no_output "set print frame-arguments scalars"
-gdb_test "frame" ".*foo \\(x=42, ss=\[.\]{3}\\).*" \
-    "frame raw,scalars"
-
-gdb_test_no_output "set print frame-arguments all"
-gdb_test "frame" \
-    ".*foo \\(x=42, ss={a = {m = 1}, b = {m = 2}}\\).*" \
-    "frame raw,all"
+with_test_prefix "raw-frame-arguments=on" {
+    gdb_test_no_output "set print frame-arguments none"
+    gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
+       "frame raw,none"
+
+    gdb_test_no_output "set print frame-arguments scalars"
+    gdb_test "frame" ".*foo \\(x=42, ss=\[.\]{3}\\).*" \
+       "frame raw,scalars"
+
+    gdb_test_no_output "set print frame-arguments all"
+    gdb_test "frame" \
+       ".*foo \\(x=42, ss={a = {m = 1}, b = {m = 2}}\\).*" \
+       "frame raw,all"
+}
index 857f8c5eba7d80676d52d020000a96013bb0206f..67120b23366451bd24599f7a115fdeb77486d9c7 100644 (file)
@@ -161,11 +161,14 @@ gdb_test_multiline "restricted gdb parameter" \
     "end"
 
 with_test_prefix "test-restricted-param" {
-    gdb_test "show test-restricted-param" "The value of the restricted parameter is 2."
+    gdb_test "show test-restricted-param" "The value of the restricted parameter is 2." \
+       "test-restricted-param is initially 2"
     gdb_test_no_output "set test-restricted-param 10"
-    gdb_test "show test-restricted-param" "The value of the restricted parameter is 10."
+    gdb_test "show test-restricted-param" "The value of the restricted parameter is 10." \
+       "test-restricted-param is now 10"
     gdb_test "set test-restricted-param 42" "Error: Range of parameter is 0-10."
-    gdb_test "show test-restricted-param" "The value of the restricted parameter is 2."
+    gdb_test "show test-restricted-param" "The value of the restricted parameter is 2." \
+       "test-restricted-param is back to 2 again"
 }
 
 # Test registering a parameter that already exists.
index 3e23c08eefcc0da8e478a1d718862ebcefd636ad..38fe6026a0ed949377d913d7f32cb4b2a276d81b 100644 (file)
@@ -182,7 +182,7 @@ if ![gdb_guile_runto_main] {
 }
 
 gdb_breakpoint [gdb_get_line_number "Break at end."]
-gdb_continue_to_breakpoint "Break at end."
+gdb_continue_to_breakpoint "Break at end again"
 gdb_scm_test_silent_cmd "guile (define a (car (lookup-symbol \"a\")))" \
     "get variable a for unload"
 gdb_test "guile (print (symbol-valid? a))" \
index 517c99f8369d69b6b8b7304f665f8b4489208fdc..ccde98ca224a9ae7cd659ab4fbaeecb188a0a6f4 100644 (file)
@@ -55,7 +55,7 @@ proc restart_gdb {exefile} {
        return 0
     }
     gdb_scm_test_silent_cmd "guile (use-modules (gdb iterator))" \
-       "load iterator module"
+       "load iterator module" 0
 
     return 1
 }
@@ -176,9 +176,9 @@ proc test_equality {lang} {
        gdb_test "guile (print (eq? (value-type st) (value-type ar)))" \
            "= #f" "test type eq? on not-equal types"
        gdb_test "guile (print (equal? (value-type st) (value-type st)))" \
-           "= #t" "test type eq? on equal types"
+           "= #t" "test type equal? on equal types"
        gdb_test "guile (print (equal? (value-type st) (value-type ar)))" \
-           "= #f" "test type eq? on not-equal types"
+           "= #f" "test type equal? on not-equal types"
 
        if {$lang == "c++"} {
            gdb_scm_test_silent_cmd "guile (define c (parse-and-eval \"c\"))" \
index 982b9bf17b95da1c4a0e6a8ec621b04a2aa95286..bd5b14999d8a1a3b38d2d54a0040054c35be876a 100644 (file)
@@ -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"
This page took 0.039036 seconds and 4 git commands to generate.