DUB 0.9.21 beta 1

Kapps opantm2+spam at gmail.com
Mon Dec 9 04:45:59 PST 2013


I was looking for something similar to dub test and am glad to 
see it added, but I can't seem to figure out how to get it to do 
anything at all.

In particular, I'm trying to give "tested" a try as it seems 
quite nice and I was looking for an automated way to generate 
computer-readable test results (results.json in this case). 
According to the github page for tested, with the latest version 
of dub (I'm using the beta version in OSX) I should just be able 
to add tested as a dependency and run dub test to generate test 
results. I created a package called "dubtest", and set app.d to 
contain just a unittest with @name set from tested. I then run 
dub test, and get:

Got library for false
Checking dependencies in '/Users/kapps/dev/src/dubtest'
Running unit tests for package dubtest, configuration 'library'.
Package dubtest (configuration "library") defines no main source 
file, this may cause certain build modes to fail. Add an explicit 
"mainSourceFile" to the package description to fix this.
Error executing command test: Main source file not found in any 
import path.

I also tried giving my app.d a void main() which has the same 
result. I also tried dub test dubtest --main-file=main.d where 
main.d just contains a void main and writeln, but this has the 
same result as well. If I specifically set targetType to 
executable in package.json and run dub test, then I get:

Got  for false
Building package dubtest in /Users/kapps/dev/src/dubtest
Got  for false
Checking dependencies in '/Users/kapps/dev/src/dubtest'
Running unit tests for package dubtest, configuration ''.
Error executing command test: Could not resolve configuration for 
package tested

If I use dub --build=unittest however while it's set to 
executable, it will successfully build and reach my main (or give 
a linker error if no main is present / targetType is not 
executable).

Overall, I can't seem to get dub test to work at all regardless 
of configuration. Ideally I'm looking for a way to have tested 
run my unittests and output a results.json without manually 
creating a main file since these projects are generally libraries 
and I'm trying to automate the process for continuous integration 
purposes.


More information about the Digitalmars-d-announce mailing list