Skip to content

Commit

Permalink
Guard system properties in default jvm/debug options
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <[email protected]>
  • Loading branch information
tvallin committed Dec 9, 2024
1 parent 0022a54 commit 4a6f5ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
os: [ ubuntu-20.04, windows-2022, macos-12 ]
os: [ ubuntu-20.04, windows-2022, macos-13 ]
include:
- { os: ubuntu-20.04, platform: linux-amd64 }
- { os: windows-2022, platform: windows-amd64, file-ext: .exe }
- { os: macos-12, platform: darwin-amd64 }
- { os: macos-13, platform: darwin-amd64 }
runs-on: ${{ matrix.os }}
name: cli/${{ matrix.platform }}
steps:
Expand Down
12 changes: 12 additions & 0 deletions linker/src/test/java/io/helidon/build/linker/StartScriptTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.hamcrest.core.StringContains;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;

import static io.helidon.build.common.FileUtils.ensureDirectory;
import static io.helidon.build.common.FileUtils.ensureFile;
Expand Down Expand Up @@ -110,6 +112,16 @@ void testDefaultJvmOptions() {
assertThat(script, containsString("defaultJvm=\"-verbose:class -Xms32\""));
}

@Test
@EnabledOnOs(OS.WINDOWS)
void testCustomDefaultJvmOptions() {
String script = builder().defaultJvmOptions(List.of("-Dfoo.foo=foo")).build().toString();
assertThat(script, containsString("defaultJvm=\"`\"-Dfoo.foo=foo`\"\""));

script = builder().defaultJvmOptions(List.of("-Dfoo=foo", "-Dbar=bar")).build().toString();
assertThat(script, containsString("defaultJvm=\"`\"-Dfoo=foo`\" `\"-Dbar=bar`\"\""));
}

@Test
void testDefaultDebugOptions() {
String script = builder().build().toString();
Expand Down

0 comments on commit 4a6f5ab

Please sign in to comment.