[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992


Kenji Hara  changed:

   What|Removed |Added

   Keywords||wrong-code
 Status|NEW |RESOLVED
 Resolution||FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992



--- Comment #10 from github-bugzi...@puremagic.com 2013-09-30 03:44:45 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/331b5b0cb33433cbba391dd418ae36e8b454c4e6
Fixes Issue 10992 - Missing unittests when using getUnittests trait.

https://github.com/D-Programming-Language/dmd/commit/efe42756ade57a7cc029c7950293e65755b98aff
Merge pull request #2544 from AndrejMitrovic/Fix10992

Issue 10992 - Missing unittests when using getUnittests trait

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-10 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992



--- Comment #9 from Jacob Carlborg  2013-09-10 00:31:18 PDT ---
(In reply to comment #7)

> So what should really be used is:
> 
> UnitTestDeclaration *unitTest = symbol->isUnitTestDeclaration();
> 
> I'll make a pull to fix this.

No, only "isUnitTestDeclaration" won't work. I've tried that. Sometimes
"isUnitTestDeclaration" returns null but "unittest" contains something.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992


Andrej Mitrovic  changed:

   What|Removed |Added

   Keywords||pull
 AssignedTo|nob...@puremagic.com|andrej.mitrov...@gmail.com


--- Comment #8 from Andrej Mitrovic  2013-09-09 
13:42:41 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2544

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992



--- Comment #7 from Andrej Mitrovic  2013-09-09 
13:34:54 PDT ---
I've identified the problem:

UnitTestDeclaration *unitTest = symbol->unittest ? symbol->unittest :
symbol->isUnitTestDeclaration();
printf("-- %s %d\n", symbol->toChars(), unitTest);

This prints:

-- object 0
-- __unittestL3_1 2499632
-- __unittestL4_2 2500032
-- __unittestL5_3 2500032

Note how the last unittest has the same address as the one before it.

Here's a better printf:
printf("-- %s %d %d\n", symbol->toChars(), symbol->unittest,
symbol->isUnitTestDeclaration());

And the printout:

-- __unittestL3_1 2434096 2433696
-- __unittestL4_2 2434496 2434096
-- __unittestL5_3 0   2434496

Notice that the "unitTest" varriable assign statement will end up using the
address 2434496 twice.

@Jacob: The 'unittest' field was introduced by me, but I should have documented
it better. It should only be used for the DDOC documented unittest feature,
because what it really does is assigns the next physical unittest symbol to
whatever previous symbol there is (which itself might be a unittest).

So what should really be used is:

UnitTestDeclaration *unitTest = symbol->isUnitTestDeclaration();

I'll make a pull to fix this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992



--- Comment #6 from Jacob Carlborg  2013-09-08 23:38:46 PDT ---
(In reply to comment #4)

> Hmm, maybe it's a platform-specific issue. 

Seems weird. I would think this would mostly be related to the front end.

> I could look into it if you don't have a win32 system around.

Please do.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992



--- Comment #5 from Kapps  2013-09-08 13:14:40 PDT ---
(In reply to comment #4)
> 
> Hmm, maybe it's a platform-specific issue. I could look into it if you don't
> have a win32 system around.

I'm running Linux 64-bit and generating 64-bit code. I don't have 32-bit
libraries installed to test with unfortunately.

archlptp:~$ dmd -m64 -unittest -run ptest.d
Test 1
Test 2
Test 3
main
Test 2
Test 3

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992



--- Comment #4 from Andrej Mitrovic  2013-09-08 
13:07:02 PDT ---
(In reply to comment #3)
> Commit fc460eede168cf52879ca41191baf7db1f893569 on Mac OS X.

(In reply to comment #3)
> I still cannot reproduce it:
> 
> $ ./dmd -unittest -run main.d
> Test 1
> Test 2
> Test 3
> main
> Test 1
> Test 2
> Test 3
> 
> Commit fc460eede168cf52879ca41191baf7db1f893569 on Mac OS X.

Hmm, maybe it's a platform-specific issue. I could look into it if you don't
have a win32 system around.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992



--- Comment #3 from Jacob Carlborg  2013-09-08 13:03:37 PDT ---
I still cannot reproduce it:

$ ./dmd -unittest -run main.d
Test 1
Test 2
Test 3
main
Test 1
Test 2
Test 3

Commit fc460eede168cf52879ca41191baf7db1f893569 on Mac OS X.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992


Andrej Mitrovic  changed:

   What|Removed |Added

 CC||andrej.mitrov...@gmail.com


--- Comment #2 from Andrej Mitrovic  2013-09-08 
12:57:10 PDT ---
I can with commit 25edff56d1c0e227bb16bf5369c7fee3be8cc630 on win32:

$ dmd -unittest -run test.d
> DMD v2.064 DEBUG
> Test 1
> Test 2
> Test 3
> main
> Test 2
> Test 3

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 10992] Trait getUnitTests skips first test if aggregate contains multiple tests.

2013-09-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10992


Jacob Carlborg  changed:

   What|Removed |Added

 CC||d...@me.com


--- Comment #1 from Jacob Carlborg  2013-09-08 12:54:04 PDT ---
I can't reproduce this in git HEAD.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---