| import static org.apache.tools.ant.taskdefs.condition.Os.* |
| |
| plugins { |
| id "cpp" |
| id "de.protos.etunit-convert" |
| } |
| |
| dependencies { |
| etunitConverter project(":plugins:org.eclipse.etrice.etunit.converter") |
| } |
| |
| model { |
| components { |
| etrice_runtime_cpp_tests(NativeExecutableSpec) { |
| sources.cpp { |
| source { |
| srcDirs = ['src'] |
| include '**/*.cpp' |
| } |
| exportedHeaders { |
| srcDirs = ['src'] |
| } |
| lib project: ':runtime:org.eclipse.etrice.runtime.cpp', library: 'etrice_runtime_cpp', linkage: 'static' |
| lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'static' |
| } |
| binaries { |
| all { |
| cppCompiler.args '-g3' |
| if(isFamily(FAMILY_UNIX)) { linker.args '-lpthread', '-lrt', '-lm' } |
| } |
| } |
| } |
| } |
| } |
| |
| def exeFile = "$buildDir/exe/etrice_runtime_cpp_tests/etrice_runtime_cpp_tests" |
| def etuFile = "$buildDir/log/TestCppRuntime.etu" |
| |
| task run(type: Exec, dependsOn: assemble, group: 'verification') { |
| executable exeFile |
| workingDir = buildDir |
| doFirst { file("$buildDir/log").mkdirs() } |
| } |
| |
| etunitConvert { |
| convert { |
| source etuFile |
| dependsOn run |
| } |
| } |
| |
| check.dependsOn convert |