Created
June 12, 2018 09:24
-
-
Save typhoonzero/7d87acec104076b30896f602de4e747b to your computer and use it in GitHub Desktop.
get which ctest case hungs from the ctest log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import re | |
def escape(input): | |
o = input.replace("\n", "") | |
o = o.replace("\r", "") | |
return o | |
def main(): | |
logfile = sys.argv[1] | |
started = set() | |
passed = set() | |
with open(logfile, "r") as fn: | |
for l in fn.readlines(): | |
if l.find("Test ") != -1 and \ | |
l.find("Passed") != -1: | |
m = re.search("Test\s+#[0-9]*\:\s([a-z0-9_]+)", escape(l)) | |
passed.add(m.group(1)) | |
if l.find("Start ") != -1: | |
start_parts = escape(l).split(" ") | |
m = re.search("Start\s+[0-9]+\:\s([a-z0-9_]+)", escape(l)) | |
started.add(m.group(1)) | |
print "Diff: ", started - passed | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment