From 9b5b2bb002966a6fd2078641a26d8a4f1e7efae8 Mon Sep 17 00:00:00 2001 From: Andrey Somsikov Date: Thu, 4 Feb 2021 10:35:24 +0300 Subject: [PATCH] Add collector path for cond. comp. tests (#4159) --- tests/conditional_compilation/conftest.py | 12 ++++++++++++ tests/conditional_compilation/test_collect.py | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/conditional_compilation/conftest.py b/tests/conditional_compilation/conftest.py index 881e5d273d699e..7439aa53e7a58a 100644 --- a/tests/conditional_compilation/conftest.py +++ b/tests/conditional_compilation/conftest.py @@ -48,6 +48,12 @@ def pytest_addoption(parser): type=Path, help="Path to the benchmark_app tool", ) + parser.addoption( + "--collector_dir", + required=True, + type=Path, + help="Path to a directory with a collector binary", + ) parser.addoption( "-A", "--artifacts", @@ -89,6 +95,12 @@ def benchmark_app(request): return request.config.getoption("benchmark_app") +@pytest.fixture(scope="session") +def collector_dir(request): + """Fixture function for command-line option.""" + return request.config.getoption("collector_dir") + + @pytest.fixture(scope="session") def artifacts(request): """Fixture function for command-line option.""" diff --git a/tests/conditional_compilation/test_collect.py b/tests/conditional_compilation/test_collect.py index 4f85b8efcf4e6e..1111f041022617 100644 --- a/tests/conditional_compilation/test_collect.py +++ b/tests/conditional_compilation/test_collect.py @@ -11,7 +11,7 @@ from proc_utils import cmd_exec # pylint: disable=import-error -def test_cc_collect(model, sea_runtool, benchmark_app, artifacts): +def test_cc_collect(model, sea_runtool, benchmark_app, collector_dir, artifacts): """ Test conditional compilation statistics collection """ out = artifacts / model.parent / model.stem @@ -26,6 +26,7 @@ def test_cc_collect(model, sea_runtool, benchmark_app, artifacts): str(sea_runtool), f"-o={out}", "-f=stat", + f"--bindir={collector_dir}", "!", str(benchmark_app), "-d=CPU",