randoop
randoop copied to clipboard
Generated tests fail to run when RegressionTestDriver main() is too long
When presented with very long time limits, Randoop can generate so many tests that the main method to run the tests in RegressionTestDriver is over 65536 bytes which causes a runtime error stating "Code too large for try statement"
Thanks for the bug report. Can you please give a concrete test case that reproduces the problem? That will save us time, since you already have a command line and files that produce this result. It will also enable us to test a fix to ensure that it actually works for you.
Here is a simple example with only one file from the JFreeChart project that fails. If you download and extract the contents of the attached archive and run the commands listed below from within the unzipped archive, Randoop will successfully generate tests, but the attempt to compile the java files will result in the code too large for try statement error on the file RegressionTestDriver.java. Note that the error appears to be a result of both the large time limit as well as the --junit-reflection-allowed=false flag.
java -ea -classpath .:./randoop-all-3.0.8.jar randoop.main.Main gentests --testclass=Licences --timelimit=600 --junit-reflection-allowed=false
javac -cp junit-4.12.jar *.java