Skip to content

Commit 74fa980

Browse files
committed
Rust: Update the tests and exclude total files from rust/summary/reduced-summary-statistics.
1 parent ed380dc commit 74fa980

5 files changed

Lines changed: 12 additions & 5 deletions

File tree

rust/ql/integration-tests/hello-workspace/summary.cargo.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Extraction errors | 0 |
22
| Extraction warnings | 0 |
3-
| Files extracted - total | 4 |
3+
| Files extracted - total user | 4 |
44
| Files extracted - with errors | 0 |
55
| Files extracted - without errors | 4 |
66
| Files extracted - without errors % | 100 |

rust/ql/integration-tests/hello-workspace/summary.rust-project.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Extraction errors | 0 |
22
| Extraction warnings | 0 |
3-
| Files extracted - total | 4 |
3+
| Files extracted - total user | 4 |
44
| Files extracted - with errors | 0 |
55
| Files extracted - without errors | 4 |
66
| Files extracted - without errors % | 100 |

rust/ql/src/queries/summary/Stats.qll

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ predicate extractionStats(string key, int value) {
142142
key = "Extraction warnings" and
143143
value = count(ExtractionWarning w | not exists(w.getLocation()) or w.getLocation().fromSource())
144144
or
145-
key = "Files extracted - total" and value = count(File f)
146-
or
147145
key = "Files extracted - total user" and value = count(ExtractedFile f | exists(f.getRelativePath()))
148146
or
149147
key = "Files extracted - with errors" and
@@ -173,6 +171,13 @@ predicate extractionStats(string key, int value) {
173171
value = count(MacroCall mc | mc.fromSource() and not mc.hasMacroCallExpansion())
174172
}
175173

174+
/**
175+
* Gets further summary statistics about extraction.
176+
*/
177+
predicate extractionStatsExtra(string key, int value) {
178+
key = "Files extracted - total" and value = count(File f)
179+
}
180+
176181
/**
177182
* Gets summary statistics about inconsistencies.
178183
*/

rust/ql/src/queries/summary/SummaryStats.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ where
1515
or
1616
extractionStats(key, value)
1717
or
18+
extractionStatsExtra(key, value)
19+
or
1820
inconsistencyStats(key, value)
1921
or
2022
typeInferenceInconsistencyStats(key, value)

rust/ql/test/query-tests/diagnostics/SummaryStatsReduced.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Extraction errors | 0 |
22
| Extraction warnings | 7 |
3-
| Files extracted - total | 7 |
3+
| Files extracted - total user | 7 |
44
| Files extracted - with errors | 3 |
55
| Files extracted - without errors | 4 |
66
| Files extracted - without errors % | 57 |

0 commit comments

Comments
 (0)