Created
March 4, 2015 15:05
-
-
Save chadluo/9b3a2ae0dca2256e9393 to your computer and use it in GitHub Desktop.
tester for 3131 assignment scanner
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
#!/usr/bin/env python | |
"""test script for scanner assignment.""" | |
import difflib | |
import glob | |
import subprocess | |
path = "./Scanner/*.vc" | |
for vc in glob.glob(path): | |
print("\nTesting: " + vc + "\n") | |
runoutdry = subprocess.Popen(["java", "VC.vc", vc], | |
stdout=subprocess.PIPE).stdout.readlines() | |
runout = [t.decode("utf-8") for t in runoutdry] | |
sampleout = open(vc.replace("vc", "sol")).readlines() | |
#for o in runout: | |
#print(o.replace("\n", "")) | |
#for o in sampleout: | |
#print(o.replace("\n", "")) | |
diff = difflib.ndiff(runout, sampleout) | |
print("\n".join(list(diff))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment