| 1 | """ |
| 2 | This conftest adds options used by test/test_random and |
| 3 | x86/test/test_zll_random. |
| 4 | """ |
| 5 | |
| 6 | import random |
| 7 | |
| 8 | def pytest_addoption(parser): |
| 9 | group = parser.getgroup("JIT options") |
| 10 | group.addoption('--slow', action="store_true", |
| 11 | default=False, dest="run_slow_tests", |
| 12 | help="run all the compiled tests (instead of just a few)") |
| 13 | |
| 14 | group = parser.getgroup('random test options') |
| 15 | group.addoption('--random-seed', action="store", type=int, |
| 16 | default=random.randrange(0, 10000), |
| 17 | dest="randomseed", |
| 18 | help="choose a fixed random seed") |
| 19 | group.addoption('--backend', action="store", |
| 20 | default='llgraph', |
| 21 | choices=['llgraph', 'cpu'], |
| 22 | dest="backend", |
| 23 | help="select the backend to run the functions with") |
| 24 | group.addoption('--block-length', action="store", type=int, |
| 25 | default=30, |
| 26 | dest="block_length", |
| 27 | help="insert up to this many operations in each test") |
| 28 | group.addoption('--n-vars', action="store", type=int, |
| 29 | default=10, |
| 30 | dest="n_vars", |
| 31 | help="supply this many randomly-valued arguments to " |
| 32 | "the function") |
| 33 | group.addoption('--repeat', action="store", type=int, |
| 34 | default=15, |
| 35 | dest="repeat", |
| 36 | help="run the test this many times"), |
| 37 | group.addoption('--output', '-O', action="store", type=str, |
| 38 | default="", dest="output", |
| 39 | help="dump output to a file") |
| 40 | group.addoption('--z3-timeout', action="store", type=int, |
| 41 | default=500, dest="z3timeout", |
| 42 | help="give timeout that Z3 should use for proving in milliseconds per condition") |