Output debug warnings and errors to stderr. Clean up regress script a bit.

This commit is contained in:
Matt Guthaus
2018-07-11 09:51:28 -07:00
parent c6503dd771
commit b3732f4fcf
2 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -13,19 +13,19 @@ def check(check,str):
(frame, filename, line_number, function_name, lines,
index) = inspect.getouterframes(inspect.currentframe())[1]
if not check:
print("ERROR: file {0}: line {1}: {2}".format(os.path.basename(filename),line_number,str))
sys.stderr.write("ERROR: file {0}: line {1}: {2}\n".format(os.path.basename(filename),line_number,str))
assert 0
def error(str,return_value=0):
(frame, filename, line_number, function_name, lines,
index) = inspect.getouterframes(inspect.currentframe())[1]
print("ERROR: file {0}: line {1}: {2}".format(os.path.basename(filename),line_number,str))
sys.stderr.write("ERROR: file {0}: line {1}: {2}\n".format(os.path.basename(filename),line_number,str))
assert return_value==0
def warning(str):
(frame, filename, line_number, function_name, lines,
index) = inspect.getouterframes(inspect.currentframe())[1]
print("WARNING: file {0}: line {1}: {2}".format(os.path.basename(filename),line_number,str))
sys.stderr.write("WARNING: file {0}: line {1}: {2}\n".format(os.path.basename(filename),line_number,str))
def info(lev, str):