You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
compiletest: warn if we see a // @<directive-name> #125813
which is parsed as a normal comment not a compiletest directive because compiletest directives require that the line starts with //@.
This typo is hard to spot: both by PR authors and the reviewers. It might not fail in PR CI -- it might not even fail in full build CI, but then explode when the conditions are just right.
We should detect these and issue at least warnings from compiletest to help test writers realize the problem.
Yes, it can. Coincidentally, I've started rewriting htmldocck.py from Python into Rust (for increased maintainability, extensibility and in order to finally use the latest version of XPath). See #125780.
The easiest solution would be to just register HtmlDocCk & JsonDockCk directives in compiletest and change the syntax accepted by src/tools/{html,json}docck/.
An alternative solution is for test-suite-specific directives to also use the new compiletest directive start //@: so tests/rustdoc annotations might be //@ @has which is now unambiguous.
I think this is probably more preferrable, because e.g. it allows filecheck directives to become //@ CHECK-LABEL instead of plain // CHECK-LABEL.
the filecheck directives are processed by the filecheck tool itself, for the majority of cases compiletest gives no special instruction here.
Ah good point, probably better to leave as-is then
fwiw despite noting the issue, I think the prefix doesn't matter too much: I reviewed FileCheck's code (as much as I understood it, anyways) and it seems FileCheck is very simple. I don't think it is aware of any comment styles itself. I think it literally just scans for the prefix on a line and assumes you won't introduce code that resembles a FileCheck directive.
Activity
GuillaumeGomez commentedon May 31, 2024
Gonna take a look at it.
fmease commentedon May 31, 2024
This should obviously skip
tests/rustdoc/andtests/rustdoc-json/as// @(\s@to be precise) mark the start of {Html,Json}DocCk directives.jieyouxu commentedon May 31, 2024
It might be worth waiting on some directive handling reworks (not concrete design and plan just yet unfortunately) I've been wanting to do
jieyouxu commentedon May 31, 2024
Huh, many thanks for the heads up, I was not aware that we had these kind of directives lol
ChrisDenton commentedon May 31, 2024
That seems confusing? Could that be changed?
GuillaumeGomez commentedon May 31, 2024
yes, just need someone to do it (I can if you want?).
fmease commentedon May 31, 2024
Yes, it can. Coincidentally, I've started rewriting
htmldocck.pyfrom Python into Rust (for increased maintainability, extensibility and in order to finally use the latest version of XPath). See #125780.The easiest solution would be to just register HtmlDocCk & JsonDockCk directives in
compiletestand change the syntax accepted bysrc/tools/{html,json}docck/.13 remaining items
jieyouxu commentedon May 31, 2024
Ah good point, probably better to leave as-is then
workingjubilee commentedon Jun 1, 2024
as stated in #125825:
Auto merge of rust-lang#126788 - GuillaumeGomez:migrate-rustdoc-tests…
Auto merge of rust-lang#126788 - GuillaumeGomez:migrate-rustdoc-tests…
Auto merge of rust-lang#126788 - GuillaumeGomez:migrate-rustdoc-tests…
Auto merge of rust-lang#126788 - GuillaumeGomez:migrate-rustdoc-tests…
Auto merge of rust-lang#127968 - fmease:upd-jsondocck-directive-style…
Rollup merge of rust-lang#165576 - fmease:comptest-stricter-parsing, …
Unrolled build for #165576 in rollup 165597
Rollup merge of #165576 - fmease:comptest-stricter-parsing, r=jieyouxu