On 3 Apr 2014, at 9:36 pm, Szczepan Faber <szczepan.fa...@gradleware.com> wrote:
> Hey, > > How do we avoid sleeps in incremental compilation integ tests? My initial > batch of integ tests for java incremental compilation uses Thread.sleep and > file.lastModified to verify which files were actually recompiled. It seems > tricky to avoid the sleep. If I use file hash/size instead of lastModified it > does not work for cases where recompiled class is the same as the original > one. Another option would be to introduce some api/listener that gets > notified just before the compilation and receives the information about > requested source to compile. I’d think about using logging, possibly via some listener. This is information that a human would find very useful, too. You should package up the strategy behind a fixture, so that we can use other strategies that might happen to be available, eg a file system listener when we’re running under java 7 or timestamps on platforms where they have reasonable resolution. Whatever option you use, make sure you sync up with the c++ integration tests to use the same approach (eg reuse the same listener and reuse the test fixture). -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com Join us for Gradle Summit 2014, June 12th and 13th in Santa Clara, CA: http://www.gradlesummit.com