Skip to content

Commit 450f599

Browse files
committed
add test case
Change-Id: I6a6bc9a023afd5a62a3c932dbc3ad535815b3963
1 parent 1924b41 commit 450f599

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/python/driver/tvmc/test_compiler.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import re
1919
import shutil
2020
import tarfile
21+
import subprocess
2122
from os import path
2223

2324
from unittest import mock
@@ -429,6 +430,32 @@ def test_compile_tflite_module_with_external_codegen_ethos_n78(tflite_mobilenet_
429430
assert os.path.exists(dumps_path)
430431

431432

433+
@tvm.testing.requires_ethosn
434+
def test_cli_compile_tflite_module_with_external_codegen_ethos_n78(
435+
tmpdir_factory, tflite_mobilenet_v1_1_quant
436+
):
437+
pytest.importorskip("tflite")
438+
tmp_dir = tmpdir_factory.mktemp("module")
439+
package_path = tmp_dir.join("module.tar")
440+
441+
subprocess.run(
442+
[
443+
"tvmc",
444+
"compile",
445+
"--target='ethos-n -variant=n78, llvm'",
446+
"--dump-code=relay",
447+
f"-o={package_path}",
448+
tflite_mobilenet_v1_1_quant,
449+
],
450+
check=True,
451+
capture_output=True,
452+
)
453+
454+
assert os.path.exists(package_path)
455+
dumps_path = package_path + ".relay"
456+
assert os.path.exists(dumps_path)
457+
458+
432459
@tvm.testing.requires_vitis_ai
433460
def test_compile_tflite_module_with_external_codegen_vitis_ai(tflite_mobilenet_v1_1_quant):
434461
pytest.importorskip("tflite")

0 commit comments

Comments
 (0)