This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Disabling Secondary Tests
- From: Janis Johnson <janisjo at codesourcery dot com>
- To: Lawrence Crowl <crowl at google dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 06 Jun 2011 09:22:06 -0700
- Subject: Re: Disabling Secondary Tests
- References: <BANLkTintWA+K-JpQNuVRMQAyKz8Z8xF1-g@mail.gmail.com>
On 06/03/2011 11:14 AM, Lawrence Crowl wrote:
> The PPH project has tests that compile two different ways, and
> then compare the assembly. If either of the compiles fails, the
> comparison will fail. We'd like to simply not run the comparison.
>
> We currently have:
>
> set have_errs [llength [grep $test "{\[ \t\]\+dg-error\[\t\]\+.*\[ \t\]\+}"]]
> # Compile the file the first time for a base case.
> dg-test -keep-output $test "$options -I." ""
>
> if { $have_errs } {
> verbose -log "regular compilation failed"
> fail "$nshort $options, regular compilation failed"
> return
> }
>
> But that only stops subsequent actions when the test is known
> a priori to have errors. How do we detect compilation errors,
> so as to skip the remainder of the actions?
Complicated GCC tests do this by using local procs instead of dg-runtest
and dg-test. See, for example, gcc.dg/lto/lto.exp,
gcc.dg/compat/compat.exp and gcc.dg/tree-prof/tree-prof.exp, which use
lto.exp, compat.exp and profopt.exp from GCC's testsuite/lib. Those
have scenarios in which further testing is skipped after a compile or
link fails.
Janis