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.
This commit is contained in:
Andrew Burgess
2021-05-13 16:56:03 +01:00
parent 5c6f801d8e
commit 62f2f198cd
6 changed files with 65 additions and 41 deletions

View 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

View 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"
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 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 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"
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"
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 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 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"
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"
}

View 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.

View 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))" \

View 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\"))" \

View 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"