D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3461 - Unittests and assert don't work at all (Mac D1 only)
Summary: Unittests and assert don't work at all (Mac D1 only)
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Mac OS X
: P2 regression
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2009-10-31 14:43 UTC by uewyrwie
Modified: 2014-04-18 09:12 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description uewyrwie 2009-10-31 14:43:31 UTC
Executables compiled with dmd -unittest don't run unit tests at all.

assert() is checked at compile time (i.e. assert(0) triggers warnings about unreachable code), but has no effect at run time (tried compiling with -debug).

Both 1.050 and 1.048 fail on Snow Leopard (32-bit kernel mode). 2.035 with same code, same switches runs the tests.
Comment 1 Don 2010-06-24 00:43:21 UTC
Can somebody please check if this bug is still valid? It's hard to believe that anyone could be using DMD1 on OSX if this still applies.
If it still fails, is it really a regression? Was there ever a version of D1 where it worked?
Comment 2 Don 2010-08-09 06:11:46 UTC
Fawzi has confirmed this is still current. Bug 2726 seems to be the root cause.
Comment 3 Brad Roberts 2011-02-06 15:39:33 UTC
Mass migration of bugs marked as x86-64 to just x86.  The platform run on isn't what's relevant, it's if the app is a 32 or 64 bit app.
Comment 4 Walter Bright 2012-01-31 19:16:35 UTC
The following program:

import std.stdio;

unittest
{
    writefln("in unittest");
}

void main()
{
    writefln("in main()");
}

compiled with:

dmd foo -unittest

prints:

in unittest
in main()