@@ -98,9 +98,12 @@ public TestCaseVariantValidationResult runTestFromEvoSuite(ProgramVariant curren
98
98
// Set up dirs
99
99
String classpathForCompile = "" ;
100
100
classpathForCompile = projectFacade .getProperties ().getDependenciesString () + File .pathSeparator
101
- + projectFacade .getOutDirWithPrefix (currentVariant .currentMutatorIdentifier ()) + File .pathSeparator //
101
+ + new File (projectFacade .getOutDirWithPrefix (currentVariant .currentMutatorIdentifier ()))
102
+ .getAbsolutePath ()
103
+ + File .pathSeparator //
102
104
+ new File (ConfigurationProperties .getProperty ("evosuitejar" )).getAbsolutePath () + File .pathSeparator
103
- + projectFacade .getOutDirWithPrefix (currentVariant .DEFAULT_ORIGINAL_VARIANT );
105
+ + new File (projectFacade .getOutDirWithPrefix (currentVariant .DEFAULT_ORIGINAL_VARIANT ))
106
+ .getAbsolutePath ();
104
107
105
108
String outPutTest = projectFacade .getOutDirWithPrefix ("/evosuite/evosuite-tests/" + sufix );
106
109
@@ -129,8 +132,8 @@ public TestCaseVariantValidationResult runTestFromEvoSuite(ProgramVariant curren
129
132
List <String > pathTestGenerated = new ArrayList <String >();
130
133
131
134
log .debug ("Generating test for the first time" );
132
- boolean executed = fev .runEvosuite (currentVariant , classesToGenerateTests , projectFacade , testEScodepath ,
133
- runOverOriginal );
135
+ boolean executed = fev .runEvosuite (currentVariant , classesToGenerateTests , projectFacade ,
136
+ esPath . getAbsolutePath (), runOverOriginal );
134
137
135
138
// we collect the files generated
136
139
@@ -145,7 +148,7 @@ public TestCaseVariantValidationResult runTestFromEvoSuite(ProgramVariant curren
145
148
// Collect test generated from files generated by ES
146
149
for (String f : pathTestGenerated ) {
147
150
String qualifiedTestName = f .replace (".java" , "" ).replace (esPath .toString (), "" )
148
- .replace ("/evosuite-tests/" , " " ).replace (File . separator , ". " );
151
+ .replace (File . separator , ". " ).replace (".evosuite-tests." , "" );
149
152
if (!qualifiedTestName .endsWith (EvoSuiteFacade .EVOSUITE_scaffolding_SUFFIX ) && classesToGenerateTests
150
153
.contains (qualifiedTestName .replace (EvoSuiteFacade .EVOSUITE_SUFFIX , "" ))) {
151
154
testGenerated .add (qualifiedTestName );
@@ -165,18 +168,21 @@ public TestCaseVariantValidationResult runTestFromEvoSuite(ProgramVariant curren
165
168
166
169
// WE COMPILE EVO TEST
167
170
log .info ("Classpath " + classpathForCompile );
168
-
171
+ String envOS = System . getProperty ( "os.name" );
169
172
String javaPath = ConfigurationProperties .getProperty ("jvm4evosuitetestexecution" );
170
173
List <String > command = new ArrayList <String >();
171
- command .add (javaPath + File .separator + "javac" );
174
+ if (!envOS .contains ("Windows" ))
175
+ command .add (javaPath + File .separator + "javac" );
176
+ else
177
+ command .add ("\" " + javaPath + File .separator + "javac" + "\" " );
172
178
command .add ("-classpath" );
173
179
command .add (classpathForCompile );
174
180
command .add ("-d" );
175
181
176
182
//// Save compiled
177
183
File fout = new File (outPutTest );
178
184
fout .mkdirs ();
179
- command .add (outPutTest );
185
+ command .add (fout . getAbsolutePath () );
180
186
181
187
// Adding the files
182
188
for (String testPath : pathTestGenerated ) {
@@ -189,8 +195,8 @@ public TestCaseVariantValidationResult runTestFromEvoSuite(ProgramVariant curren
189
195
log .debug ("Any test to generate, all test cases were generated before: " + testAlreadyGenerated );
190
196
}
191
197
192
- String classpathForRunTest = classpathForCompile + (File .pathSeparator ) + outPutTest + File . pathSeparator
193
- + System .getProperty ("java.class.path" );
198
+ String classpathForRunTest = classpathForCompile + (File .pathSeparator ) + new File ( outPutTest ). getAbsolutePath ()
199
+ + File . pathSeparator + System .getProperty ("java.class.path" );
194
200
log .info ("Process classpath " + classpathForRunTest );
195
201
196
202
ProcessEvoSuiteValidator evoProcess = new ProcessEvoSuiteValidator ();
@@ -231,4 +237,4 @@ public TestCasesProgramValidationResult executeRegressionTesting(URL[] processCl
231
237
}
232
238
}
233
239
234
- }
240
+ }
0 commit comments