2018-04-05 05:10:23 +08:00
|
|
|
|
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
import sys
|
|
|
|
print(sys.argv)
|
|
|
|
|
|
|
|
sys._pwndbg_unittest_run = True
|
|
|
|
|
2018-07-09 01:03:03 +08:00
|
|
|
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
|
|
|
|
test = os.environ['PWNDBG_LAUNCH_TEST']
|
|
|
|
|
|
|
|
test = os.path.join(CURRENT_DIR, test)
|
2018-04-05 05:10:23 +08:00
|
|
|
|
|
|
|
# If you want to debug tests locally, add '--pdb' here
|
2018-07-09 01:03:03 +08:00
|
|
|
args = [test, '-vvv', '-s', '--showlocals', '--color=yes']
|
2018-04-05 05:10:23 +08:00
|
|
|
|
|
|
|
print('Launching pytest with args: %s' % args)
|
|
|
|
|
|
|
|
return_code = pytest.main(args)
|
|
|
|
|
|
|
|
if return_code != 0:
|
|
|
|
print('-' * 80)
|
2020-04-27 20:02:09 +08:00
|
|
|
print('If you want to debug tests locally, modify {} and add --pdb to its args'.format(__file__))
|
2018-04-05 05:10:23 +08:00
|
|
|
print('-' * 80)
|
|
|
|
|
|
|
|
sys.exit(return_code)
|