diff --git a/tests/micro/zephyr/test_zephyr.py b/tests/micro/zephyr/test_zephyr.py index cf9447bc2b10..18587acd46ae 100644 --- a/tests/micro/zephyr/test_zephyr.py +++ b/tests/micro/zephyr/test_zephyr.py @@ -33,6 +33,7 @@ import tvm import tvm.rpc import tvm.micro +import tvm.testing import tvm.relay as relay from tvm.micro.contrib import zephyr @@ -124,6 +125,7 @@ def _make_add_sess(model, zephyr_board, west_cmd, build_config): # The same test code can be executed on both the QEMU simulation and on real hardware. +@tvm.testing.requires_micro def test_compile_runtime(platform, west_cmd, skip_build, tvm_debug): """Test compiling the on-device runtime.""" @@ -147,6 +149,7 @@ def test_basic_add(sess): test_basic_add(sess) +@tvm.testing.requires_micro def test_platform_timer(platform, west_cmd, skip_build, tvm_debug): """Test compiling the on-device runtime.""" @@ -175,6 +178,7 @@ def test_basic_add(sess): test_basic_add(sess) +@tvm.testing.requires_micro def test_relay(platform, west_cmd, skip_build, tvm_debug): """Testing a simple relay graph""" model, zephyr_board = PLATFORMS[platform] @@ -204,6 +208,7 @@ def test_relay(platform, west_cmd, skip_build, tvm_debug): tvm.testing.assert_allclose(result, x_in * x_in + 1) +@tvm.testing.requires_micro def test_onnx(platform, west_cmd, skip_build, tvm_debug): """Testing a simple ONNX model.""" model, zephyr_board = PLATFORMS[platform] @@ -334,6 +339,7 @@ def check_result( tvm.testing.assert_allclose(out.numpy(), results[idx], rtol=TOL, atol=TOL) +@tvm.testing.requires_micro def test_byoc_microtvm(platform, west_cmd, skip_build, tvm_debug): """This is a simple test case to check BYOC capabilities of microTVM""" model, zephyr_board = PLATFORMS[platform] @@ -410,6 +416,7 @@ def _make_add_sess_with_shape(model, zephyr_board, west_cmd, shape, build_config pytest.param((16 * 1024,), id="(16*1024)"), ], ) +@tvm.testing.requires_micro def test_rpc_large_array(platform, west_cmd, skip_build, tvm_debug, shape): """Test large RPC array transfer.""" model, zephyr_board = PLATFORMS[platform] diff --git a/tests/micro/zephyr/test_zephyr_aot.py b/tests/micro/zephyr/test_zephyr_aot.py index afdbdc590de0..ad4776e9c6b3 100644 --- a/tests/micro/zephyr/test_zephyr_aot.py +++ b/tests/micro/zephyr/test_zephyr_aot.py @@ -29,6 +29,7 @@ import tvm import tvm.rpc import tvm.micro +import tvm.testing import tvm.relay as relay from tvm.micro.contrib import zephyr @@ -152,6 +153,7 @@ def _get_message(fd, expr: str): return data +@tvm.testing.requires_micro def test_tflite(platform, west_cmd, skip_build, tvm_debug): """Testing a TFLite model.""" model, zephyr_board = PLATFORMS[platform] @@ -213,7 +215,11 @@ def test_tflite(platform, west_cmd, skip_build, tvm_debug): assert result == 8 +@tvm.testing.requires_micro def test_qemu_make_fail(platform, west_cmd, skip_build, tvm_debug): + if platform not in ["host", "mps2_an521"]: + pytest.skip(msg="Only for QEMU targets.") + """Testing QEMU make fail.""" model, zephyr_board = PLATFORMS[platform] build_config = {"skip_build": skip_build, "debug": tvm_debug}