Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: c3bcbb50b1dbd51ef809038e372dd13e47b767ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import static org.apache.tools.ant.taskdefs.condition.Os.*

plugins {
	id 'cpp'
}

apply from: "$rootDir/gradle/etUnitConverter.gradle"

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 = 'log/TestCppRuntime.etu'

clean.delete 'log'

task run(type: Exec, dependsOn: assemble, group: 'verification') {
	commandLine exeFile
	inputs.file exeFile
	outputs.files etuFile
	
	doFirst { file('log').mkdirs() }
}

createEtUnitConverterTask('convert', [etuFile])
convert.dependsOn run

check.dependsOn convert

Back to the top