Skip to content

Commit

Permalink
JENKINS-43175: adjusted unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
15knots committed Mar 31, 2017
1 parent 9a83889 commit dc0488e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/test/java/hudson/plugins/cmake/CmakeBuilderBuildTest.java
Expand Up @@ -168,17 +168,19 @@ public void testBuildToolStep() throws Exception {
cmb.setSourceDir("src");
cmb.setBuildDir("build/debug");
p.getBuildersList().add(cmb);
ArrayList<BuildToolStep> steps = new ArrayList<BuildToolStep>(2);
// let the build invoke 'make clean all'..
BuildToolStep step = new BuildToolStep();
final String makeTargets = "clean all";
step.setArgs(makeTargets);
cmb.getSteps().add(step);
steps.add(step);
// let the build invoke 'make rebuild_cache'..
step = new BuildToolStep();
String makeTargets2 = "rebuild_cache";
step.setArgs(makeTargets2);
cmb.getSteps().add(step);

steps.add(step);
cmb.setSteps(steps);

FreeStyleBuild build = p.scheduleBuild2(0).get();
System.out.println(JenkinsRule.getLog(build));
j.assertLogContains(makeTargets, build);
Expand All @@ -201,18 +203,20 @@ public void testBuildToolStepWithCmake() throws Exception {
cmb.setSourceDir("src");
cmb.setBuildDir("build/debug");
p.getBuildersList().add(cmb);
ArrayList<BuildToolStep> steps = new ArrayList<BuildToolStep>(2);
// let the build invoke 'cmake --build <dir> clean all'..
BuildToolStep step = new BuildToolStep();
step.setWithCmake(true);
final String makeTargets = "--target all";
step.setArgs(makeTargets);
cmb.getSteps().add(step);
steps.add(step);
// let the build invoke 'cmake --build <dir> rebuild_cache'..
step = new BuildToolStep();
step.setWithCmake(true);
String makeTargets2 = "--target rebuild_cache";
step.setArgs(makeTargets2);
cmb.getSteps().add(step);
steps.add(step);
cmb.setSteps(steps);

FreeStyleBuild build = p.scheduleBuild2(0).get();
System.out.println(JenkinsRule.getLog(build));
Expand Down

0 comments on commit dc0488e

Please sign in to comment.