diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-12-26 18:07:45 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-12-26 18:07:45 (GMT) |
| commit | 2034340f3bc4fc97cb8d097d7e1a1d810028fb0f (patch) | |
| tree | 21af07a7748af6d6fab6d4aea9363be5984eeaa3 /wasp/boards/simulator/test_smoke.py | |
| parent | 421a32de58afb8932bdee5b3ad95ad2059bf5951 (diff) | |
tests: Auto-discover applications and try to switch to them
Currently `make check` doesn't test any not-default applications.
Fix this by automatically discovering constructors and ensure that the
application can be started and stopped without generating an exception.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/boards/simulator/test_smoke.py')
| -rw-r--r-- | wasp/boards/simulator/test_smoke.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/wasp/boards/simulator/test_smoke.py b/wasp/boards/simulator/test_smoke.py index 4d8307b..26e4318 100644 --- a/wasp/boards/simulator/test_smoke.py +++ b/wasp/boards/simulator/test_smoke.py @@ -48,6 +48,30 @@ def test_app(system, name): system.step() system.switch(system.quick_ring[0]) +def test_constructor(system, constructor): + # Special case for the notification app + if 'NotificationApp' in str(constructor): + wasp.system.notify(wasp.watch.rtc.get_uptime_ms(), + { + "src":"testcase", + "title":"A test", + "body":"This is a long message containingaverylongwordthatdoesnotfit and lots of other contents as well." + }) + + try: + system.switch(constructor()) + system.step() + system.step() + wasp.watch.touch.press(120, 120) + system.step() + system.step() + system.switch(system.quick_ring[0]) + except FileNotFoundError: + # Some apps intend to generate exceptions during the constructor + # if they don't have required files available + if 'HaikuApp' not in str(constructor): + raise + def test_stopwatch(system): system.switch(system.apps['Timer']) |
