Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions vars/sconsBuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Map call(Map config = [:]) {
* <target-compiler[-build_type]-test>. Additional stashes
* will be created for "install" and "build_vars" with similar
* prefixes.
* config['code_coverage'] Boolean, build with code coverage. Default false.
*/

Date startDate = new Date()
Expand Down Expand Up @@ -192,6 +193,9 @@ Map call(Map config = [:]) {
if (config['WARNING_LEVEL']) {
scons_args += " WARNING_LEVEL=${config['WARNING_LEVEL']}"
}
if (config['code_coverage']) {
scons_args += ' --code-coverage'
}
//scons -c is not perfect so get out the big hammer
String clean_cmd = ""
if (config['skip_clean']) {
Expand Down Expand Up @@ -315,6 +319,9 @@ Map call(Map config = [:]) {
if (stage_info['compiler'] == 'covc') {
vars_includes += ', test.cov'
}
if (config['code_coverage']) {
vars_includes += ', build/**/*.gcno'
}
stash name: target_stash + '-build-vars',
includes: vars_includes
String test_files = readFile "${env.WORKSPACE}/${config['stash_files']}"
Expand Down
6 changes: 6 additions & 0 deletions vars/unitTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,11 @@ Map call(Map config = [:]) {
stash name: results_map,
includes: results_map

// Stash any optional test coverage rreports for the stage
String code_coverage = 'code_coverage_' + sanitizedStageName()
stash name: code_coverage,
includes: '**/code_coverage.json',
allowEmpty: true

return runData
}