Skip to content

Commit f20d83b

Browse files
committed
probe: the std::endl measurement is run on demand, not with the suite
It is the only test that needs the machine's own standard library — \#include <iostream>\ is answered by whatever MSVC, libstdc++ or libc++ happens to be installed — and it costs about six seconds. A suite that is green only where a compiler is installed is not a suite, and the test is a probe rather than a regression guard: the guard for the same rule is \ eported_defects::a_declaration_two_includes_away_is_visible\, which needs no toolchain. Measured: the suite now reports \2 ignored\ in 0.00 s, and the probe still passes when asked for it with \-- --ignored\ (6.8 s).
1 parent bc113ff commit f20d83b

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

‎crates/cpp_code_analysis/tests/std_visibility_probe.rs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,20 @@ fn what_the_index_of_std_holds_and_who_can_see_it() {
270270
/// the pump refine the closure. Measured on a three-file fixture, that difference is the whole answer — see
271271
/// `reported_defects::a_declaration_two_includes_away_is_visible`. This is the same question against the real
272272
/// toolchain, where the second hop is a header that is not a project file at all.
273+
///
274+
/// # Why it is ignored by default
275+
///
276+
/// It is the only test here that needs **the machine's own standard library** — a `#include <iostream>` is answered by
277+
/// whatever MSVC, libstdc++ or libc++ is installed, so on a machine without one there is nothing to measure and on a
278+
/// machine with one it costs about six seconds. A suite that is green only where a compiler happens to be installed is
279+
/// not a suite, and this is a probe rather than a regression guard: the guard for the same rule is the fixture in
280+
/// `reported_defects`, which needs no toolchain.
281+
///
282+
/// ```text
283+
/// cargo test --release -p cpp_code_analysis --test std_visibility_probe std_endl_resolves -- --ignored
284+
/// ```
273285
#[test]
286+
#[ignore = "a probe: needs the machine's standard library, and costs ~6 s"]
274287
fn std_endl_resolves_through_the_servers_path() {
275288
let root = std::env::temp_dir().join("cppls-std-endl");
276289
let _ = std::fs::remove_dir_all(&root);

‎docs/open-questions.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ stand, so the next run starts from evidence rather than from the report again.
1212
the declaration:
1313

1414
```text
15-
$ cargo test -p cpp_code_analysis --test std_visibility_probe std_endl_resolves
15+
$ cargo test -p cpp_code_analysis --test std_visibility_probe std_endl_resolves -- --ignored
1616
test result: ok
1717
```
1818

19-
That is `std_endl_resolves_through_the_servers_path`. The fact is a `function` in scope `std`, declared at
20-
`__msvc_ostream.hpp:1007` — MSVC 18 moved `endl` one hop past `<ostream>`, which is what made this look like a
21-
visibility problem.
19+
That is `std_endl_resolves_through_the_servers_path`, an **ignored probe**: it needs the machine's own standard
20+
library and costs about six seconds, so it is run on demand rather than with the suite. The fact is a `function` in
21+
scope `std`, declared at `__msvc_ostream.hpp:1007` — MSVC 18 moved `endl` one hop past `<ostream>`, which is what
22+
made this look like a visibility problem.
2223

2324
* **The `NotDeclaredHere` this file used to record was an artefact of `inspect`.** `inspect` asks for **one** file's
2425
reading; a header two hops out then has no summary, so the visibility walk enters it and finds nothing to report.

0 commit comments

Comments
 (0)