D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20500 - running examples on the home page only displays '1 unittests passed'
Summary: running examples on the home page only displays '1 unittests passed'
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-01-12 08:39 UTC by Rainer Schuetze
Modified: 2020-01-23 12:33 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Rainer Schuetze 2020-01-12 08:39:05 UTC
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 Mathias LANG 2020-01-18 09:41:52 UTC
Caused by https://github.com/dlang/druntime/pull/2877
Comment 2 ZombineDev 2020-01-22 09:26:24 UTC
Yes, we need to update dlang-tour to pass the right -DRT option when running the compiled executable.
Comment 3 Steven Schveighoffer 2020-01-22 23:01:40 UTC
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 Dlang Bot 2020-01-23 07:21:24 UTC
@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 Dlang Bot 2020-01-23 09:38:27 UTC
@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 Dlang Bot 2020-01-23 09:43:41 UTC
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 Dlang Bot 2020-01-23 12:33:29 UTC
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