blob: 780a0492e180621122d8b91e03847ae76506ed4e [file] [log] [blame]
Jan Eilers2cd18472020-12-15 10:42:38 +00001# Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
2# SPDX-License-Identifier: MIT
3import pytest
4import os
5
6
7@pytest.fixture(scope="module")
8def test_data_folder(request):
9 """
10 This fixture returns path to the folder with the shared test resources
11 """
12 return str(os.path.join(request.fspath.dirname, "test_data"))
13
14
15def pytest_addoption(parser):
16 """
17 Adds the program option 'delegate-dir' to pytest
18 """
19 parser.addoption("--delegate-dir",
20 action="append",
21 help="Directory of the armnn tflite delegate library",
22 required=True)
23
24
25def pytest_generate_tests(metafunc):
26 """
27 Makes the program option 'delegate-dir' available to all tests as a function fixture
28 """
29 if "delegate_dir" in metafunc.fixturenames:
30 metafunc.parametrize("delegate_dir", metafunc.config.getoption("delegate_dir"))