Rust: reinstate extraction of test code

Users will still be able to opt out:
* for unit tests, by providing the `cargo_cfg_overrides=-test` extractor
  option
* for integration tests, by excluding the test files from the analysis
  using `paths-ignore` in the codescanning configuration file

We may want to revisit whether we want a single option for both. Also
further work will be needed to restrict our security queries to non-test
code on the QL side.
This commit is contained in:
Paolo Tranquilli
2024-12-20 14:12:41 +01:00
parent 90d8fb1a05
commit 485586f780
8 changed files with 47 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
use std::path::PathBuf;
use codeql_extractor::autobuilder;
use std::path::PathBuf;
fn main() -> std::io::Result<()> {
let database = std::env::var("CODEQL_EXTRACTOR_RUST_WIP_DATABASE")
@@ -7,7 +7,7 @@ fn main() -> std::io::Result<()> {
autobuilder::Autobuilder::new("rust", PathBuf::from(database))
.include_extensions(&[".rs"])
.exclude_globs(&["**/.git", "**/tests/**"])
.exclude_globs(&["**/.git"])
.size_limit("5m")
.run()
}