Skip to content

Instantly share code, notes, and snippets.

@emtwo
Created September 20, 2011 03:30
Show Gist options
  • Save emtwo/1228248 to your computer and use it in GitHub Desktop.
Save emtwo/1228248 to your computer and use it in GitHub Desktop.
Python Test Script
8,13d7
< ~T
< ~T
< ~T
< ~T
< ~T
< ~T
23,28d16
< ~T
< ~T
< ~T
< ~T
< ~T
< ~T
import os;
os.system("rm fail.txt");
os.system("make clean");
os.system("make throwcatch");
os.system("make longjmp");
for i in range(0, 20):
for j in range(0, 20):
for k in range(0, 20):
os.system("./throwcatch " + str(i) + " " + str(j) + " " + str(k) + " > throwcatch.txt");
os.system("./longjmp " + str(i) + " " + str(j) + " " + str(k) + " > longjmp.txt");
os.system("diff throwcatch.txt longjmp.txt > diff.txt");
f = open("diff.txt", "r");
fail = False;
for line in f:
#print line.rfind(" ") == 9;
if ((line.find("d") != -1 and line.rfind(" ") == 9) or (line.find("d") == -1 and line.find("~T") == -1)):
fail = True;
f.close();
f = open("fail.txt", "a");
if (fail):
f.write(str(i) + ", " + str(j) + ", " + str(k) + " Failed\n");
else:
f.write("Success!\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment