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
x.py ignores config.toml's debug-assertions-std for unit tests #79481
If you have in your config.toml file (or whichever file --config says), only this change to config.toml.example:
debug-assertions-std = true
debug assertions in src/liballoc or library/alloc used to be armed. Since #73374, debug assertions only go off if you also turn on debug. EDIT: since some point, even that doesn't help.
Not exactly sure what I was doing back then, nor what you mean with running in coretests. Today, I'd expect, for instance when
adding to library/alloc/src/collections/btree/node/tests.rs:
and running python x.py test library/alloc --no-doc, that both new test cases fail. What I'm seeing is that the debug_assert doesn't even fail when enabling debug, debug-assertionsanddebug-assertions-std in config.toml.
changed the title [-]x.py ignores config.toml's debug-assertions-std[/-][+]x.py ignores config.toml's debug-assertions-std for unit tests[/+]on Nov 25, 2021
@ssomers I'm still not able to replicate this. I ran x test library/alloc --stage 0 --test-args debug_assert with your test case added and the test failed appropriately:
Well, I can still replicate it… on the master at the time. I located the fix at auto merge #90042 (25 October).
And it's really flawless now. The debug assertions detonate if debug or debug-assertions-std is true, or both, and you don't need to clean anything before building to see it.
Activity
jyn514 commentedon Oct 11, 2021
@ssomers I can't reproduce. I added this assert:
and set
debug = falseanddebug-assertions-std = true, and got an assertion failure as expected.Are you expecting assertions to run in
coretestsmaybe?ssomers commentedon Oct 11, 2021
Not exactly sure what I was doing back then, nor what you mean with running in coretests. Today, I'd expect, for instance when
adding to library/alloc/src/collections/btree/node/tests.rs:
and running
python x.py test library/alloc --no-doc, that both new test cases fail. What I'm seeing is that thedebug_assertdoesn't even fail when enablingdebug,debug-assertionsanddebug-assertions-stdin config.toml.[-]x.py ignores config.toml's debug-assertions-std[/-][+]x.py ignores config.toml's debug-assertions-std for unit tests[/+]jyn514 commentedon Nov 26, 2021
@ssomers I'm still not able to replicate this. I ran
x test library/alloc --stage 0 --test-args debug_assertwith your test case added and the test failed appropriately:ssomers commentedon Nov 27, 2021
Well, I can still replicate it… on the master at the time. I located the fix at auto merge #90042 (25 October).
And it's really flawless now. The debug assertions detonate if
debugordebug-assertions-stdis true, or both, and you don't need to clean anything before building to see it.