Patchwork [gdb/testsuite] Ignore pass/fail/unsupported in gdb-caching-proc.exp

login
register
mail settings
Submitter Tom de Vries
Date Feb. 13, 2020, 10:57 a.m.
Message ID <20200213105754.GA22520@delia>
Download mbox | patch
Permalink /patch/38025/
State New
Headers show

Comments

Tom de Vries - Feb. 13, 2020, 10:57 a.m.
Hi,

After de-installing gnatmake, I get:
...
Running src/gdb/testsuite/gdb.base/gdb-caching-proc.exp ...
FAIL: gdb-caching-proc.exp: failed to compile gnat-debug-info test binary
  ...
FAIL: gdb-caching-proc.exp: failed to compile gnat-debug-info test binary
...

In gdb.sum, we see these FAILs (each paired with an UNSUPPORTED as well)
followed by:
...
PASS: gdb-caching-proc.exp: gnat_runtime_has_debug_info consistency
...

Fix this by ignoring PASS/FAIL/UNSUPPORTED during testing, such that we have
just the consistency PASS/FAIL.

Tested on x86_64-linux, with gnatmake installed and de-installed.

OK for trunk?

Thanks,
- Tom

[gdb/testsuite] Ignore pass/fail/unsupported in gdb-caching-proc.exp

gdb/testsuite/ChangeLog:

2020-02-13  Tom de Vries  <tdevries@suse.de>

	* gdb.base/gdb-caching-proc.exp (ignore_pass, ignore_fail)
	(ignore_unsupported): New proc.
	(test_proc): Temporarily rename pass/fail/ignore to
	ignore_{pass,fail,ignore} in order to ignore PASS/FAIL/IGNORE messages
	from the tested procs.

---
 gdb/testsuite/gdb.base/gdb-caching-proc.exp | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
Tom Tromey - Feb. 13, 2020, 2:32 p.m.
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> 2020-02-13  Tom de Vries  <tdevries@suse.de>

Tom> 	* gdb.base/gdb-caching-proc.exp (ignore_pass, ignore_fail)
Tom> 	(ignore_unsupported): New proc.
Tom> 	(test_proc): Temporarily rename pass/fail/ignore to
Tom> 	ignore_{pass,fail,ignore} in order to ignore PASS/FAIL/IGNORE messages
Tom> 	from the tested procs.

Can we just require that caching proc bodies not invoke tests?

Tom> +    rename pass save_pass
Tom> +    rename fail save_fail
Tom> +    rename unsupported save_unsupported
Tom> +    rename ignore_pass pass
Tom> +    rename ignore_fail fail
Tom> +    rename ignore_unsupported unsupported

In this situation perhaps it's best to catch any errors in the body, so
that the code to rename things back will always be run.

Then it could re-throw the error if needed at the end.

Tom
Tom de Vries - Feb. 13, 2020, 3:02 p.m.
On 13-02-2020 15:32, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> 2020-02-13  Tom de Vries  <tdevries@suse.de>
> 
> Tom> 	* gdb.base/gdb-caching-proc.exp (ignore_pass, ignore_fail)
> Tom> 	(ignore_unsupported): New proc.
> Tom> 	(test_proc): Temporarily rename pass/fail/ignore to
> Tom> 	ignore_{pass,fail,ignore} in order to ignore PASS/FAIL/IGNORE messages
> Tom> 	from the tested procs.
> 
> Can we just require that caching proc bodies not invoke tests?
> 

We could, I don't have preference one way or the other.

If I remove all the fail calls from gnat_runtime_has_debug_info, we
still get these PASSes from gdb_compile_ada:
...
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: compilation gnat_debug_info_test.adb
PASS: gdb.base/gdb-caching-proc.exp: gnat_runtime_has_debug_info consistency
...

But we can factor that out, I've already done that once here (
https://sourceware.org/ml/gdb-patches/2019-10/msg01109.html ).

Simon, WDYT?

Thanks,
- Tom

Patch

diff --git a/gdb/testsuite/gdb.base/gdb-caching-proc.exp b/gdb/testsuite/gdb.base/gdb-caching-proc.exp
index b2d71a5e7d..536d7e89c1 100644
--- a/gdb/testsuite/gdb.base/gdb-caching-proc.exp
+++ b/gdb/testsuite/gdb.base/gdb-caching-proc.exp
@@ -22,12 +22,29 @@ 
 # number of reruns is constant-bounded, and the increase in runtime is bound to
 # this test-case, and could be disabled on slow targets.
 
+proc ignore_pass { args } {
+
+}
+proc ignore_fail { args } {
+
+}
+proc ignore_unsupported { args } {
+
+}
+
 # Test gdb_caching_proc NAME
 proc test_proc { name } {
     set real_name gdb_real__$name
 
     set resultlist [list]
 
+    rename pass save_pass
+    rename fail save_fail
+    rename unsupported save_unsupported
+    rename ignore_pass pass
+    rename ignore_fail fail
+    rename ignore_unsupported unsupported
+
     set first [$real_name]
     lappend resultlist $first
 
@@ -44,6 +61,13 @@  proc test_proc { name } {
 	}
     }
 
+    rename pass ignore_pass
+    rename fail ignore_fail
+    rename unsupported ignore_unsupported
+    rename save_pass pass
+    rename save_fail fail
+    rename save_unsupported unsupported
+
     if { $racy  == 0 } {
 	pass "$name consistency"
     } else {