I'm using evosuite generating tests with param '-Duse_separate_classloader=false',it works on jacoco covorage tool.But in some cases,which it needed some mock environment likes current time or randoms,it failed the tests.
I've read the source code and found that if previous test run without evorunner,the class would load without evosuite instrument.
if (!active || !RuntimeInstrumentation.checkIfCanInstrument(classWithDots) || classWithDots.startsWith(PackageInfo.getEvoSuitePackage())) {
return classfileBuffer;
}
Then the generated test cases run,but the class would not instrument since it has been loaded,which makes the mocks disabled.
I've found some code in classes initializing,it seems like to resolve this problem,can it really works?
//retransformIfNeeded(classes); // cannot do it, as retransformation does not really work :(
Hi, I am trying to use Evouite and integrating the jacoco code coverage using Gradle. Did you try the offline code coverage? Do you recommend using the 'use_separate_classloader=false' instead?
I'm using evosuite generating tests with param '-Duse_separate_classloader=false',it works on jacoco covorage tool.But in some cases,which it needed some mock environment likes current time or randoms,it failed the tests. I've read the source code and found that if previous test run without evorunner,the class would load without evosuite instrument.
Then the generated test cases run,but the class would not instrument since it has been loaded,which makes the mocks disabled. I've found some code in classes initializing,it seems like to resolve this problem,can it really works?