|
1 | 1 | import runs_on
|
| 2 | +import pytest |
| 3 | + |
2 | 4 | # these tests are meant to exercise QL test running on multiple platforms
|
3 | 5 | # therefore they don't rely on integration test built-in QL test running
|
4 | 6 | # (which skips `qltest.{sh,cmd}`)
|
5 | 7 |
|
6 |
| -def test_lib(codeql, rust, cwd): |
7 |
| - codeql.test.run("lib", threads=1) |
| 8 | +@pytest.fixture(autouse=True) |
| 9 | +def default_options(codeql): |
| 10 | + codeql.flags.update( |
| 11 | + threads = 1, |
| 12 | + show_extractor_output = True, |
| 13 | + check_databases = False, |
| 14 | + ) |
8 | 15 |
|
9 |
| -def test_main(codeql, rust): |
10 |
| - codeql.test.run("main", threads=1) |
| 16 | +@pytest.mark.parametrize("dir", ["lib", "main", "dependencies"]) |
| 17 | +def test(codeql, rust, dir): |
| 18 | + codeql.test.run(dir) |
11 | 19 |
|
12 | 20 | def test_failing_cargo_check(codeql, rust):
|
13 |
| - out = codeql.test.run("failing_cargo_check", threads=1, show_extractor_output=True, |
14 |
| - _assert_failure=True, _capture="stderr") |
| 21 | + out = codeql.test.run("failing_cargo_check", _assert_failure=True, _capture="stderr") |
15 | 22 | # TODO: QL test output redirection is currently broken on windows, leaving it up for follow-up work
|
16 | 23 | if not runs_on.windows:
|
17 | 24 | assert "requested cargo check failed" in out
|
0 commit comments