Skip to content

Commit

Permalink
JENKINS-66950: Parser should not stop processing when parsing CMake o…
Browse files Browse the repository at this point in the history
…utput that contains text before '-- Build files have been written to'
  • Loading branch information
w-gates committed Oct 21, 2021
1 parent 1e2167d commit 4a9b7d6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/edu/hm/hafner/analysis/LookaheadParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class LookaheadParser extends IssueParser {
private static final Pattern ENTERING_DIRECTORY_PATH
= Pattern.compile(".*" + ENTERING_DIRECTORY + " [`'](?<dir>.*)['`]");
private static final String CMAKE_PREFIX = "-- Build files have";
private static final Pattern CMAKE_PATH = Pattern.compile(CMAKE_PREFIX + " been written to: (?<dir>.*)");
private static final Pattern CMAKE_PATH = Pattern.compile(".*" + CMAKE_PREFIX + " been written to: (?<dir>.*)");

private static final int MAX_LINE_LENGTH = 4000; // see JENKINS-55805

Expand Down
17 changes: 17 additions & 0 deletions src/test/java/edu/hm/hafner/analysis/parser/MsBuildParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,23 @@ void issue57365() {
assertThat(warnings).isEmpty();
}

/**
* Parser should not stop processing when parsing CMake output that contains text before
* '-- Build files have been written to'.
*
* @see <a href="https://issues.jenkins-ci.org/browse//JENKINS-66950">Issue 66950</a>
*/
@Test
void issue66950() {
Report report = parse("issue66950.txt");

try (SoftAssertions softly = new SoftAssertions()) {
Iterator<Issue> iterator = report.iterator();
softly.assertThat(report).hasSize(0);
softly.assertThat(report).doesNotHaveErrors();
}
}

@Override
protected void assertThatIssuesArePresent(final Report report, final SoftAssertions softly) {
softly.assertThat(report).hasSize(8);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22>-- Build files have been written to: /mnt/Jenkins_Workspace/V4SW/V4_Software_F/CUDALibs/CUDAYolo/Release-TX2

0 comments on commit 4a9b7d6

Please sign in to comment.