unittest under betterC

DLearner bmqazwsx123 at gmail.com
Tue Jun 6 23:01:38 UTC 2023


On Monday, 5 June 2023 at 18:22:45 UTC, Ernesto Castellotti wrote:
[...]
> It's not so easy to deal automatically in case of multiple 
> modules

_multiple modules_

The following code, in a batch (.bat) file, works for me:
```
@echo off
:loop
if [%1]==[] goto loopexit
type .\%1.d > .\__temp_%1.d
echo extern(C) void main() { static foreach(u; 
__traits(getUnitTests, __traits(parent, main)))   u();} >> 
.\__temp_%1.d
dmd -betterC -unittest -i -run .\__temp_%1.d
del .\__temp_%1.d
shift
goto loop
:loopexit
```





More information about the Digitalmars-d-learn mailing list