Added support for Windows batch step.
@@ -68,7 +68,8 @@ public class StepsITest extends IntegrationTestWithJenkinsPerTest {
+ " stages {\n"
+ " stage ('Create a fake warning') {\n"
+ " steps {\n"
- + " sh 'echo \"foo.cc:4:39: error: foo.h: No such file or directory\" >warnings.log' "
+ + " " + getShellStep(
+ "echo \"foo.cc:4:39: error: foo.h: No such file or directory\" >warnings.log")
+ " }\n"
+ " }\n"
+ " }\n"
@@ -84,6 +85,15 @@ public class StepsITest extends IntegrationTestWithJenkinsPerTest {
assertThat(result).hasTotalSize(1);
}
+ private String getShellStep(final String script) {
+ if (isWindows()) {
+ return String.format("bat '%s'", script);
+ }
+ else {
+ return String.format("sh '%s'", script);
+ }
+ }
+
/**
* Creates a JenkinsFile with parallel steps and aggregates the warnings.
*/
