refactor(esp_event): improved esp_event unit tests

* Decomposed tests into atomic unit tests
* Made tests less time-dependent, hence more robust
  on different platforms (ESP32, QEMU, Linux)
* Ported most of the tests to linux
* Removed some redundant tests
* Fixed bug the tests discovered
* Simplified parts of the tests to be more clear
* Partially used C++ to simplify setup/teardown
* Unified setup/teardown in general
This commit is contained in:
Jakob Hasse
2023-07-19 19:18:11 +08:00
parent 38bf2a5d2f
commit 8df4625c84
12 changed files with 2372 additions and 2291 deletions

View File

@@ -35,3 +35,11 @@ def test_esp_event_qemu_esp32c3(dut: Dut) -> None:
for case in dut.test_menu:
if 'qemu-ignore' not in case.groups and not case.is_ignored and case.type == 'normal':
dut._run_normal_case(case)
@pytest.mark.linux
@pytest.mark.host_test
def test_esp_event_posix_simulator(dut: Dut) -> None:
dut.expect_exact('Press ENTER to see the list of tests.')
dut.write('*')
dut.expect(r'\d{2} Tests 0 Failures 0 Ignored', timeout=120)