Skip to content

Commit 3bf8747

Browse files
committed
Test preAnalysis with a command that completes successfully
1 parent f8b3e8b commit 3bf8747

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/java/GoblintAnalysisTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ void preAnalyseTest() {
125125
doReturn(true).when(goblintServer).isAlive();
126126
when(goblintConfWatcher.refreshGoblintConfig()).thenReturn(true);
127127

128-
// Mock that the command to execute is not empty
129-
String[] preAnalyzeCommand = new String[]{"cmake", "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", "-B", "build"};
128+
// A process that must be run before analysis
129+
String processPrintout = "'Hello'";
130+
String[] preAnalyzeCommand = new String[]{"echo", processPrintout};
130131
when(gobPieConfiguration.getPreAnalyzeCommand()).thenReturn(preAnalyzeCommand);
131132

132133
// Mock that the analyses of Goblint have started and completed
@@ -144,6 +145,7 @@ void preAnalyseTest() {
144145
verify(goblintServer).preAnalyse();
145146
assertTrue(systemOut.getLines().anyMatch(line -> line.contains("Preanalyze command ran: ")));
146147
assertTrue(systemOut.getLines().anyMatch(line -> line.contains("Preanalyze command finished.")));
148+
assertTrue(systemOut.getLines().anyMatch(line -> line.contains(processPrintout)));
147149
}
148150

149151
/**

0 commit comments

Comments
 (0)