Hello,
I am using the google-test plugin. If I configure a library like so,
model {
components {
// define libraries and executables to be built
myapp_common(NativeLibrarySpec) {
targetPlatform "arm"
sources {
cpp {
lib library: 'opencv_core', linkage: 'shared'
lib library: 'opencv_highgui', linkage: 'shared'
lib library: 'opencv_imgproc', linkage: 'shared'
source {
srcDirs 'common/src'
include "*.cpp"
}
exportedHeaders {
srcDirs "common/include"
}
}
}
}
}
the google-test plugin creates a component named “myapp_commonTest” like this:
GoogleTest test suite 'myapp_commonTest'
-----------------------------------------
Source sets
C++ source 'myapp_commonTest:cpp'
srcDir: src/myapp_commonTest/cpp
Binaries
Google test exe 'myapp_commonTest:googleTestExe'
build using task: :myapp_commonTestGoogleTestExe
run using task: :runMyapp_commonTestGoogleTestExe
platform: arm
build type: debug
flavor: default
tool chain: Tool chain 'idxArm' (GNU GCC)
executable file: ../../../../catone-gradle-build/binaries/myapp_commonTestGoogleTestExe/myapp_commonTest
I would like to change the srcDir on the myapp_commonTest component source set, but am having trouble figuring out how. I tried configuring it like this:
model {
components {
myapp_commonTest(GoogleTestTestSuiteSpec) {
sources {
cpp {
source {
srcDir 'common/tests'
include '**/*.cpp'
}
}
}
}
}
}
but this ends up giving me a new component and another test component named “myapp_commonTestTest.” It doesn’t configure the existing myapp_commonTest component as I expect it to. What am I missing? How can I configure the source set for the test component binary?
Thank you,
Derek