mirror of
https://github.com/espressif/openthread.git
synced 2026-08-18 00:19:52 +00:00
[toranj] update verify() to print line-no and test-name (#2662)
This commit is contained in:
committed by
Jonathan Hui
parent
7512e23b59
commit
1bb139121c
@@ -34,6 +34,7 @@ import weakref
|
||||
import subprocess
|
||||
import socket
|
||||
import asyncore
|
||||
import inspect
|
||||
|
||||
#----------------------------------------------------------------------------------------------------------------------
|
||||
# wpantund properties
|
||||
@@ -724,8 +725,10 @@ class AsyncReceiver(asyncore.dispatcher):
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def verify(condition):
|
||||
"""Verifies that a `condition` is true, otherwise exits"""
|
||||
if not condition:
|
||||
print 'verify() failed'
|
||||
calling_frame = inspect.currentframe().f_back
|
||||
print 'verify() failed at line {} in "{}"'.format(calling_frame.f_lineno, calling_frame.f_code.co_filename)
|
||||
exit(1)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user