Commit 2019dfa0 authored by Jonathan Shahen's avatar Jonathan Shahen

Write out the NuSMV output to file (as a backup)

parent 7c56ac35
......@@ -14,3 +14,4 @@ MohawkCUIPreviousCommand.txt
data/testcases/mohawk.jar
data/
smvinstancefile*
latestNuSMVOutput.txt
......@@ -24,9 +24,8 @@
package mohawk.nusmv;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.*;
import java.nio.file.*;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;
......@@ -82,14 +81,24 @@ public class NuSMV {
StringBuilder _lastOutput = new StringBuilder();
System.out.print("Reading Lines");
while ((strLine = bufread.readLine()) != null) {
_lastOutput.append("\t" + strLine + "\n");
_lastOutput.append(strLine + "\n");
System.out.print('.');
}
System.out.println("Done Reading\n");
System.out.println("################### NuSMV Output ###################");
System.out.println(_lastOutput.toString());
System.out.println("################### NuSMV Output ###################");
execProcess.waitFor();
try {
Path nusmvLog = Paths.get("latestNuSMVOutput.txt");
Files.write(nusmvLog, _lastOutput.toString().getBytes());
} catch (Exception e) {
// do not send this error up
System.out.println("[ERROR] Failed to write out the NuSMV log");
}
if (_lastOutput.toString().indexOf("= FALSE is false") != -1) { return true; }
if (_lastOutput.toString().indexOf("false") != -1) { return true; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment