Itiviti / gradle-nunit-plugin

A gradle plugin for launching NUnit tests
Apache License 2.0
17 stars 20 forks source link

Posibility to inject addional nunit command line arguments #30

Open vitia opened 8 years ago

vitia commented 8 years ago

NUnit adds/removes command line arguments and not all of them are supported by plugin. https://github.com/nunit/docs/wiki/Console-Command-Line I'm interested in "--agents" and "--labels". However instead of adding support for this specific argument I think It would be useful to have possibility to modify command line right before project.exec and inject any argument.

gluck commented 8 years ago

Hi, I've got mixed feeling about allowing generics params because:

extraArgs = "--labels=On --agents=4"

vs

labels = 'on'
agents = 4

I know it's a bit of extra work for each params, but I think that's what makes the difference between this plugin and a plain Exec task :smiley:

vitia commented 8 years ago

I think it is obvious that extra args is "use on your own risk" feature :) I like the way it is implemented in gradle-msbuild-plugin https://github.com/Ullink/gradle-msbuild-plugin/blob/master/src/main/groovy/com/ullink/Msbuild.groovy#L193

        commandLineArgs += extMap.collect { k, v ->
            v ? "/$k:$v" : "/$k"
        }
gluck commented 8 years ago

This way could can be a good compromise, where we'll end up with:

ext.labels = 'On'
ext.agents = 4

Note that ext shouldn't be used, as it causes incompatibilities with other plugins cf https://github.com/Ullink/gradle-msbuild-plugin/issues/53 But the same syntax (with another name/map) would be fine for me.

Thx !