Skip to content

Commit

Permalink
fix: quote compilers' filepaths with "" for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav0Art committed Oct 28, 2024
1 parent 1fa308e commit cdd6b4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cdd6b4c

Please sign in to comment.