diff options
Diffstat (limited to 'it')
5 files changed, 23 insertions, 0 deletions
diff --git a/it/projects/override-project-settings-path/conf/sq-project.properties b/it/projects/override-project-settings-path/conf/sq-project.properties new file mode 100644 index 0000000..a3b76fd --- /dev/null +++ b/it/projects/override-project-settings-path/conf/sq-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=sample-with-custom-settings-path +sonar.projectName=Test with custom settings location + +sonar.sources=src diff --git a/it/projects/override-project-settings-path/sonar-project.properties b/it/projects/override-project-settings-path/sonar-project.properties new file mode 100644 index 0000000..bd982e4 --- /dev/null +++ b/it/projects/override-project-settings-path/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=sample-should-be-ignored +sonar.projectName=Should be ignored + +sonar.sources=src diff --git a/it/projects/override-project-settings-path/src/basic/Hello.js b/it/projects/override-project-settings-path/src/basic/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/override-project-settings-path/src/basic/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/override-project-settings-path/src/basic/World.js b/it/projects/override-project-settings-path/src/basic/World.js new file mode 100644 index 0000000..1ea849a --- /dev/null +++ b/it/projects/override-project-settings-path/src/basic/World.js @@ -0,0 +1,2 @@ +function world() { +} diff --git a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java index f003df2..c0c2875 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java +++ b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java @@ -198,4 +198,15 @@ public class ScannerTest extends ScannerTestCase { assertThat(logs).containsPattern("Too small (initial|maximum) heap"); } + // SQSCANNER-24 + @Test + public void should_override_project_settings_path() { + File projectHome = new File("projects/override-project-settings-path"); + SonarScanner build = newScanner(projectHome) + .setProperty("project.settings", new File(projectHome, "conf/sq-project.properties").getAbsolutePath()); + orchestrator.executeBuild(build); + + assertThat(getComponent("sample-with-custom-settings-path").getName()).isEqualTo("Test with custom settings location"); + } + } |