Skip to content

Instantly share code, notes, and snippets.

@jlehtoma
Created October 2, 2012 10:54
Show Gist options
  • Save jlehtoma/3818153 to your computer and use it in GitHub Desktop.
Save jlehtoma/3818153 to your computer and use it in GitHub Desktop.
Test zig3.exe crahses
# -*- 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