summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2020-05-11 10:27:32 -0700
committerKeith Seitz <keiths@redhat.com>2020-05-11 10:28:17 -0700
commitba3e70b008d63b13207339443ad3b9a61ab996bc (patch)
tree7cd0b0e92566f00d218613e5cb6d824b9e8a8845
parent7666722fce2a26a32d9d931e9ce0fea8a7209185 (diff)
downloadbinutils-gdb-ba3e70b008d63b13207339443ad3b9a61ab996bc.tar.gz
Clean-up gdb.ada test names
This patch fixes all duplicate and tail parentheses test names. These can really hinder automated test analysis such as used by the buildbot. Before: $ cat testsuite/gdb.sum | egrep "^(PASS|FAIL|XPASS|XFAIL|KPASS|KFAIL)" \ | sort | uniq -c | sort -n | grep -v " 1 " 2 PASS: gdb.ada/attr_ref_and_charlit.exp: print s'last 2 PASS: gdb.ada/bp_on_var.exp: set breakpoint pending off 2 PASS: gdb.ada/complete.exp: complete p pck.inne 2 PASS: gdb.ada/fun_overload_menu.exp: multiple matches for f (f (1, null)) 2 PASS: gdb.ada/type_coercion.exp: p q 2 PASS: gdb.ada/unc_arr_ptr_in_var_rec.exp: print My_P_Object.Ptr when no longer null 3 PASS: gdb.ada/fun_overload_menu.exp: 1 After: <empty> For parentheses, I've audited all occurrences of trailing parentheses. Most offenders are of the form: gdb_test "p func (..)" $expected_result I've either added a unique test name or simply removed the whitespace between the function name and the argument list. gdb/testsuite/ChangeLog 2020-05-11 Keith Seitz <keiths@redhat.com> * gdb.ada/arrayparam.exp: Resolve duplicate and tail parentheses test names. * gdb.ada/arrayptr.exp: Likewise. * gdb.ada/assign_arr.exp: Likewise. * gdb.ada/attr_ref_and_charlit.exp: Likewise. * gdb.ada/bp_on_var.exp: Likewise. * gdb.ada/call_pn.exp: Likewise. * gdb.ada/complete.exp: Likewise. * gdb.ada/fun_overload_menu.exp: Likewise. * gdb.ada/funcall_param.exp: Likewise. * gdb.ada/funcall_ref.exp: Likewise. * gdb.ada/packed_array_assign.exp: Likewise. * gdb.ada/same_component_name.exp: Likewise. * gdb.ada/type_coercion.exp: Likewise. * gdb.ada/unc_arr_ptr_in_var_rec.exp: Likewise. * gdb.ada/variant_record_packed_array.exp: Likewise.
-rw-r--r--gdb/testsuite/ChangeLog19
-rw-r--r--gdb/testsuite/gdb.ada/arrayparam.exp2
-rw-r--r--gdb/testsuite/gdb.ada/arrayptr.exp6
-rw-r--r--gdb/testsuite/gdb.ada/assign_arr.exp2
-rw-r--r--gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp23
-rw-r--r--gdb/testsuite/gdb.ada/bp_on_var.exp5
-rw-r--r--gdb/testsuite/gdb.ada/call_pn.exp2
-rw-r--r--gdb/testsuite/gdb.ada/complete.exp14
-rw-r--r--gdb/testsuite/gdb.ada/fun_overload_menu.exp38
-rw-r--r--gdb/testsuite/gdb.ada/funcall_param.exp2
-rw-r--r--gdb/testsuite/gdb.ada/funcall_ref.exp4
-rw-r--r--gdb/testsuite/gdb.ada/packed_array_assign.exp6
-rw-r--r--gdb/testsuite/gdb.ada/same_component_name.exp2
-rw-r--r--gdb/testsuite/gdb.ada/type_coercion.exp4
-rw-r--r--gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp2
-rw-r--r--gdb/testsuite/gdb.ada/variant_record_packed_array.exp2
16 files changed, 86 insertions, 47 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 319d3eb976c..309602cfd73 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,22 @@
+2020-05-11 Keith Seitz <keiths@redhat.com>
+
+ * gdb.ada/arrayparam.exp: Resolve duplicate and tail parentheses
+ test names.
+ * gdb.ada/arrayptr.exp: Likewise.
+ * gdb.ada/assign_arr.exp: Likewise.
+ * gdb.ada/attr_ref_and_charlit.exp: Likewise.
+ * gdb.ada/bp_on_var.exp: Likewise.
+ * gdb.ada/call_pn.exp: Likewise.
+ * gdb.ada/complete.exp: Likewise.
+ * gdb.ada/fun_overload_menu.exp: Likewise.
+ * gdb.ada/funcall_param.exp: Likewise.
+ * gdb.ada/funcall_ref.exp: Likewise.
+ * gdb.ada/packed_array_assign.exp: Likewise.
+ * gdb.ada/same_component_name.exp: Likewise.
+ * gdb.ada/type_coercion.exp: Likewise.
+ * gdb.ada/unc_arr_ptr_in_var_rec.exp: Likewise.
+ * gdb.ada/variant_record_packed_array.exp: Likewise.
+
2020-05-11 Tom de Vries <tdevries@suse.de>
PR symtab/25941
diff --git a/gdb/testsuite/gdb.ada/arrayparam.exp b/gdb/testsuite/gdb.ada/arrayparam.exp
index 50eeaf0610f..717d36e768c 100644
--- a/gdb/testsuite/gdb.ada/arrayparam.exp
+++ b/gdb/testsuite/gdb.ada/arrayparam.exp
@@ -29,7 +29,7 @@ runto "foo.adb:$bp_location"
# Verify that a call to a function that takes an array as a parameter
# works without problem.
-gdb_test "print call_me (\"bonjour\")" \
+gdb_test "print call_me(\"bonjour\")" \
"= void"
# Verify that the array was passed properly by checking the global
diff --git a/gdb/testsuite/gdb.ada/arrayptr.exp b/gdb/testsuite/gdb.ada/arrayptr.exp
index e13ba8db199..ed91fe079b6 100644
--- a/gdb/testsuite/gdb.ada/arrayptr.exp
+++ b/gdb/testsuite/gdb.ada/arrayptr.exp
@@ -32,15 +32,15 @@ if ![runto "foo.adb:$bp_location" ] then {
gdb_test "print string_p" \
"= \\(foo\\.string_access\\) 0x\[0-9a-zA-Z\]+"
-gdb_test "print string_p (3..4)" "= \"ll\""
+gdb_test "print string_p(3..4)" "= \"ll\""
gdb_test "print null_string" "= \\(foo\\.string_access\\) 0x0"
gdb_test "print arr_ptr" "= \\(access foo\\.little_array\\) 0x\[0-9a-zA-Z\]+"
-gdb_test "print arr_ptr (2)" "= 22"
+gdb_test "print arr_ptr(2)" "= 22"
-gdb_test "print arr_ptr (3..4)" "= \\(3 => 23, 24\\)"
+gdb_test "print arr_ptr(3..4)" "= \\(3 => 23, 24\\)"
gdb_test "ptype string_access" "= access array \\(<>\\) of character"
diff --git a/gdb/testsuite/gdb.ada/assign_arr.exp b/gdb/testsuite/gdb.ada/assign_arr.exp
index d88d01234bf..75b851a391c 100644
--- a/gdb/testsuite/gdb.ada/assign_arr.exp
+++ b/gdb/testsuite/gdb.ada/assign_arr.exp
@@ -26,5 +26,5 @@ clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/main_p324_051.adb]
runto "main_p324_051.adb:$bp_location"
-gdb_test "print assign_arr_input.u2 := (0.25,0.5,0.75)" \
+gdb_test "print assign_arr_input.u2 :=(0.25,0.5,0.75)" \
" = \\(0\\.25, 0\\.5, 0\\.75\\)"
diff --git a/gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp b/gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp
index 4a54af8638d..9e3cda808a7 100644
--- a/gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp
+++ b/gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp
@@ -29,14 +29,19 @@ set bp_location [gdb_get_line_number "BREAK" "${testdir}/foo.adb"]
# work as expected. They used to yield syntax error.
runto "foo.adb:$bp_location"
-gdb_test "print s'first" " = 2"
-gdb_test "print s'last" " = 3"
-gdb_test "print s(s'first) = 'a'" " = true"
-gdb_test "print s(s'last) /= 'b'" " = false"
+with_test_prefix "run" {
+ gdb_test "print s'first" " = 2"
+ gdb_test "print s'last" " = 3Z
+ gdb_test "print s(s'first) = 'a'" " = true"
+ gdb_test "print s(s'last) /= 'b'" " = false"
+}
gdb_test "continue" \
- ".*Breakpoint \[0-9\]+, foo\\.p \\(s=.*\\) at .*foo.adb:\[0-9\]+.*" \
-gdb_test "print s'first" " = 4"
-gdb_test "print s'last" " = 5"
-gdb_test "print s(s'first) = 'c'" " = true"
-gdb_test "print s(s'last) /= 'd'" " = false"
+ ".*Breakpoint \[0-9\]+, foo\\.p \\(s=.*\\) at .*foo.adb:\[0-9\]+.*"
+
+with_test_prefix "cont" {
+ gdb_test "print s'first" " = 4"
+ gdb_test "print s'last" " = 5"
+ gdb_test "print s(s'first) = 'c'" " = true"
+ gdb_test "print s(s'last) /= 'd'" " = false"
+}
diff --git a/gdb/testsuite/gdb.ada/bp_on_var.exp b/gdb/testsuite/gdb.ada/bp_on_var.exp
index 9eb154f110c..a2804903316 100644
--- a/gdb/testsuite/gdb.ada/bp_on_var.exp
+++ b/gdb/testsuite/gdb.ada/bp_on_var.exp
@@ -28,7 +28,7 @@ clean_restart ${testfile}
# We are going to insert breakpoints using locations that are invalid.
# Set "breakpoint pending" to "off" in order to avoid having to deal
# with GDB asking whether to insert a pending breakpoint or not.
-gdb_test_no_output "set breakpoint pending off"
+gdb_test_no_output "set breakpoint pending off" "disable pending breakpoints"
gdb_test "break pck.my_global_variable" \
"Function \"pck\\.my_global_variable\" not defined\\."
@@ -38,7 +38,8 @@ gdb_test "break pck.my_global_variable" \
clean_restart ${testfile}
-gdb_test_no_output "set breakpoint pending off"
+gdb_test_no_output "set breakpoint pending off" \
+ "disable pending breakpoints after restart"
gdb_test "break pck.my_hidden_variable" \
"Function \"pck\\.my_hidden_variable\" not defined\\."
diff --git a/gdb/testsuite/gdb.ada/call_pn.exp b/gdb/testsuite/gdb.ada/call_pn.exp
index 1fe133fe7b5..7d07eba6b5a 100644
--- a/gdb/testsuite/gdb.ada/call_pn.exp
+++ b/gdb/testsuite/gdb.ada/call_pn.exp
@@ -68,7 +68,7 @@ gdb_test_multiple "print last_node_id" "print last_node_id before calling pn" {
# Now, call procedure Pn, which should set Last_Node_Id to the value
# of the parameter used in the function call. Verify that we can print
# the returned value correctly, while we're at it.
-gdb_test "print pn (4321)" "= 4321"
+gdb_test "print pn(4321)" "= 4321"
# Make sure that last_node_id now has the correct value...
gdb_test_multiple "print last_node_id" "print last_node_id after calling pn" {
diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp
index 35bfb98b2c4..f2149daefec 100644
--- a/gdb/testsuite/gdb.ada/complete.exp
+++ b/gdb/testsuite/gdb.ada/complete.exp
@@ -31,9 +31,13 @@ set eol "\[\r\n\]*"
# A convenience function that verifies that the "complete EXPR" command
# returns the EXPECTED_OUTPUT.
-proc test_gdb_complete { expr expected_output } {
+proc test_gdb_complete { expr expected_output {msg ""} } {
+ set cmd "complete p $expr"
+ if {$msg == ""} {
+ set msg $cmd
+ }
gdb_test "complete p $expr" \
- "$expected_output"
+ "$expected_output" $msg
}
# A convenience function that verifies that the "complete EXPR" command
@@ -60,7 +64,8 @@ test_gdb_no_completion "inner.insi"
# An incomplete nested package name, were lies a single symbol:
test_gdb_complete "pck.inne" \
- "p pck.inner.inside_variable"
+ "p pck.inner.inside_variable" \
+ "complete nested package name"
# A fully qualified symbol name, mangled...
test_gdb_complete "pck__inner__ins" \
@@ -118,7 +123,8 @@ test_gdb_complete "pck.my" \
# A fully qualified package name
test_gdb_complete "pck.inne" \
- "p pck.inner.inside_variable"
+ "p pck.inner.inside_variable" \
+ "complete fully qualified package name"
# A fully qualified package name, with a dot at the end
test_gdb_complete "pck.inner." \
diff --git a/gdb/testsuite/gdb.ada/fun_overload_menu.exp b/gdb/testsuite/gdb.ada/fun_overload_menu.exp
index 2f07885383a..47a25efae64 100644
--- a/gdb/testsuite/gdb.ada/fun_overload_menu.exp
+++ b/gdb/testsuite/gdb.ada/fun_overload_menu.exp
@@ -32,7 +32,7 @@ proc test_menu {expr function menu_entries selection output} {
"\\\[0\\\] cancel" \
"$menu_entries" \
"> $"]
- set test_name "multiple matches for $function ($expr)"
+ set test_name "multiple matches for $function {$expr}"
gdb_test_multiple "print $expr" "$test_name" \
{
-re "$menu" {
@@ -49,23 +49,29 @@ proc test_menu {expr function menu_entries selection output} {
# Check that function signatures in overload menus are displayed as expected.
# 1. Test with overloaded functions
-test_menu "f (1, null)" "f" \
- [multi_line \
- "\\\[1\\\] foo\.f \\(integer; foo\.integer_access\\) return boolean at .*foo.adb:.*" \
- "\\\[2\\\] foo\.f \\(foo\.new_integer; foo\.integer_access\\) return boolean at .*foo.adb:.*"] \
- "1" "= true"
+with_test_prefix "func" {
+ test_menu "f (1, null)" "f" \
+ [multi_line \
+ "\\\[1\\\] foo\.f \\(integer; foo\.integer_access\\) return boolean at .*foo.adb:.*" \
+ "\\\[2\\\] foo\.f \\(foo\.new_integer; foo\.integer_access\\) return boolean at .*foo.adb:.*"] \
+ "1" "= true"
+}
# 2. Test with overloaded procedures
-test_menu "p (1, null)" "p" \
- [multi_line \
- "\\\[1\\\] foo\.p \\(integer; foo\.integer_access\\) at .*foo.adb:.*" \
- "\\\[2\\\] foo\.p \\(foo\.new_integer; foo\.integer_access\\) at .*foo.adb:.*" ] \
- "1" "= (void)"
+with_test_prefix "proc" {
+ test_menu "p (1, null)" "p" \
+ [multi_line \
+ "\\\[1\\\] foo\.p \\(integer; foo\.integer_access\\) at .*foo.adb:.*" \
+ "\\\[2\\\] foo\.p \\(foo\.new_integer; foo\.integer_access\\) at .*foo.adb:.*" ] \
+ "1" "= (void)"
+}
# 3. Test with signatures disabled
gdb_test "set ada print-signatures off" ""
-test_menu "f (1, null)" "f" \
- [multi_line \
- "\\\[1\\\] foo\.f at .*foo.adb:.*" \
- "\\\[2\\\] foo\.f at .*foo.adb:.*"] \
- "1" "= true"
+with_test_prefix "signatures disabled" {
+ test_menu "f (1, null)" "f" \
+ [multi_line \
+ "\\\[1\\\] foo\.f at .*foo.adb:.*" \
+ "\\\[2\\\] foo\.f at .*foo.adb:.*"] \
+ "1" "= true"
+}
diff --git a/gdb/testsuite/gdb.ada/funcall_param.exp b/gdb/testsuite/gdb.ada/funcall_param.exp
index acf3c695f64..7e621f1bdf7 100644
--- a/gdb/testsuite/gdb.ada/funcall_param.exp
+++ b/gdb/testsuite/gdb.ada/funcall_param.exp
@@ -30,4 +30,4 @@ runto "foo.adb:$bp_location"
# class-wide.
gdb_test "p ident (ident (my_parameter))" \
- "= \\(one => 1, two => 2, three => 3\\)"
+ "= \\(one => 1, two => 2, three => 3\\)" "value of ident"
diff --git a/gdb/testsuite/gdb.ada/funcall_ref.exp b/gdb/testsuite/gdb.ada/funcall_ref.exp
index e260e908643..b3dc093753a 100644
--- a/gdb/testsuite/gdb.ada/funcall_ref.exp
+++ b/gdb/testsuite/gdb.ada/funcall_ref.exp
@@ -61,7 +61,7 @@ foreach_with_prefix scenario {all minimal} {
" s: access array \\(1 \\.\\. n\\) of character;" \
"end record"]
set supported 1
- gdb_test_multiple "ptype get (\"Hello world!\")" "" {
+ gdb_test_multiple "ptype get(\"Hello world!\")" "" {
-re -wrap $pass_re {
pass $gdb_test_name
}
@@ -82,6 +82,6 @@ foreach_with_prefix scenario {all minimal} {
return 0
}
- gdb_test "p get (\"Hello world!\")" \
+ gdb_test "p get(\"Hello world!\")" \
"= \\(n => 12, s => \"Hello world!\"\\)"
}
diff --git a/gdb/testsuite/gdb.ada/packed_array_assign.exp b/gdb/testsuite/gdb.ada/packed_array_assign.exp
index 67ad4bba76c..3c49099d4ac 100644
--- a/gdb/testsuite/gdb.ada/packed_array_assign.exp
+++ b/gdb/testsuite/gdb.ada/packed_array_assign.exp
@@ -27,7 +27,8 @@ runto "aggregates.run_test"
gdb_test \
"print pra := ((packed_array_assign_x => 2, packed_array_assign_y => 0, packed_array_assign_w => 17), pr, (packed_array_assign_x => 7, packed_array_assign_y => 1, packed_array_assign_w => 23))" \
- " = \\(\\(packed_array_assign_w => 17, packed_array_assign_x => 2, packed_array_assign_y => 0\\), \\(packed_array_assign_w => 104, packed_array_assign_x => 2, packed_array_assign_y => 3\\), \\(packed_array_assign_w => 23, packed_array_assign_x => 7, packed_array_assign_y => 1\\)\\)"
+ " = \\(\\(packed_array_assign_w => 17, packed_array_assign_x => 2, packed_array_assign_y => 0\\), \\(packed_array_assign_w => 104, packed_array_assign_x => 2, packed_array_assign_y => 3\\), \\(packed_array_assign_w => 23, packed_array_assign_x => 7, packed_array_assign_y => 1\\)\\)" \
+ "value of pra"
gdb_test "print pra(1) := pr" \
" = \\(packed_array_assign_w => 104, packed_array_assign_x => 2, packed_array_assign_y => 3\\)"
@@ -35,4 +36,5 @@ gdb_test "print pra(1)" \
" = \\(packed_array_assign_w => 104, packed_array_assign_x => 2, packed_array_assign_y => 3\\)"
gdb_test "print npr := (q000 => 3, r000 => (packed_array_assign_x => 6, packed_array_assign_y => 1, packed_array_assign_w => 117))" \
- " = \\(q000 => 3, r000 => \\(packed_array_assign_w => 117, packed_array_assign_x => 6, packed_array_assign_y => 1\\)\\)"
+ " = \\(q000 => 3, r000 => \\(packed_array_assign_w => 117, packed_array_assign_x => 6, packed_array_assign_y => 1\\)\\)" \
+ "value of npr"
diff --git a/gdb/testsuite/gdb.ada/same_component_name.exp b/gdb/testsuite/gdb.ada/same_component_name.exp
index a7de618234b..492549d67be 100644
--- a/gdb/testsuite/gdb.ada/same_component_name.exp
+++ b/gdb/testsuite/gdb.ada/same_component_name.exp
@@ -56,7 +56,7 @@ gdb_test "print obj.a" " = 48" \
gdb_test "continue" \
".*Breakpoint $decimal, pck.assign \\(.*\\).*" \
- "continue to bottom assign breakpoint (2nd time)"
+ "continue to bottom assign breakpoint, 2nd time"
gdb_test "print obj.x" " = 6" \
"Print field existing only in bottom component"
diff --git a/gdb/testsuite/gdb.ada/type_coercion.exp b/gdb/testsuite/gdb.ada/type_coercion.exp
index f3fa707dde0..830108cf54c 100644
--- a/gdb/testsuite/gdb.ada/type_coercion.exp
+++ b/gdb/testsuite/gdb.ada/type_coercion.exp
@@ -27,7 +27,7 @@ set bp_location [gdb_get_line_number "START" ${testdir}/assign.adb]
runto "assign.adb:$bp_location"
gdb_test "p q" \
- "= \\(2, 3, 5, 7, 11\\)"
+ "= \\(2, 3, 5, 7, 11\\)" "initial value of q"
gdb_test_no_output "set \$addr := q'address" \
"save q'address in convenience variable"
@@ -42,4 +42,4 @@ gdb_test_no_output "set {Integer} \$addr := 19" \
"set {Integer} \$addr := 19"
gdb_test "p q" \
- "= \\(19, 3, 5, 7, 11\\)"
+ "= \\(19, 3, 5, 7, 11\\)" "modified value of q"
diff --git a/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp b/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp
index 8b84556d512..3d78429559c 100644
--- a/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp
+++ b/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp
@@ -64,7 +64,7 @@ gdb_test "print my_object" \
gdb_test "print my_object.ptr" \
"\\(foo.table_access\\) $hex" \
- "print My_P_Object.Ptr when no longer null"
+ "print my_object.ptr when no longer null"
gdb_test "print my_object.ptr.all" \
"= \\(13, 21, 34\\)"
diff --git a/gdb/testsuite/gdb.ada/variant_record_packed_array.exp b/gdb/testsuite/gdb.ada/variant_record_packed_array.exp
index e488521c0dd..0530df54d4e 100644
--- a/gdb/testsuite/gdb.ada/variant_record_packed_array.exp
+++ b/gdb/testsuite/gdb.ada/variant_record_packed_array.exp
@@ -40,7 +40,7 @@ gdb_test "print my_buffer'Address" \
"= \\(system\\.address\\) $hex" \
"print address"
-set test "print {foo.octal_buffer} ($)"
+set test "print {foo.octal_buffer}($)"
gdb_test_multiple "$test" $test {
-re "= \\(size => 8, buffer => \\(1, 2, 3, 4, 5, 6, 7, 0\\), length => 8\\)\[\r\n\]+$gdb_prompt $" {
pass $test