# A default test is generated for a native executable

**URL:** <https://discuss.gradle.org/t/a-default-test-is-generated-for-a-native-executable/19902>\
**Category:** Bugs\
**Created:** [October 6, 2016, 9:20pm UTC](https://discuss.gradle.org/t/a-default-test-is-generated-for-a-native-executable/19902 "2016-10-06T21:20:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nreznik](https://avatars.discourse-cdn.com/v4/letter/n/c2a13f/32.png) [@nreznik](https://discuss.gradle.org/u/nreznik)\
**Post date:** [October 6, 2016, 9:20pm UTC](https://discuss.gradle.org/t/a-default-test-is-generated-for-a-native-executable/19902/1 "2016-10-06T21:20:25Z")

</div>

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

`:runMyexecutableTestGoogleTestExe`

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

---

<div class="post-metadata">

**Author:** ![Daniel\_L](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daniel_l/32/6420_2.png) [@Daniel\_L](https://discuss.gradle.org/u/Daniel_L)\
**Post date:** [October 7, 2016, 12:49pm UTC](https://discuss.gradle.org/t/a-default-test-is-generated-for-a-native-executable/19902/2 "2016-10-07T12:49:21Z")

</div>

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