diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-01-18 23:22:25 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-03-11 12:53:34 -0700 |
commit | 4ffe9345ca6e611ff5a83a3fdabeb7658a2fce50 (patch) | |
tree | 324b0ec35f2adc76e97548f90a1ba9e3351271f6 /build.xml | |
parent | b34a452c0683d260ffb1644575a0e970559cae87 (diff) | |
download | scala-4ffe9345ca6e611ff5a83a3fdabeb7658a2fce50.tar.gz scala-4ffe9345ca6e611ff5a83a3fdabeb7658a2fce50.tar.bz2 scala-4ffe9345ca6e611ff5a83a3fdabeb7658a2fce50.zip |
Reuse the same compiler instance for all tests in a JUnit class
Note that JUnit creates a new instance of the test class for running
each test method. So the compiler instance is added to the companion.
However, the JVM would quickly run out of memory when running multiple
tests, as the compilers cannot be GCd. So we make it a `var`, and set
it to null when a class is done. For that we use JUnit's `@AfterClass`
which is required to be on a static method. Therefore we add a Java
class with such a static method that we can extend from Scala.
Diffstat (limited to 'build.xml')
-rwxr-xr-x | build.xml | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1448,6 +1448,15 @@ TODO: <target name="test.junit.comp" depends="pack.done"> <stopwatch name="test.junit.compiler.timer"/> <mkdir dir="${test.junit.classes}"/> + <javac + debug="true" + srcdir="${test.junit.src}" + destdir="${test.junit.classes}" + classpathref="test.junit.compiler.build.path" + target="1.6" + source="1.5" + compiler="javac1.6" + includes="**/*.java"/> <scalacfork destdir="${test.junit.classes}" compilerpathref="quick.compiler.path" |