Bug 20500 – running examples on the home page only displays '1 unittests passed'
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-01-12T08:39:05Z
Last change time
2020-01-23T12:33:29Z
Keywords
pull
Assigned to
No Owner
Creator
Rainer Schuetze
Comments
Comment #0 by r.sagitario — 2020-01-12T08:39:05Z
Running examples at dlang.org that use writeln or similar only display "1 unittests passed".
This is probably caused by these examples being compiled with -unittest which adds a dubious unittest from std.format. When built with dmd 2.090 main isn't executed anymore if unittests are run, though.
Comment #1 by pro.mathias.lang — 2020-01-18T09:41:52Z
Comment #2 by petar.p.kirov — 2020-01-22T09:26:24Z
Yes, we need to update dlang-tour to pass the right -DRT option when running the compiled executable.
Comment #3 by schveiguy — 2020-01-22T23:01:40Z
If I compile with unittests enabled, I shouldn't get any unittests inserted from Phobos or druntime. IMO that's a bug in Phobos.
On top of that, yes, the default for the online program runner should be to run both unittests and main, as that's the most useful thing you might want to do.
Comment #4 by dlang-bot — 2020-01-23T07:21:24Z
@rainers created dlang/phobos pull request #7359 "fix Issue 20500 - running examples on the home page only displays '1 …" fixing this issue:
- fix Issue 20500 - running examples on the home page only displays '1 unittests passed'
move unittests out of templated struct FormatSpec so they are not generated when using the template
https://github.com/dlang/phobos/pull/7359
Comment #5 by dlang-bot — 2020-01-23T09:38:27Z
@wilzbach created dlang/dlang.org pull request #2739 "Fix Issue 20500 - always pass -unittest and --DRT-testmode=run-main" fixing this issue:
- Fix Issue 20500 - always pass -unittest and --DRT-testmode=run-main
https://github.com/dlang/dlang.org/pull/2739
Comment #6 by dlang-bot — 2020-01-23T09:43:41Z
dlang/phobos pull request #7359 "fix Issue 20500 - running examples on the home page only displays '1 …" was merged into stable:
- 0105fc924f3c9be14269a833de0d8b57288816f0 by Rainer Schuetze:
fix Issue 20500 - running examples on the home page only displays '1 unittests passed'
move unittests out of templated struct FormatSpec so they are not generated when using the template
https://github.com/dlang/phobos/pull/7359
Comment #7 by dlang-bot — 2020-01-23T12:33:29Z
dlang/dlang.org pull request #2739 "Fix Issue 20500 - always pass -unittest and --DRT-testmode=run-main" was merged into master:
- 74a2d08bb4614df0483a7d64a104084b25e46b04 by Sebastian Wilzbach:
Fix Issue 20500 - always pass -unittest and --DRT-testmode=run-main
https://github.com/dlang/dlang.org/pull/2739