Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrdadh committed Aug 15, 2022
1 parent 1f8594a commit 7364b8c
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions tests/python/relay/test_build_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,23 @@
from tvm.relay.backend import Runtime, Executor, graph_executor_codegen


test_target = tvm.testing.parameter(
"c -runtime=c",
"c -system-lib",
"c -executor=aot",
"c -interface-api=c",
"c -unpacked-api=1",
"c -link-params=1",
@pytest.mark.parametrize(
"test_target,unsupported_config",
[
["c", {"runtime": "c"}],
["c", {"system-lib": 1}],
["c", {"executor": "aot"}],
["c", {"interface-api": "c"}],
["c", {"unpacked-api": 1}],
["c", {"link-params": 1}],
],
)


def test_deprecated_target_parameters(test_target, target):
unsupported_config = test_target.split(" ")[1].replace("=", " ").split(" ")[0][1:]
def test_deprecated_target_parameters(test_target, unsupported_config):
target_config = ""
for key, item in unsupported_config.items():
target_config += f"{key}={item} "
with pytest.raises(ValueError) as e_info:
Target(test_target)
Target(f"{test_target} {target_config}")
assert f"Cannot recognize '{unsupported_config}" in str(e_info.execption)


Expand Down

0 comments on commit 7364b8c

Please sign in to comment.