Files
codeql/rust/ql/integration-tests/qltest/test.py
Paolo Tranquilli 75375be7ac Rust: add optional dependencies to ql tests
Also accept `options.yml` and `options.yaml` files as well for test options,
to get YAML syntax highlighting. In a follow up PR we might make the extension
mandatory.
2024-11-18 09:42:01 +01:00

25 lines
834 B
Python

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,
)
@pytest.mark.parametrize("dir", ["lib", "main", "dependencies"])
def test(codeql, rust, dir):
codeql.test.run(dir)
def test_failing_cargo_check(codeql, rust):
out = codeql.test.run("failing_cargo_check", _assert_failure=True, _capture="stderr")
# 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