On Mon, Oct 6, 2008 at 4:27 PM, Mike Aizatsky <[EMAIL PROTECTED]>wrote:
> Scott, > > >> > - Could briefly summarize the motivation for the > >> > suite()/JJSOptimizerTestDecator design? > >> > >> This way the module will be compiled only once. Unfortunately > >> JavaToJavaScriptCompiler doesn't have any easily extract compiling > >> pass and I didn't want to seriously refactor it. > > > > I'm not sure I totally understand. Are you suggesting that if you don't > use > > a suite and simply run the test class as a unit test, stuff happens > multiple > > times that shouldn't? > > If you perform program compilation in setUp method - you'll compile > all your code for every test. And this becomes really costly for 50 > tests. So, the natural solution is to move compilation into some > static context. > Gotcha. But if you don't compile multiple times, how do you prevent optimizations that occur in one test method from impacting ones that occur in another test method? By the way, I've already got a big patch out that Bob is reviewing that is a huge refactor to JavaToJavaScriptCompiler, and we can continue to refactor further to support this use case in the best way possible. I can't think of a fundamental reason that compiles should be slow for small test cases. > >> > - Textual comparison seems like a great first step, but a bit brittle > >> > going > >> > forward. I'd worry that changes in the compiler totally unrelated to > an > >> > optimization pass would tend to unnecessarily break tests. > >> > >> That's a valid point and I saw this in the fast. I don't know a > >> solution for this. Writing manual tree-based checks is even more > >> fragile. However I do believe this is better than nothing. > > > > I know. But I would like to think of a way forward. Maybe we could take > a > > "before" and "after" string snapshot of the program, and validate only > the > > sections of the code that are different. > > You mean storing diffs instead of expected data? > Something like that. Scott --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
