mirror of https://github.com/vitalif/openscad
Better error output when cmd is not found
parent
22b74585d8
commit
f2323c78b3
|
@ -64,19 +64,23 @@ def run_test(testname, cmd, args):
|
||||||
if not os.path.exists(outputdir): os.makedirs(outputdir)
|
if not os.path.exists(outputdir): os.makedirs(outputdir)
|
||||||
outputname = actualfilename
|
outputname = actualfilename
|
||||||
outfile = open(outputname, "wb")
|
outfile = open(outputname, "wb")
|
||||||
proc = subprocess.Popen([cmd] + args, stdout=outfile, stderr=subprocess.PIPE)
|
try:
|
||||||
errtext = proc.communicate()[1]
|
proc = subprocess.Popen([cmd] + args, stdout=outfile, stderr=subprocess.PIPE)
|
||||||
if errtext != None and len(errtext) > 0:
|
errtext = proc.communicate()[1]
|
||||||
print >> sys.stderr, "Error output: " + errtext
|
if errtext != None and len(errtext) > 0:
|
||||||
outfile.close()
|
print >> sys.stderr, "Error output: " + errtext
|
||||||
if proc.returncode != 0:
|
outfile.close()
|
||||||
print >> sys.stderr, "Error: %s failed with return code %d" % (cmdname, proc.returncode)
|
if proc.returncode != 0:
|
||||||
return False
|
print >> sys.stderr, "Error: %s failed with return code %d" % (cmdname, proc.returncode)
|
||||||
|
|
||||||
if not options.generate:
|
|
||||||
if not compare_text(expectedfilename, actualfilename):
|
|
||||||
execute_and_redirect("diff", [expectedfilename, actualfilename], sys.stderr)
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if not options.generate:
|
||||||
|
if not compare_text(expectedfilename, actualfilename):
|
||||||
|
execute_and_redirect("diff", [expectedfilename, actualfilename], sys.stderr)
|
||||||
|
return False
|
||||||
|
except OSError, err:
|
||||||
|
print >> sys.stderr, "Error: %s \"%s\"" % (err.strerror, cmd)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
class Options:
|
class Options:
|
||||||
|
|
Loading…
Reference in New Issue