Skip to content

Commit f187f9f

Browse files
committed
fix arduino tests, broken by #9246.
1 parent 5f4d538 commit f187f9f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

apps/microtvm/arduino/template_project/microtvm_api_server.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,12 @@ def _disassemble_mlf(self, mlf_tar_path, source_dir):
203203

204204
# Copy C files from model. The filesnames and quantity
205205
# depend on the target string, so we just copy all c files
206+
include_dir = mlf_unpacking_dir / "codegen" / "host" / "include"
207+
for file in include_dir.rglob("*.h"):
208+
shutil.copy(file, model_dir)
209+
206210
source_dir = mlf_unpacking_dir / "codegen" / "host" / "src"
207-
for file in source_dir.rglob(f"*.c"):
211+
for file in source_dir.rglob("*.c"):
208212
shutil.copy(file, model_dir)
209213

210214
# Return metadata.json for use in templating

tests/micro/arduino/test_arduino_workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_project_folder_structure(project_dir, project):
7171
def test_project_model_integrity(project_dir, project):
7272
model_dir = project_dir / "src" / "model"
7373
assert _get_directory_elements(model_dir) == set(
74-
["default_lib0.c", "default_lib1.c", "model.tar"]
74+
["tvmgen_default.h", "default_lib0.c", "default_lib1.c", "model.tar"]
7575
)
7676

7777

tests/micro/arduino/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def make_kws_project(board, arduino_cli_cmd, tvm_debug, workspace_dir):
8282
mod, params = relay.frontend.from_tflite(tflite_model)
8383
target = tvm.target.target.micro(model)
8484
runtime = Runtime("crt")
85-
executor = Executor("aot", {"unpacked-api": True})
85+
executor = Executor("aot", {"unpacked-api": True, "interface-api": "c"})
8686

8787
with tvm.transform.PassContext(opt_level=3, config={"tir.disable_vectorize": True}):
8888
mod = relay.build(mod, target, runtime=runtime, executor=executor, params=params)

0 commit comments

Comments
 (0)