diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2023-10-09 16:31:13 +0100 |
---|---|---|
committer | Jeremy Johnson <jeremy.johnson@arm.com> | 2023-10-16 15:08:36 +0100 |
commit | 65ba809d7a8b4ddd0a51f6c76ad0afc5f417de07 (patch) | |
tree | 249926aeeccfb0dac60f27967e5d01001adc5e33 /verif/tests/test_tosa_run_tests_mocksut.py | |
parent | 9c2fe6e129e4d176c3e14f172b92efe985af7c78 (diff) | |
download | reference_model-65ba809d7a8b4ddd0a51f6c76ad0afc5f417de07.tar.gz |
Data generator library python interface added
Added support for using generate library in tosa_verif_build_tests
and tosa_verif_run_tests tosa tool scripts.
Reduced scope of compliance test creation and verification to
the supported type of FP32.
Fix missing virtual destructor warning in generate_dot_product.h and
add config file for generate library.
Simple pytests included to check python interface.
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Change-Id: I6cdad9b00660d6ddc8bd07fdea813937fb48626a
Diffstat (limited to 'verif/tests/test_tosa_run_tests_mocksut.py')
-rw-r--r-- | verif/tests/test_tosa_run_tests_mocksut.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/verif/tests/test_tosa_run_tests_mocksut.py b/verif/tests/test_tosa_run_tests_mocksut.py index fb4a811..f4437b2 100644 --- a/verif/tests/test_tosa_run_tests_mocksut.py +++ b/verif/tests/test_tosa_run_tests_mocksut.py @@ -1,4 +1,4 @@ -"""Tests for tosa_verif_run_tests.py.""" +"""Mock SUT tests for tosa_verif_run_tests.py.""" # Copyright (c) 2021-2023, ARM Limited. # SPDX-License-Identifier: Apache-2.0 import json @@ -55,16 +55,33 @@ def _delete_desc_json(file: Path): file.unlink() +def _create_ifm_files(files): + """Create empty input files.""" + for name in files: + file = Path(__file__).parent / name + with open(file, "w") as fd: + fd.write("empty") + + +def _delete_ifm_files(files): + """Delete empty input files.""" + for name in files: + file = Path(__file__).parent / name + file.unlink() + + @pytest.fixture def testDir() -> str: """Set up a mock expected pass test.""" print("SET UP - testDir") _create_fake_ref_model() + _create_ifm_files(TEST_DESC["ifm_file"]) file = _create_desc_json(TEST_DESC) yield file.parent print("TEAR DOWN - testDir") _delete_desc_json(file) _delete_fake_ref_model() + _delete_ifm_files(TEST_DESC["ifm_file"]) @pytest.fixture @@ -74,11 +91,13 @@ def testDirExpectedFail() -> str: _create_fake_ref_model() fail = deepcopy(TEST_DESC) fail["expected_failure"] = True + _create_ifm_files(TEST_DESC["ifm_file"]) file = _create_desc_json(fail) yield file.parent print("TEAR DOWN - testDirExpectedFail") _delete_desc_json(file) _delete_fake_ref_model() + _delete_ifm_files(TEST_DESC["ifm_file"]) @pytest.fixture @@ -89,11 +108,13 @@ def testDirMultiOutputs() -> str: out = deepcopy(TEST_DESC) out["ofm_name"].append("tr1") out["ofm_file"].append("test-result-1.npy") + _create_ifm_files(TEST_DESC["ifm_file"]) file = _create_desc_json(out) yield file.parent print("TEAR DOWN - testDirMultiOutputs") _delete_desc_json(file) _delete_fake_ref_model() + _delete_ifm_files(TEST_DESC["ifm_file"]) def _get_default_argv(testDir: Path, graphResult: str) -> list: |