@@ -272,7 +272,6 @@ trait ParallelTesting {
272
272
}
273
273
274
274
private def requirements (f : String , sourceDir : JFile , outDir : String ): Unit = {
275
- require(f.contains(" /tests" ), " only allowed to run integration tests from `tests` dir using this method" )
276
275
require(sourceDir.isDirectory && sourceDir.exists, " passed non-directory to `compileFilesInDir`" )
277
276
require(outDir.last == '/' , " please specify an `outDir` with a trailing slash" )
278
277
}
@@ -283,6 +282,22 @@ trait ParallelTesting {
283
282
else (dirs, f :: files)
284
283
}
285
284
285
+ def compileFileInDir (f : String , flags : Array [String ])(implicit outDirectory : String ): CompilationTest = {
286
+ // each calling method gets its own unique output directory, in which we
287
+ // place the dir being compiled:
288
+ val callingMethod = Thread .currentThread.getStackTrace.apply(3 ).getMethodName
289
+ val outDir = outDirectory + callingMethod + " /"
290
+ val sourceFile = new JFile (f)
291
+ val parent = sourceFile.getParentFile
292
+ require(
293
+ sourceFile.exists && ! sourceFile.isDirectory &&
294
+ (parent ne null ) && parent.exists && parent.isDirectory,
295
+ s " Source file: $f, didn't exist "
296
+ )
297
+
298
+ new CompilationTest (toCompilerDirFromFile(sourceFile, parent, outDir) :: Nil , f, flags)
299
+ }
300
+
286
301
def compileFilesInDir (f : String , flags : Array [String ])(implicit outDirectory : String ): CompilationTest = {
287
302
// each calling method gets its own unique output directory, in which we
288
303
// place the dir being compiled:
0 commit comments