mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 02:22:57 +01:00
93 lines
2.3 KiB
Groovy
93 lines
2.3 KiB
Groovy
import org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteSpec
|
|
|
|
model {
|
|
components {
|
|
withType(NativeComponentSpec) {
|
|
binaries.withType(NativeBinarySpec) {
|
|
if (buildType == buildTypes.debug) {
|
|
if (it instanceof NativeExecutableBinarySpec) {
|
|
executable.file = toLocalBin(appendDebugSuffix(executable.file), targetPlatform)
|
|
}
|
|
} else
|
|
if (buildType == buildTypes.release) {
|
|
if (it instanceof NativeExecutableBinarySpec) {
|
|
executable.file = toLocalBin(executable.file, targetPlatform)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
TestLib(NativeLibrarySpec) {
|
|
sources {
|
|
cpp {
|
|
source {
|
|
srcDir 'src'
|
|
include 'TestLibrary.cpp'
|
|
include 'TestPlugin.cpp'
|
|
}
|
|
lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared'
|
|
lib project: ':Foundation', library: 'Foundation', linkage: 'shared'
|
|
}
|
|
}
|
|
}
|
|
TestApp(NativeExecutableSpec) {
|
|
sources {
|
|
cpp {
|
|
source {
|
|
srcDir 'src'
|
|
include 'TestApp.cpp'
|
|
}
|
|
lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared'
|
|
lib project: ':Foundation', library: 'Foundation', linkage: 'shared'
|
|
lib library: 'TestLib', linkage: 'shared'
|
|
}
|
|
}
|
|
}
|
|
TestSuite(NativeLibrarySpec) {
|
|
sources {
|
|
cpp {
|
|
source {
|
|
srcDir 'src'
|
|
include '**/*.cpp'
|
|
exclude '*Driver.cpp'
|
|
exclude '*_WINCE.cpp'
|
|
exclude 'TestApp*.cpp'
|
|
}
|
|
exportedHeaders {
|
|
srcDir 'src'
|
|
}
|
|
lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared'
|
|
lib project: ':Foundation', library: 'Foundation', linkage: 'shared'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
testSuites {
|
|
FoundationTestSuite(org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteSpec) {
|
|
testing $.components.TestSuite
|
|
}
|
|
}
|
|
binaries {
|
|
withType(org.gradle.nativeplatform.test.cppunit.CppUnitTestSuiteBinarySpec) {
|
|
lib project: ':CppUnit', library: 'CppUnit', linkage: 'shared'
|
|
if (toolChain in VisualCpp) {
|
|
if (buildType == buildTypes.debug) {
|
|
cCompiler.args "/MDd"
|
|
cppCompiler.args "/MDd"
|
|
} else
|
|
if (buildType == buildTypes.release) {
|
|
cCompiler.args "/MD"
|
|
cppCompiler.args "/MD"
|
|
} else {
|
|
throw new GradleException("Unknown buildType" + buildType)
|
|
}
|
|
}
|
|
if (toolChain in Gcc) {
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
task testsuite { dependsOn "assemble" }
|
|
|
|
|