Created
October 2, 2012 10:54
-
-
Save jlehtoma/3818153 to your computer and use it in GitHub Desktop.
Test zig3.exe crahses
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
''' | |
Windows error reporting dialog must be disabled for this to work: | |
1. Press WIN+R | |
2. Type in "gpedit.msc" | |
3. Computer configuration -> Administrative Templates | |
4. Windows Components -> Windows Error Reporting | |
5. Set "Prevent display of the user interface for critical errors" to Enabled | |
''' | |
import subprocess | |
import glob | |
import copy | |
exes = glob.glob('*.exe') | |
params = ["call", "-r", "tutorial_input/set.dat", | |
"tutorial_input/splist_w.spp", | |
"tutorial_output/output_ds.txt", "0.0", "1", "2", "0"] | |
run_info = [] | |
f = open('exe_log.txt','w') | |
for exe in exes: | |
commands = copy.deepcopy(params) | |
commands.insert(1, exe) | |
p = subprocess.Popen(commands, shell=True, stdout=subprocess.PIPE, | |
stderr=subprocess.STDOUT) | |
output_lines = [] | |
for line in p.stdout.readlines(): | |
print(line) | |
output_lines.append(line.split("\n")) | |
retval = p.wait() | |
if retval == 0: | |
msg = "%s: success!\n" % exe | |
else: | |
msg = "%s: crash... Last message was: %s\n" % (exe, output_lines[-1]) | |
print(msg) | |
f.write(msg) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment