]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
testsuite: extend timeout into all gm2 tests
authorGaius Mulley <gaiusmod2@gmail.com>
Fri, 13 Jan 2023 01:08:43 +0000 (01:08 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Fri, 13 Jan 2023 01:08:43 +0000 (01:08 +0000)
Add timeout capability to gm2-torture.exp.  Also add a simple
gm2_push_timeout/gm2_pop timeout facility and calibrate all
tests to use the default of 10 seconds.  15 seconds (for the
coroutine tests) and 60 seconds for whole program optimization.

gcc/testsuite/ChangeLog:

* gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp
(timeout-dg.exp): Load.
Call gm2_push_timeout 15.
Call gm2_pop_timeout at the end.
* gm2/link/min/pass/link-min-pass.exp: Set path
argument to "".
* gm2/switches/whole-program/pass/run/switches-whole-program-pass-run.exp:
Call gm2_push_timeout 60.
Call gm2_pop_timeout at the end.
* lib/gm2-torture.exp (gm2_previous_timeout): Set to 10 or
individual_timeout.
Configure dejagnu to timeout for 10 seconds.
(gm2_push_timeout): New proc.
(gm2_pop_timeout): New proc.
* lib/gm2.exp (gm2_previous_timeout): Set to 10 or
individual_timeout.
Configure dejagnu to timeout for 10 seconds.
(gm2_push_timeout): New proc.
(gm2_pop_timeout): New proc.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp
gcc/testsuite/gm2/link/min/pass/link-min-pass.exp
gcc/testsuite/gm2/switches/whole-program/pass/run/switches-whole-program-pass-run.exp
gcc/testsuite/lib/gm2-torture.exp
gcc/testsuite/lib/gm2.exp

index ec4bb0d78753de908c09569150df91d5dc1da9f6..baf185f717b33b4dc77fb9f7d80eddca7d1d6059 100644 (file)
@@ -24,11 +24,16 @@ if $tracelevel then {
 
 # load support procs
 load_lib gm2-torture.exp
+load_lib timeout-dg.exp
 
 set gm2src ${srcdir}/../gm2
 
 gm2_init_cor
 
+# We should be able to compile, link or run in 15 seconds.
+gm2_push_timeout 15
+
+
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
     # If we're only testing specific files and this isn't one of them, skip it.
     if ![runtest_file_p $runtests $testcase] then {
@@ -37,3 +42,5 @@ foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
 
     gm2-torture-execute $testcase "" "pass"
 }
+
+gm2_pop_timeout
index 6a6051ff7876bd171c4b84c660aed0156c011d1c..88e4ed9434d6ddeacd9d3e9f01427a93f0247299 100644 (file)
@@ -25,7 +25,7 @@ if $tracelevel then {
 # load support procs
 load_lib gm2-torture.exp
 
-gm2_init_min "${srcdir}/gm2/min/pass"
+gm2_init_min ""
 
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
     # If we're only testing specific files and this isn't one of them, skip it.
index 4622103a1b79431cab22eb8aaefa750b03d70c6a..3058b9a3afb430acc8cbb57ed6d5f0f396042c10 100644 (file)
@@ -25,6 +25,7 @@ if $tracelevel then {
 load_lib gm2-torture.exp
 
 gm2_init_pim "${srcdir}/gm2/switches/whole-program/run/pass" -fm2-whole-program
+gm2_push_timeout 60
 
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
     # If we're only testing specific files and this isn't one of them, skip it.
@@ -34,3 +35,5 @@ foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
     gm2_target_compile $srcdir/$subdir/mystrlib.mod mystrlib.o object "-g -O3 -I$srcdir/$subdir/"
     gm2-torture $testcase
 }
+
+gm2_pop_timeout
index 1783260270f945f642cdeb6aedd2918c3d6dc40f..44d9d053175545e78878e16a7275fb560ef32a62 100644 (file)
 
 load_lib file-format.exp
 load_lib target-libpath.exp
+load_lib timeout.exp
+load_lib timeout-dg.exp
+
+
+if {[info exists individual_timeout]} {
+    set gm2_previous_timeout $individual_timeout
+} else {
+    set gm2_previous_timeout 10
+}
+
+
+# We should be able to complete any test in 10 seconds.
+dg-timeout S 10
+
+
+# only push one level.
+
+proc gm2_push_timeout { secs } {
+    global individual_timeout
+    set individual_timeout $secs
+}
+
+
+proc gm2_pop_timeout { } {
+    global individual_timeout
+    global gm2_previous_timeout
+    set individual_timeout $gm2_previous_timeout
+}
+
 
 # The default option list can be overridden by
 # TORTURE_OPTIONS="{ { list1 } ... { listN } }"
@@ -272,6 +301,7 @@ proc gm2-torture-execute { sources args success } {
 
        set options ""
        lappend options "additional_flags=$option"
+       lappend options "timeout=[timeout_value]"
        if { $additional_flags != "" } {
            lappend options "additional_flags=$additional_flags"
        }
@@ -290,6 +320,7 @@ proc gm2-torture-execute { sources args success } {
        # now link the test
        set options ${option};
 
+       lappend options "timeout=[timeout_value]"
        if { [llength ${args}] > 0 } {
            lappend options "additional_flags=[lindex ${args} 0]"
        }
index 0d8490c68491256dbd0ffe12ae826b63df21838d..f000eae16e546c128c86d0132234cf9b0da7d291 100644 (file)
@@ -23,6 +23,36 @@ load_lib prune.exp
 load_lib gcc-defs.exp
 load_lib target-libpath.exp
 load_lib timeout.exp
+load_lib timeout-dg.exp
+
+
+if {[info exists individual_timeout]} {
+    set gm2_previous_timeout $individual_timeout
+} else {
+    set gm2_previous_timeout 10
+}
+
+
+# set gm2_previous_timeout $individual_timeout
+
+# We should be able to complete any test in 10 seconds.
+dg-timeout S 10
+
+
+# only push one level.
+
+proc gm2_push_timeout { secs } {
+    global individual_timeout
+    set individual_timeout $secs
+}
+
+
+proc gm2_pop_timeout { } {
+    global individual_timeout
+    global gm2_previous_timeout
+    set individual_timeout $gm2_previous_timeout
+}
+
 
 #
 # GCC_UNDER_TEST is the compiler under test.
@@ -137,8 +167,13 @@ proc gm2_init { args } {
 
     set gm2_link_path "[gm2_link_flags [get_multilibs]]";
     verbose $gm2_link_path 1
+
+    # Set the default timeout value, larger tests can override
+    # this if necessary.
+    dg-timeout S 10
 }
 
+
 #
 # gm2_target_compile_default -- compile a source file
 #