diff --git a/.github/workflows/compiler-build.yml b/.github/workflows/compiler-build.yml index 038585ffdb..7b01cb1122 100644 --- a/.github/workflows/compiler-build.yml +++ b/.github/workflows/compiler-build.yml @@ -256,6 +256,7 @@ jobs: dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/tflite_basic.xml pytest tests/importer/tflite_/basic/ --doctest-modules --junitxml=test_results/tflite_basic.xml dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/tflite_combine.xml pytest tests/importer/tflite_/combine/ --doctest-modules --junitxml=test_results/tflite_combine.xml dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/tflite_model.xml pytest tests/importer/tflite_/model/ --doctest-modules --junitxml=test_results/tflite_model.xml + dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/tflite_model.xml pytest tests/other --doctest-modules --junitxml=test_results/tflite_model.xml dotnet-coverage merge -o coverage.integration.xml -f cobertura -r coverage/*.xml - name: Upload Coverage diff --git a/tests/other/test_compile_option_default_value.py b/tests/other/test_compile_option_default_value.py new file mode 100644 index 0000000000..e0d119c649 --- /dev/null +++ b/tests/other/test_compile_option_default_value.py @@ -0,0 +1,27 @@ +import nncase + +def read_model_file(model_file): + with open(model_file, 'rb') as f: + model_content = f.read() + return model_content + +def compile_kmodel(model_path): + import_options = nncase.ImportOptions() + compile_options = nncase.CompileOptions() + compile_options.target = "cpu" + compiler = nncase.Compiler(compile_options) + model_content = read_model_file(model_path) + if model_path.split(".")[-1] == "onnx": + compiler.import_onnx(model_content, import_options) + elif model_path.split(".")[-1] == "tflite": + compiler.import_tflite(model_content, import_options) + compiler.compile() + compiler.gencode_tobytes() + +# test failed when the conf in toml but do not set the default value of compile option +def test_compile_option_default_value(): + model_path = "../../examples/user_guide/test.onnx" + kmodel_path = compile_kmodel(model_path) + +if __name__ == "__main__": + pytest.main(['-vv', 'test_compile_option_default_value'])