From a46b99a0221e97f325b5ad818711ecfe10704a5f Mon Sep 17 00:00:00 2001 From: Vladislav Artiukhov Date: Fri, 11 Oct 2024 14:17:17 +0200 Subject: [PATCH] fix: add quotes around compilers' filepaths --- .../research/testspark/core/test/java/JavaTestCompiler.kt | 5 ++++- .../testspark/core/test/kotlin/KotlinTestCompiler.kt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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 c4c5250c0..24d875506 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,7 +42,10 @@ class JavaTestCompiler( // compile file val errorMsg = CommandLineRunner.run( arrayListOf( - javac, + /** + * Filepath may contain spaces, so we need to wrap it in quotes. + */ + "'$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 1d242e106..3e1573c48 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 @@ -57,7 +57,10 @@ class KotlinTestCompiler( // TODO: we treat warnings as errors for now val errorMsg = CommandLineRunner.run( arrayListOf( - kotlinc, + /** + * Filepath may contain spaces, so we need to wrap it in quotes. + */ + "'$kotlinc'", "-cp", classPaths, path,