www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Batch compilation and -unittest flag

Is there a way to call dmd/rdmd on a set of files but only 
activate unittest for one of them?

This would significantly cut down my wait times when developing D 
in Emacs with flycheck-d-unittest:

https://github.com/flycheck/flycheck-d-unittest

Without it I have to implement my own build logic:

1. dmd -c -unittest -main <top.d>
2. dmd -c -unittest -main <sub1.d sub2.d, ... subN.d>
3. ld.gold -o test top.o sub1.o sub2.o ... subN.d

when top.d depends (either directly or transitively) on 
sub{1,...,N}.d

Further, building 1. and 2. separately wastes CPU-cycles through 
duplicate parsing of sub{1,...,N}.d.
Oct 13 2016