from IDF.IDFDUT import IDFDUT
+def format_case_id(chip, case_name):
+ return "{}.{}".format(chip, case_name)
+
+
def idf_example_test(app=Example, dut=IDFDUT, chip="ESP32", module="examples", execution_time=1,
level="example", erase_nvs=True, **kwargs):
"""
except AttributeError:
pass
- return TinyFW.test_method(app=app, dut=dut, chip=chip, module=module,
- execution_time=execution_time, level=level, **kwargs)
+ original_method = TinyFW.test_method(app=app, dut=dut, chip=chip, module=module,
+ execution_time=execution_time, level=level, **kwargs)
+
+ def test(func):
+ test_func = original_method(func)
+ test_func.case_info["ID"] = format_case_id(chip, test_func.case_info["name"])
+ return test_func
+
+ return test
def idf_unit_test(app=UT, dut=IDFDUT, chip="ESP32", module="unit-test", execution_time=1,
except AttributeError:
pass
- return TinyFW.test_method(app=app, dut=dut, chip=chip, module=module,
- execution_time=execution_time, level=level, **kwargs)
+ original_method = TinyFW.test_method(app=app, dut=dut, chip=chip, module=module,
+ execution_time=execution_time, level=level, **kwargs)
+
+ def test(func):
+ test_func = original_method(func)
+ test_func.case_info["ID"] = format_case_id(chip, test_func.case_info["name"])
+ return test_func
+
+ return test
def log_performance(item, value):