diff mbox series

[1/1] testsuite: Support test execution timeout factor as a keyword

Message ID alpine.DEB.2.20.2312111745330.5892@tpp.orcam.me.uk
State New
Headers show
Series Support per-test execution timeout factor | expand

Commit Message

Maciej W. Rozycki Dec. 12, 2023, 2:04 p.m. UTC
Add support for the `dg-test-timeout-factor' keyword letting a test
case scale the wait timeout used for code execution, analogously to
`dg-timeout-factor' used for code compilation.  This is useful for
particularly slow test cases for which increasing the wait timeout
globally would be excessive.

	gcc/testsuite/
	* lib/timeout-dg.exp (dg-test-timeout-factor): New procedure.
---
 gcc/testsuite/lib/timeout-dg.exp |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

gcc-test-test-timeout-factor.diff

Comments

Jeff Law Dec. 12, 2023, 11:03 p.m. UTC | #1
On 12/12/23 07:04, Maciej W. Rozycki wrote:
> Add support for the `dg-test-timeout-factor' keyword letting a test
> case scale the wait timeout used for code execution, analogously to
> `dg-timeout-factor' used for code compilation.  This is useful for
> particularly slow test cases for which increasing the wait timeout
> globally would be excessive.
> 
> 	gcc/testsuite/
> 	* lib/timeout-dg.exp (dg-test-timeout-factor): New procedure.
OK
jeff
diff mbox series

Patch

Index: gcc/gcc/testsuite/lib/timeout-dg.exp
===================================================================
--- gcc.orig/gcc/testsuite/lib/timeout-dg.exp
+++ gcc/gcc/testsuite/lib/timeout-dg.exp
@@ -47,3 +47,20 @@  proc dg-timeout-factor { args } {
 	set timeout_factor [lindex $args 0]
     }
 }
+
+#
+# dg-test-timeout-factor -- Scale the test execution timeout limit
+#
+
+proc dg-test-timeout-factor { args } {
+    global test_timeout_factor
+
+    set args [lreplace $args 0 0]
+    if { [llength $args] > 1 } {
+	if { [dg-process-target [lindex $args 1]] == "S" } {
+	    set test_timeout_factor [lindex $args 0]
+	}
+    } else {
+	set test_timeout_factor [lindex $args 0]
+    }
+}