A default test is generated for a native executable

(natalya reznik) #1

I have a C++ native library and an executable (which links with the library) in my project. I’d like to add unit tests only for the library. In my build.gradle file, I have

components {
mylibrary(NativeLibrarySpec) {

myexecutable(NativeExecutableSpec) {


  binaries {
    withType(GoogleTestTestSuiteBinarySpec) {

I don’t have any test code for the executable. However, a default test still gets generated by gradle. All it does is call the executable with no parameters, so when I run gradle build, I get


which introduces a test failure.

Gradle Version: 3.1
Operating System and JVM version: Ubuntu
Is this a regression? If yes, which version of Gradle do you know it last worked for? no

(Daniel Lacasse) #2

Thanks for the report Natalya. We are discussing the best way forward to fix that unexpected behavior. I will keep you informed.