mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
panic: allow running specific test cases from command line
Small quality-of-life improvement, make it easier to run specific test cases, when debugging the tests locally. Take the optional list of test cases to run from the command line.
This commit is contained in:
parent
709730317b
commit
481409ec05
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
import panic_tests as test
|
||||
from test_panic_util.test_panic_util import panic_test, run_all
|
||||
|
||||
@ -247,4 +248,4 @@ def test_coredump_abort_flash_bin_crc(env, extra_data):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run_all(__file__)
|
||||
run_all(__file__, sys.argv[1:])
|
||||
|
@ -159,14 +159,19 @@ def get_dut(env, app_config_name, test_name, qemu_wdt_enable=False):
|
||||
return dut
|
||||
|
||||
|
||||
def run_all(filename):
|
||||
""" Helper function to run all test cases defined in a file; to be called from __main__. """
|
||||
def run_all(filename, case_filter=[]):
|
||||
""" Helper function to run test cases defined in a file; to be called from __main__.
|
||||
case_filter is an optional list of case names to run.
|
||||
If not specified, all test cases are run.
|
||||
"""
|
||||
TinyFW.set_default_config(env_config_file=None, test_suite_name=TEST_SUITE)
|
||||
test_methods = SearchCases.Search.search_test_cases(filename)
|
||||
test_methods = filter(lambda m: not m.case_info["ignore"], test_methods)
|
||||
test_cases = CaseConfig.Parser.apply_config(test_methods, None)
|
||||
tests_failed = []
|
||||
for case in test_cases:
|
||||
if case_filter and case.test_method.__name__ not in case_filter:
|
||||
continue
|
||||
result = case.run()
|
||||
if not result:
|
||||
tests_failed.append(case)
|
||||
|
Loading…
Reference in New Issue
Block a user