Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 32ebe4192fcc322a5696e97804667541f3c16b63 (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 'c'
}

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

model {
	components {
		etrice_runtime_c_tests(NativeExecutableSpec) {
			sources.c {
				source {
					srcDirs = ['src']
					include '**/*.c'
				}
				exportedHeaders {
					srcDirs = ['src']
				}
				lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'static'
			}
			binaries {
				all {
					cCompiler.args '-g3'
					if(isFamily(FAMILY_UNIX)) { linker.args '-lpthread', '-lrt', '-lm' }
				}
			}
		}
	}
}

def exeFile = "$buildDir/exe/etrice_runtime_c_tests/etrice_runtime_c_tests"
def etuFileRuntimeTest = 'log/TestCRuntime.etu'
def etuFileEtUnitTest = 'log/TestEtUnitSpecial.etu'

clean.delete 'log'

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

createEtUnitConverterTask('convert', [etuFileRuntimeTest, etuFileEtUnitTest])
convert.dependsOn run

check.dependsOn convert

Back to the top