diff options
Diffstat (limited to 'test/conftest.py')
-rw-r--r-- | test/conftest.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/conftest.py b/test/conftest.py new file mode 100644 index 0000000000..1a043a91fa --- /dev/null +++ b/test/conftest.py @@ -0,0 +1,27 @@ +import pytest +import os +from .py import helper + + +@pytest.fixture(scope='function') +def barebox(strategy, target): + strategy.transition('barebox') + return target.get_driver('BareboxDriver') + +@pytest.fixture(scope="session") +def barebox_config(strategy, target): + strategy.transition('barebox') + command = target.get_driver("BareboxDriver") + return helper.get_config(command) + +def pytest_configure(config): + if 'LG_BUILDDIR' not in os.environ: + if 'KBUILD_OUTPUT' in os.environ: + os.environ['LG_BUILDDIR'] = os.environ['KBUILD_OUTPUT'] + elif os.path.isdir('build'): + os.environ['LG_BUILDDIR'] = os.path.realpath('build') + else: + os.environ['LG_BUILDDIR'] = os.getcwd() + + if os.environ['LG_BUILDDIR'] is not None: + os.environ['LG_BUILDDIR'] = os.path.realpath(os.environ['LG_BUILDDIR']) |