Skip to content

Instantly share code, notes, and snippets.

@typhoonzero
Created June 12, 2018 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typhoonzero/7d87acec104076b30896f602de4e747b to your computer and use it in GitHub Desktop.
Save typhoonzero/7d87acec104076b30896f602de4e747b to your computer and use it in GitHub Desktop.
get which ctest case hungs from the ctest log
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