mehrdadh commented on code in PR #12818: URL: https://github.com/apache/tvm/pull/12818#discussion_r984058260
########## tests/micro/project_api/test_project_api.py: ########## @@ -0,0 +1,104 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import sys + +import tvm +from tvm.micro.project_api import server + +API_GENERATE_PROJECT = "generate_project" +API_BUILD = "build" +API_FLASH = "flash" +API_OPEN_TRANSPORT = "open_transport" + +PLATFORM_ARDUINO = "arduino" +PLATFORM_ZEPHYR = "zephyr" + + +platform = tvm.testing.parameter(PLATFORM_ARDUINO, PLATFORM_ZEPHYR) + + +def test_default_options_exist(platform): + sys.path.insert(0, tvm.micro.get_microtvm_template_projects(platform)) + import microtvm_api_server + + platform_options = microtvm_api_server.PROJECT_OPTIONS + default_options = server.default_project_options() + + option_names = [] + for option in platform_options: + option_names.append(option.name) + + for option in default_options: + assert option.name in option_names + + +def test_default_options_requirements(platform): Review Comment: thanks! I updated the test. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
