This is a nice, tricky issue indeed. Lex, your writeup explaining the
challenge was excellent.
I would go back and push on your dismissal of option #2: tests that really
do only run in certain modes. I think we're going to have to embrace that on
many different levels, and perhaps we simply need to come up with better
infrastructure for managing it.

Some examples of flag-sensitive tests:
- your splitting example
- bob's disable class metadata example
- upcoming compiler optimization tests when -XdisableAggressiveOptimizations
is on
- tests that can't run under HtmlUnit (e.g. those requiring layout)
- tests of stack trace information at various levels of details
- logging tests
- as we add per-permutation compiler flags (e.g. code gen flags to use
different optimizations for mobile vs. desktop browsers), we'd need to vary
tests based on permutation
- ...

So, would it be too much of a digression to brainstorm about a uniform way
to handle all these variations?

We have @DoNotRunWith() right now. Could we generalize that to:

   @DoNotRunWhen(from=<deferred-bound-type>, to=<chosen-replacement-class>)

such as

   @DoNotRunWhen(from=DOMImpl.class, to=DOMImplOpera.class)

We'd have to figure out how to compose these using a decent syntax, but
something like this seems like it might work. It would also mean that we'd
have to introduce potentially artificial classes to represent optional modes
that are just flags right now,
including classes such as "AggressiveCompilerOptimizationsDisabled" or
"CodeSplittingEnabled", etc. But that is arguably beneficial since it
provides some decoupling between the namespace of types and the namespace of
the command-line, which seems better to keep separate.

On Fri, Aug 7, 2009 at 11:20 AM, BobV <[email protected]> wrote:

>
> There's a related issue for ClassObjectTest.  It is sensitive to
> whether or not the compiler is in -XdisableClassMetadata mode.
>
> I've wanted to add some kind of build information to the
> GeneratorContext that would allow Generators to get the command-line
> flags so generators can be sensitive to pretty vs obfuscated mode.
> When you have tests that are sensitive to flags, you could use a class
> similar in spirit to LocaleInfo.  Even if all you could get is a
> string containing the compiler's command-line, that should be
> sufficient.
>
> --
> Bob Vawter
> Google Web Toolkit Team
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to