diff --git a/core/src/main/kotlin/org/jetbrains/research/testspark/core/test/java/JavaTestCompiler.kt b/core/src/main/kotlin/org/jetbrains/research/testspark/core/test/java/JavaTestCompiler.kt index fb2bd055c..483ac90a6 100644 --- a/core/src/main/kotlin/org/jetbrains/research/testspark/core/test/java/JavaTestCompiler.kt +++ b/core/src/main/kotlin/org/jetbrains/research/testspark/core/test/java/JavaTestCompiler.kt @@ -42,12 +42,15 @@ class JavaTestCompiler( override fun compileCode(path: String, projectBuildPath: String, workingDir: String): ExecutionResult { val classPaths = "\"${getClassPaths(projectBuildPath)}\"" // compile file + // See: https://github.com/JetBrains-Research/TestSpark/issues/402 + val javac = if (DataFilesUtil.isWindows()) "\"$javac\"" else "'$javac'" + val executionResult = CommandLineRunner.run( arrayListOf( /** * Filepath may contain spaces, so we need to wrap it in quotes. */ - "'$javac'", + javac, "-cp", classPaths, path, diff --git a/core/src/main/kotlin/org/jetbrains/research/testspark/core/test/kotlin/KotlinTestCompiler.kt b/core/src/main/kotlin/org/jetbrains/research/testspark/core/test/kotlin/KotlinTestCompiler.kt index 6d4c9dfbc..f7e38ea81 100644 --- a/core/src/main/kotlin/org/jetbrains/research/testspark/core/test/kotlin/KotlinTestCompiler.kt +++ b/core/src/main/kotlin/org/jetbrains/research/testspark/core/test/kotlin/KotlinTestCompiler.kt @@ -56,12 +56,15 @@ class KotlinTestCompiler( val classPaths = "\"${getClassPaths(projectBuildPath)}\"" // Compile file + // See: https://github.com/JetBrains-Research/TestSpark/issues/402 + val kotlinc = if (DataFilesUtil.isWindows()) "\"$kotlinc\"" else "'$kotlinc'" + val executionResult = CommandLineRunner.run( arrayListOf( /** * Filepath may contain spaces, so we need to wrap it in quotes. */ - "'$kotlinc'", + kotlinc, "-cp", classPaths, path,