-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathtest_qltest.py
More file actions
26 lines (22 loc) · 950 Bytes
/
test_qltest.py
File metadata and controls
26 lines (22 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import runs_on
import pytest
# these tests are meant to exercise QL test running on multiple platforms
# therefore they don't rely on integration test built-in QL test running
# (which skips `qltest.{sh,cmd}`)
@pytest.fixture(autouse=True)
def default_options(codeql):
codeql.flags.update(
threads = 1,
show_extractor_output = True,
check_databases = False,
learn = True,
)
@pytest.mark.parametrize("dir", ["lib", "main", "dependencies"])
def test(codeql, rust, expected_files, dir):
expected_files.add(f"{dir}/functions.expected", expected=".nested.expected")
codeql.test.run(dir)
def test_failing_cargo_check(codeql, rust):
out = codeql.test.run("failing_cargo_check", _assert_failure=True, _capture="all")
# TODO: QL test output redirection is currently broken on windows, leaving it up for follow-up work
if not runs_on.windows:
assert "requested cargo check failed" in out