How to iterate through all modules for use with the new getUnitTests trait?
Jacob Carlborg
doob at me.com
Thu Nov 7 00:37:02 PST 2013
On 2013-11-06 22:26, Dicebot wrote:
> You need only symbol name of your root compiled module which imports all
> others. All imported ones will be available in its member list, exactly
> what this snippet shows.
That is the problem. One needs to import all other modules. That's not a
good solution when creating a unit test framework. One would basically
have to scan a directory for all D files. Then generate a new file that
imports all these files, with a main function that runs all tests.
Alternatively have something like RTInfo but for modules:
Bugzilla: https://d.puremagic.com/issues/show_bug.cgi?id=10023
Pull request DMD: https://github.com/D-Programming-Language/dmd/pull/2271
Pull request druntime:
https://github.com/D-Programming-Language/druntime/pull/534
Unfortunately my solution has the same problem as RTInfo, one needs to
modify object.d. I had an idea that would solve this both for RTInfo and
the new RMInfo, but that would most likely require building an
associative array at runtime. That was not liked. See the comments in
the pull requests and this:
https://d.puremagic.com/issues/show_bug.cgi?id=10023#c3
--
/Jacob Carlborg
More information about the Digitalmars-d-learn
mailing list