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

"Maciej W. Rozycki" <[email protected]> Tue, 12 Dec 2023 14:04:51 +0000 (GMT)
Newsgroups gmane.comp.gcc.patches,gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
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
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]
+    }
+}