+# Helper methods
+# Check the result in the log and print a summary
+def checkResult(logDirName):
+ extractResult = open(logDirName, "r")
+ result = "other errors--PLEASE CHECK!"
+
+ for line in extractResult:
+ if "no errors detected" in line:
+ result = "no conflict"
+ break
+ elif "java.lang.RuntimeException: Conflict between apps App1 and App2:" in line:
+ result = "conflict"
+ break
+ elif "Direct-Direct Interaction detected:" in line:
+ result = "direct-direct"
+ break
+
+ return result
+
+# Extract the error from specific error logs
+def extractError():
+ err = ""
+ if os.path.exists("appCreationError.log"):
+ extractError = open("appCreationError.log", "r")
+ for line in extractError:
+ err = err + line
+ extractError.close()
+ os.system("rm appCreationError.log")
+ return err
+
+# Write error log to the log directory
+# In this case we skip running JPF
+# e.g., in the case of having a direct-direct interaction pair
+def writeErrorLog(jpfLogDir, logName, error):
+ writeError = open(jpfLogDir + logName, "w+")
+ writeError.write(error)
+ writeError.close()
+