View previous topic :: View next topic |
Author |
Message |
baxissimo
Joined: 23 Oct 2006 Posts: 241 Location: Tokyo, Japan
|
Posted: Sun Dec 17, 2006 10:55 pm Post subject: Detecting main in a version(D_unittest) |
|
|
bud doesn't seem to detect when there's a main() inside a version(D_unittest) block, despite the -unittest flag being passed in and that main being active.
Simple workaround is to use the -nolib flag, but would be nice if bud would catch it. |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Mon Dec 18, 2006 12:07 am Post subject: Re: Detecting main in a version(D_unittest) |
|
|
baxissimo wrote: | bud doesn't seem to detect when there's a main() inside a version(D_unittest) block, despite the -unittest flag being passed in and that main being active.
Simple workaround is to use the -nolib flag, but would be nice if bud would catch it. |
D_unittest is not defined in the DigitalMars documentation. I do not know what it is.
The fault is not with Bud. For example, this works ...
Code: |
version(dunittest)
{
unittest
{
assert(0, "UT TEST");
}
void main() {}
}
|
and compiled with ...
Code: |
C:\temp>bud test -unittest -version=dunittest
Path and Version : y:\util\bud.exe v3.04(2512)
built on Mon Oct 16 11:03:49 2006
C:\temp>test
Error: AssertError Failure test.d(6) UT TEST
C:\temp>
|
Speak with DigitalMars about the problem, I can't help you with this one. _________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
baxissimo
Joined: 23 Oct 2006 Posts: 241 Location: Tokyo, Japan
|
Posted: Mon Dec 18, 2006 1:34 am Post subject: My bad |
|
|
You're right.
I'm going to have to chalk this one up to bad behavior of selective imports in DMD.
I had this in my code:
Code: |
if (D_unittest) {
import std.stdio : writefln;
}
|
And writefln's were working so I thought that D_unittest was getting selected.
But turns out that some other module I imported was doing an import std.stdio : writefln too. And unfortunately selective private imports aren't private. That's what you get from trying to avoid namespace pollution: more pollution than when you're lazy.
Sorry for the bogus report.
I'll erase the one I posted in the tracker too.
--bb |
|
Back to top |
|
|
|