-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
82 lines (74 loc) · 2.14 KB
/
Jenkinsfile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env groovy
properties([
[$class: 'ParametersDefinitionProperty', parameterDefinitions: [
[$class: 'BooleanParameterDefinition', defaultValue: false, description: 'Build Integration Tests', name: 'integrationTests']
]]
])
def integrationTests = (env.integrationTests == "true")
def compilers = ['g++-9', 'clang++-9']
def create_unittest_build(String compiler, String buildSubdir) {
return {
node ('ubuntu64' && 'gcc9' && 'clang9') {
stage("Unit Tests (${compiler})") {
checkout scm
dir (buildSubdir) {
sh "cmake -DCMAKE_CXX_COMPILER=${compiler} .."
sh "make -j\$((2*\$(getconf _NPROCESSORS_ONLN)))"
sh "make test"
junit 'tests/unittests/test_detail.xml'
}
}
}
}
}
def executions = [:]
for(int i = 0; i < compilers.size(); i++) {
executions['unittest-' + compilers[i]] = create_unittest_build(compilers[i], 'build')
}
executions['doc'] = {
node ('ubuntu64' && 'gcc9' && 'clang9') {
stage('Documentation') {
checkout scm
dir ('build') {
sh "cmake -DBUILD_DOCUMENTATION=on -DCMAKE_CXX_COMPILER=g++-9 .."
sh "make doc"
archiveArtifacts artifacts: 'doc/', fingerprint: false
}
}
}
}
executions['coverage'] = {
node ('ubuntu64' && 'gcc9' && 'clang9') {
stage('Coverage') {
checkout scm
dir ('build') {
sh "cmake -DBUILD_COVERAGE=on -DCMAKE_CXX_COMPILER=g++-9 .."
sh "make -j\$((2*\$(getconf _NPROCESSORS_ONLN)))"
sh "make coverage"
archiveArtifacts artifacts: 'unit_test_coverage/', fingerprint: false
}
}
}
}
if (integrationTests) {
executions['integration'] = {
node ('ubuntu64' && 'gcc9' && 'clang9') {
stage('Integration Tests') {
checkout scm
dir ('build') {
try {
sh "qpidd -q"
sh "cmake -DBUILD_SYSTEM_TESTS=on -DCMAKE_CXX_COMPILER=g++-9 .."
sh "make -j12 test cxxsystemtest"
} finally {
junit "tests/systemtests/test_detail.xml"
sh "qpidd -q"
}
}
}
}
}
}
timestamps {
parallel executions
}