| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
import pytest |
| 20 |
|
| 21 |
import common |
| 22 |
|
| 23 |
|
| 24 |
def pytest_addoption(parser): |
| 25 |
parser.addoption('--classpath', action="store", default=None, |
| 26 |
help="Use a jar rather than the thunks") |
| 27 |
parser.addoption('--convertStrings', action="store_true", |
| 28 |
default=False, help="Give convert strings to startJVMs") |
| 29 |
parser.addoption('--jacoco', action="store_true", |
| 30 |
default=False, help="Add Java coverage tool") |
| 31 |
parser.addoption('--checkjni', action="store_true", |
| 32 |
default=False, help="Enable JNI checking") |
| 33 |
parser.addoption('--fast', action="store_true", |
| 34 |
default=False, help="Skip subrun tests") |
| 35 |
|
| 36 |
|
| 37 |
def pytest_collection_modifyitems(config, items): |
| 38 |
if config.getoption("--fast"): |
| 39 |
common.fast = True |
| 40 |
|
| 41 |
|
| 42 |
@pytest.fixture(scope="class") |
| 43 |
def common_opts(request): |
| 44 |
request.cls._classpath = request.config.getoption("--classpath") |
| 45 |
request.cls._convertStrings = request.config.getoption("--convertStrings") |
| 46 |
request.cls._jacoco = request.config.getoption("--jacoco") |
| 47 |
request.cls._checkjni = request.config.getoption("--checkjni") |