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.
+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
# 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
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"
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\\)"
# 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"
+}
# 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\\."
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\\."
# 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" {
# 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
# 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" \
# 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." \
"\\\[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" {
# 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"
+}
# class-wide.
gdb_test "p ident (ident (my_parameter))" \
- "= \\(one => 1, two => 2, three => 3\\)"
+ "= \\(one => 1, two => 2, three => 3\\)" "value of ident"
" 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
}
return 0
}
- gdb_test "p get (\"Hello world!\")" \
+ gdb_test "p get(\"Hello world!\")" \
"= \\(n => 12, s => \"Hello world!\"\\)"
}
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\\)"
" = \\(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"
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"
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"
"set {Integer} \$addr := 19"
gdb_test "p q" \
- "= \\(19, 3, 5, 7, 11\\)"
+ "= \\(19, 3, 5, 7, 11\\)" "modified value of q"
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\\)"
"= \\(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