Low level unit test library in druntime

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 1 05:06:21 PDT 2016


On 08/31/2016 01:01 PM, Atila Neves wrote:
> And never mind that any such low level library would suffer from the
> same problem unit-threaded did until dub fixed it: D can't reflect on
> packages so a program must be written that explicitly lists all modules
> that need to be looked at.

I don't even think fixing package reflection would truly help here
because there exist legit D projects that don't transitively import all
modules from `main` and recursive compile-time visiting of all symbols
would miss them.

> There's a disconnect between what's possible at runtime with ModuleInfo
> and what's possible at compile-time with __traits(getUnittests).
> Fortunately for me, running unit-threaded itself as an executable with
> dub fixed the problem, but in the general case this proposal would
> suffer from the same problems. Unless we force everyone to use dub.

To me it feels like mandatory per-requisite for any test runner changes
in druntime right now is to:

1) make compiler emit runtime info on test block basis instead of per module
2) store TypeInfo of unittest block attributes as part of that runtime info

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20160901/6c588993/attachment.sig>


More information about the Digitalmars-d mailing list