Clean-up gdb.ada test names
authorKeith Seitz <keiths@redhat.com>
Mon, 11 May 2020 17:27:32 +0000 (10:27 -0700)
committerKeith Seitz <keiths@redhat.com>
Mon, 11 May 2020 17:28:17 +0000 (10:28 -0700)
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.

16 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/arrayparam.exp
gdb/testsuite/gdb.ada/arrayptr.exp
gdb/testsuite/gdb.ada/assign_arr.exp
gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp
gdb/testsuite/gdb.ada/bp_on_var.exp
gdb/testsuite/gdb.ada/call_pn.exp
gdb/testsuite/gdb.ada/complete.exp
gdb/testsuite/gdb.ada/fun_overload_menu.exp
gdb/testsuite/gdb.ada/funcall_param.exp
gdb/testsuite/gdb.ada/funcall_ref.exp
gdb/testsuite/gdb.ada/packed_array_assign.exp
gdb/testsuite/gdb.ada/same_component_name.exp
gdb/testsuite/gdb.ada/type_coercion.exp
gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec.exp
gdb/testsuite/gdb.ada/variant_record_packed_array.exp

index 319d3eb976c94796d1ec415a32f078e28014bb15..309602cfd734a02c63da95f5f20aa6ea855da3ac 100644 (file)
@@ -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
index 50eeaf0610f6bfbdd40db36d871e8ba387e2a605..717d36e768c2d496e553930c5b3c3177c2ca94e6 100644 (file)
@@ -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
index e13ba8db1992bd5cff1a3833dfc3f2f60b803231..ed91fe079b6e91d7db0f46eaa9eaf86dd60790f4 100644 (file)
@@ -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"
 
index d88d01234bf789a30cb80a547a05759cbc1d9ec9..75b851a391c9cd55d95974aee1f937a2f9674d1b 100644 (file)
@@ -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\\)"
index 4a54af8638dc259f6a2d2e80e5154d7fb699dc10..9e3cda808a7d647cf27588355a736fe8f85885f1 100644 (file)
@@ -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"
+}
index 9eb154f110c5e4ae956ec127eec676c26f4e0479..a28049033161bf64cf05bbcba6c7c068aeef7a04 100644 (file)
@@ -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\\."
index 1fe133fe7b59ee6a700f274cb72c6b8c161f24ba..7d07eba6b5a88f9acf25869ee3ab20584fa60a04 100644 (file)
@@ -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" {
index 35bfb98b2c42dce6b0e2913114fad7916528fa9b..f2149daefec7c2b229efd9409721033947f612ec 100644 (file)
@@ -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." \
index 2f07885383a535f2f180734010ff2a95efd3c498..47a25efae64f713fded4bac1b44d5d428e55392c 100644 (file)
@@ -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"
+}
index acf3c695f64702a8cc4faa6d683f4b713456fca6..7e621f1bdf7943fe3eef0ea6fc8edad74562c6d2 100644 (file)
@@ -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"
index e260e9086432439883df099b67fa056871c4efb2..b3dc093753acaf0d73ca33b77d799892458d3270 100644 (file)
@@ -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!\"\\)"
 }
index 67ad4bba76c59b2d40fa1491514732e50f245106..3c49099d4ac6218ddca9a400815a707c04aba6c7 100644 (file)
@@ -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"
index a7de618234b4d239e7ab00ee327b2c69dc300a38..492549d67be124ab4a172b9fd1b10fae001621a9 100644 (file)
@@ -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"
index f3fa707dde0d15310255ce45bc1c9c220ea2c366..830108cf54cd3c2c39de42223154f2a9fb0a3e58 100644 (file)
@@ -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"
index 8b84556d51299b12f539fada333c9e14f9734fa1..3d78429559c69785c67d6104aac1a91e89795c49 100644 (file)
@@ -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\\)"
index e488521c0dd46db66d244ddbf7aae2645ea627eb..0530df54d4ec4942a3ba0aecb87ef439de6c2220 100644 (file)
@@ -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
This page took 0.038626 seconds and 4 git commands to generate.