digitalmars.D.bugs - [Issue 10992] New: Trait getUnitTests skips first test if aggregate contains multiple tests.
- d-bugmail puremagic.com (44/44) Sep 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (10/10) Sep 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (11/18) Sep 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (15/15) Sep 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (9/22) Sep 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (15/18) Sep 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (8/10) Sep 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (31/31) Sep 09 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (11/11) Sep 09 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (8/13) Sep 10 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (11/11) Sep 30 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
- d-bugmail puremagic.com (10/10) Sep 30 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10992
http://d.puremagic.com/issues/show_bug.cgi?id=10992 Summary: Trait getUnitTests skips first test if aggregate contains multiple tests. Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: opantm2+dbugs gmail.com When using __traits(getUnitTests) on an aggregate that contains more than one unittest, the first test will be skipped. If there is only one test, that single test will be included. Example: import std.stdio; unittest { writeln("Test 1"); } unittest { writeln("Test 2"); } unittest { writeln("Test 3"); } void main() { writeln("main"); foreach(t; __traits(getUnitTests, mixin(__MODULE__))) { t(); } } Output (note that the tests should be run twice; once by default test runner): 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: -------
Sep 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992 Jacob Carlborg <doob me.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |doob me.com 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: -------
Sep 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrovich gmail.com 12:57:10 PDT --- I can with commit 25edff56d1c0e227bb16bf5369c7fee3be8cc630 on win32: $ dmd -unittest -run test.dDMD 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: -------
Sep 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992 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: -------
Sep 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992 13:07:02 PDT ---Commit fc460eede168cf52879ca41191baf7db1f893569 on Mac OS X.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: -------
Sep 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992Hmm, 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: -------
Sep 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992Hmm, 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: -------
Sep 08 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992 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: -------
Sep 09 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull AssignedTo|nobody puremagic.com |andrej.mitrovich gmail.com 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: -------
Sep 09 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992So 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: -------
Sep 10 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992 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 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: -------
Sep 30 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10992 Kenji Hara <k.hara.pg gmail.com> 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: -------
Sep 30 2013