| import os |
| import sys |
| |
| import lit.formats |
| import lit.llvm |
| |
| # Configuration file for the 'lit' test runner. |
| lit.llvm.initialize(lit_config, config) |
| |
| config.name = "Model tests" |
| config.test_format = lit.formats.ShTest(True) |
| |
| config.suffixes = [".txt"] |
| config.excludes = [ |
| "CMakeLists.txt" |
| ] |
| dir_path = os.path.dirname(os.path.realpath(__file__)) |
| config.environment["ROOTDIR"] = dir_path + "/../../.." |
| config.environment["OUT"] = config.environment["ROOTDIR"] + "/out" |
| |
| qemu_cmd = ( |
| "%s/sw/vec/scripts/test_runner.py" |
| " qemu --qemu-path %s/host/qemu/qemu-system-riscv32" |
| % (config.environment["ROOTDIR"], config.environment["OUT"])) |
| renode_cmd = ( |
| "%s/sw/vec/scripts/test_runner.py" |
| " renode --renode-path %s/host/renode/renode" |
| % (config.environment["ROOTDIR"], config.environment["OUT"])) |
| |
| config.test_exec_root = config.environment["OUT"] + "/springbok_iree/tests" |
| |
| # Enable features based on -D FEATURES=internal syntax. FEATURE is used in the |
| # REQUIRES field in the lit test. Can add multiple features with comma delimiter. |
| features_param = lit_config.params.get("FEATURES") |
| if features_param: |
| config.available_features.update(features_param.split(',')) |
| |
| runner = lit_config.params.get("RUNNER") |
| |
| if runner and runner == "qemu": |
| config.environment["TEST_RUNNER_CMD"] = qemu_cmd |
| else: |
| config.environment["TEST_RUNNER_CMD"] = renode_cmd |