Question

I am using gradle to run testng tests. In gradle script one can override the output directory like this:

test {
  useTestNG {
    outputDirectory = file("$buildDir/testngoutput")
  }
}

What I really want is to override this output directory which is needed when I use -Dtest.single. So far, I have tried this but it is not working:

gradle -Dtest.single=MyClass -DoutputDirectory=build/testng-reports-outputdirectory1

No correct solution

OTHER TIPS

test {
    useTestNG {
        def dir = System.getProperty("outputDirectory") 
        outputDirectory = dir ? file(dir) : file("$buildDir/testngoutput")
    }
}

Then call with:

gradle -DoutputDirectory=some/dir
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top