www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DSSS: More than one build per project

reply Urban Hafner <urban bettong.net> writes:
Hej all,

I hope this is the right place to ask. That's at least what the DSSS 
wiki suggests.

So I have a project that uses dsss to build. The config file is really 
simple. It just these lines:

[housebot.d]
target=housebot-0.6
buildflags=-Dddoc -unittest -w -g

Now I want to write another target that gives me the code coverage. I 
figured out how to manually generate them (using gdc & gcov). But I'm 
not sure how to get this into my dsss.conf file. I mean I need to 
compile a files with "-cov" and probably give the executable a different 
name. Then run the executable, run gcov and clean up the intermediate 
files.

How can I do this using dsss? Is it possible? I mean I can't just create 
another section called [housebot.d].

Thanks for your help.

Urban
May 26 2007
parent reply Gregor Richards <Richards codu.org> writes:
Urban Hafner wrote:
 Hej all,
 
 I hope this is the right place to ask. That's at least what the DSSS 
 wiki suggests.
 
 So I have a project that uses dsss to build. The config file is really 
 simple. It just these lines:
 
 [housebot.d]
 target=housebot-0.6
 buildflags=-Dddoc -unittest -w -g
 
 Now I want to write another target that gives me the code coverage. I 
 figured out how to manually generate them (using gdc & gcov). But I'm 
 not sure how to get this into my dsss.conf file. I mean I need to 
 compile a files with "-cov" and probably give the executable a different 
 name. Then run the executable, run gcov and clean up the intermediate 
 files.
 
 How can I do this using dsss? Is it possible? I mean I can't just create 
 another section called [housebot.d].
 
 Thanks for your help.
 
 Urban

This isn't really how DSSS is designed to work. dsss.conf effectively describes the flags/etc of your project at release time. To build a version with unit testing, debug info, coverage, etc, you should just pass those flags to dsss build, e.g.: dsss build -full -unittest -g -cov If you really want to force DSSS to do this, I'd create a dummy section, either as an extra section: [+housebot_cov] prebuild=rebuild housebot.d -ofhousebot_cov -unittest -g -cov Or as a dummy file named something like housebot_cov.d which contains only a module declaration and import of housebot.d: [housebot_cov.d] buildflags=-whatever -cov - Gregor Richards
May 26 2007
parent Urban Hafner <urban bettong.net> writes:
In article <f3a2bk$1rvc$1 digitalmars.com>,
 Gregor Richards <Richards codu.org> wrote:

 This isn't really how DSSS is designed to work. dsss.conf effectively 
 describes the flags/etc of your project at release time. To build a 
 version with unit testing, debug info, coverage, etc, you should just 
 pass those flags to dsss build, e.g.:
 
 dsss build -full -unittest -g -cov
 
 If you really want to force DSSS to do this, I'd create a dummy section, 
 either as an extra section:
 
 [+housebot_cov]
 prebuild=rebuild housebot.d -ofhousebot_cov -unittest -g -cov
 
 Or as a dummy file named something like housebot_cov.d which contains 
 only a module declaration and import of housebot.d:
 
 [housebot_cov.d]
 buildflags=-whatever -cov

Thanks. I'll have a look what I can come up with. Urban
May 27 2007