mirror of https://github.com/VLSIDA/OpenRAM.git
Output debug warnings and errors to stderr. Clean up regress script a bit.
This commit is contained in:
parent
c6503dd771
commit
b3732f4fcf
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -28,5 +28,6 @@ suite = unittest.TestSuite()
|
|||
load = unittest.defaultTestLoader.loadTestsFromModule
|
||||
suite.addTests(map(load, modules))
|
||||
|
||||
ret = not unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful()
|
||||
sys.exit(ret)
|
||||
test_runner = unittest.TextTestRunner(verbosity=2,stream=sys.stderr)
|
||||
test_result = test_runner.run(suite)
|
||||
sys.exit(not test_result.wasSuccessful())
|
||||
|
|
|
|||
Loading…
Reference in New Issue