Skip to content

Commit f62a3ac

Browse files
authored
Merge pull request #18491 from hvitved/rust/ql-test-recurse
Rust: Include nested `.rs` files in `codeql test run`
2 parents 3ceec93 + e60468e commit f62a3ac

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

rust/extractor/src/qltest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ path = "main.rs"
5151
}
5252

5353
fn set_sources(config: &mut Config) -> anyhow::Result<()> {
54-
let path_iterator = glob("*.rs").context("globbing test sources")?;
54+
let path_iterator = glob("**/*.rs").context("globbing test sources")?;
5555
config.inputs = path_iterator
5656
.collect::<Result<Vec<_>, _>>()
5757
.context("fetching test sources")?;

rust/ql/test/extractor-tests/File/File.expected

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
| a_file.rs:0:0:0:0 | a_file.rs | fromSource: yes |
33
| another_file.rs:0:0:0:0 | another_file.rs | fromSource: yes |
44
| lib.rs:0:0:0:0 | lib.rs | fromSource: yes |
5+
| nested.rs:0:0:0:0 | nested.rs | fromSource: yes |
6+
| nested/file.rs:0:0:0:0 | nested/file.rs | fromSource: yes |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mod file;

rust/ql/test/extractor-tests/File/nested/file.rs

Whitespace-only changes.

0 commit comments

Comments
 (0)