@@ -286,12 +286,12 @@ inside `dir`.
286286
287287See [`generate_coverage`](@ref).
288288"""
289- function html_coverage (coverage:: PackageCoverage ; open = false , dir = tempdir ())
289+ function html_coverage (coverage:: PackageCoverage ; gitroot = " . " , open = false , dir = tempdir ())
290290 cd (coverage. package_dir) do
291291 branch = try
292- LibGit2. headname (GitRepo (" ./ " ))
292+ LibGit2. headname (GitRepo (gitroot ))
293293 catch
294- @warn " git branch could not be detected"
294+ @warn " git branch could not be detected, pass the `gitroot` kwarg if the git root is not the same as the package directory. "
295295 end
296296
297297 title = " on branch $(branch) "
@@ -313,13 +313,14 @@ function html_coverage(coverage::PackageCoverage; open = false, dir = tempdir())
313313end
314314
315315function html_coverage (pkg = nothing ;
316+ gitroot = " ." ,
316317 open = false ,
317318 dir = tempdir (),
318319 test_args = [" " ],
319320 folder_list = [" src" ],
320321 file_list = [])
321322 gen_cov () = generate_coverage (pkg; test_args = test_args, folder_list = folder_list, file_list = file_list)
322- html_coverage (gen_cov (), open = open, dir = dir)
323+ html_coverage (gen_cov (); gitroot = gitroot , open = open, dir = dir)
323324end
324325
325326"""
@@ -379,7 +380,7 @@ This requires the Python package `lcov_cobertura` (>= v2.0.1), available in PyPl
379380function generate_xml (coverage:: PackageCoverage , filename= " cov.xml" )
380381 run (Cmd (Cmd ([" lcov_cobertura" , " lcov.info" , " -o" , filename]),
381382 dir = joinpath (coverage. package_dir, COVDIR)))
382- @info (" generated cobertura XML $filename " )
383+ @info (" generated cobertura XML $( joinpath (coverage . package_dir, COVDIR, filename)) . " )
383384end
384385
385386"""
0 commit comments