From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1499) id 3CCAE3858C66; Fri, 13 Jan 2023 01:10:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CCAE3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673572243; bh=X/KO6dgIXXuuUTk94bVw+nXl5Ksv8TZNUFdjY6xRHPs=; h=From:To:Subject:Date:From; b=fF1D54O9J74OvheoqfuEd5dW9nOLFDonpqFaPUZq+3+UVUA0yRgv/v5e9ZgaiQ9eA Ug1kuf9ie7YbdmaY8T6Bz3ZcHfE3OwLLr90HVpRoefEgcU+4U8VFOA3iA2w5e0HcqR iix6RuX9PfXwBgWCdvni7P58gVjbVWlRJBqlQwqs= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Gaius Mulley To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5134] testsuite: extend timeout into all gm2 tests X-Act-Checkin: gcc X-Git-Author: Gaius Mulley X-Git-Refname: refs/heads/master X-Git-Oldrev: ecd637e9761485437498f311ddf09af5286d6d0f X-Git-Newrev: 66e97803490ef55770cee7db81eade2d05c4ea0a Message-Id: <20230113011043.3CCAE3858C66@sourceware.org> Date: Fri, 13 Jan 2023 01:10:43 +0000 (GMT) List-Id: https://gcc.gnu.org/g:66e97803490ef55770cee7db81eade2d05c4ea0a commit r13-5134-g66e97803490ef55770cee7db81eade2d05c4ea0a Author: Gaius Mulley Date: Fri Jan 13 01:08:43 2023 +0000 testsuite: extend timeout into all gm2 tests 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 Diff: --- .../pim/run/pass/coroutines-pim-run-pass.exp | 7 +++++ gcc/testsuite/gm2/link/min/pass/link-min-pass.exp | 2 +- .../pass/run/switches-whole-program-pass-run.exp | 3 ++ gcc/testsuite/lib/gm2-torture.exp | 31 +++++++++++++++++++ gcc/testsuite/lib/gm2.exp | 35 ++++++++++++++++++++++ 5 files changed, 77 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp b/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp index ec4bb0d7875..baf185f717b 100644 --- a/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp +++ b/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp @@ -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 diff --git a/gcc/testsuite/gm2/link/min/pass/link-min-pass.exp b/gcc/testsuite/gm2/link/min/pass/link-min-pass.exp index 6a6051ff787..88e4ed9434d 100644 --- a/gcc/testsuite/gm2/link/min/pass/link-min-pass.exp +++ b/gcc/testsuite/gm2/link/min/pass/link-min-pass.exp @@ -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. diff --git a/gcc/testsuite/gm2/switches/whole-program/pass/run/switches-whole-program-pass-run.exp b/gcc/testsuite/gm2/switches/whole-program/pass/run/switches-whole-program-pass-run.exp index 4622103a1b7..3058b9a3afb 100644 --- a/gcc/testsuite/gm2/switches/whole-program/pass/run/switches-whole-program-pass-run.exp +++ b/gcc/testsuite/gm2/switches/whole-program/pass/run/switches-whole-program-pass-run.exp @@ -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 diff --git a/gcc/testsuite/lib/gm2-torture.exp b/gcc/testsuite/lib/gm2-torture.exp index 1783260270f..44d9d053175 100644 --- a/gcc/testsuite/lib/gm2-torture.exp +++ b/gcc/testsuite/lib/gm2-torture.exp @@ -20,6 +20,35 @@ 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]" } diff --git a/gcc/testsuite/lib/gm2.exp b/gcc/testsuite/lib/gm2.exp index 0d8490c6849..f000eae16e5 100644 --- a/gcc/testsuite/lib/gm2.exp +++ b/gcc/testsuite/lib/gm2.exp @@ -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 #