Skip to content

Commit ae4fb48

Browse files
committed
Update .travis.yml use of lcov to 1.12 to reduce warnings.
(cherry picked from commit 498a7aa)
1 parent 2a41604 commit ae4fb48

1 file changed

Lines changed: 24 additions & 11 deletions

File tree

templates/gsl.travis.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ function apt_get(name, system)
2121
return my.get
2222
endfunction
2323

24+
function fetch_prefix_value(job)
25+
define my.job = fetch_prefix_value.job
26+
define my.match_option = my.job->option(starts_with(option.value, "--prefix="))?
27+
if (defined(my.match_option))
28+
define my.value_length = string.length(my.match_option.value)
29+
return right(my.match_option.value, my.value_length - 9)
30+
endif
31+
endfunction
32+
2433
# We must do this because lcov is uses exclusions only.
2534
function job_coverage_exclusions(job, repository)
2635
define my.job = job_coverage_exclusions.job
@@ -183,9 +192,8 @@ endfunction
183192
.macro initialize_job(job)
184193
. define my.job = initialize_job.job
185194
. define has_addons = (my.job.system = "linux") &\
186-
((is_versioned_compiler(my.job) | is_coverage_job(my.job) |\
187-
count(my.job.get) > 0) | (is_compiler_clang(my.job) &\
188-
is_versioned_compiler(my.job)))
195+
((is_versioned_compiler(my.job) | count(my.job.get) > 0) |\
196+
(is_compiler_clang(my.job) & is_versioned_compiler(my.job)))
189197
- os: $(my.job.system)
190198
compiler: $(my.job.compiler)
191199
env: LINK=$(my.job.link)
@@ -196,14 +204,11 @@ endfunction
196204
sources:
197205
- sourceline: 'ppa:h-rayflood/llvm'
198206
. endif
199-
. if (is_versioned_compiler(my.job) | is_coverage_job(my.job) | count(my.job.get) > 0)
207+
. if (is_versioned_compiler(my.job) | count(my.job.get) > 0)
200208
packages:
201209
. if (is_versioned_compiler(my.job))
202210
- $(compiler_package_name(my.job))-$(get_compiler_version(my.job))
203211
. endif
204-
. if (is_coverage_job(my.job))
205-
- lcov
206-
. endif
207212
. for my.job.get as _get
208213
- $(_get.name)
209214
. endfor _get
@@ -255,7 +260,15 @@ matrix:
255260
.macro code_coverage(repository)
256261
. define my.repository = code_coverage.repository
257262
. if (count_matrix_coverage_job(my.repository->matrix) > 0)
258-
# Install coveralls and current lcov.
263+
# Download and unpack lcov > 1.10
264+
. for my.repository->matrix.job as _job where is_coverage_job(_job)
265+
. define my.job_condition = condition(job_predicate(_job))
266+
- $(my.job_condition) wget https://github.com/linux-test-project/lcov/releases/download/v1.12/lcov-1.12.tar.gz; fi
267+
- $(my.job_condition) tar xzf lcov-1.12.tar.gz; fi
268+
- $(my.job_condition) cd lcov-1.12; PREFIX="$(fetch_prefix_value(_job))" make install; cd ..; fi
269+
. endfor
270+
271+
# Install coveralls.
259272
. for my.repository->matrix.job as _job where is_coverage_job(_job)
260273
. define my.job_condition = condition(job_predicate(_job))
261274
- $(my.job_condition) gem install coveralls-lcov; fi
@@ -265,9 +278,9 @@ matrix:
265278
. for my.repository->matrix.job as _job where is_coverage_job(_job)
266279
. define my.job_condition = condition(job_predicate(_job))
267280
. define my.exclusions = job_coverage_exclusions(_job, my.repository)
268-
- $(my.job_condition) lcov --directory . --capture --output-file coverage.info; fi
269-
- $(my.job_condition) lcov --remove coverage.info $(my.exclusions) --output-file coverage.info; fi
270-
- $(my.job_condition) lcov --list coverage.info; fi
281+
- $(my.job_condition) $(fetch_prefix_value(_job))/usr/bin/lcov --directory . --capture --output-file coverage.info; fi
282+
- $(my.job_condition) $(fetch_prefix_value(_job))/usr/bin/lcov --remove coverage.info $(my.exclusions) --output-file coverage.info; fi
283+
- $(my.job_condition) $(fetch_prefix_value(_job))/usr/bin/lcov --list coverage.info; fi
271284
. endfor
272285

273286
# Upload coverage info to coveralls service (--repo-token <private coveralls repo token>).

0 commit comments

Comments
 (0)