Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package_coverage only showing cpp files, all zero percent #572

Open
jessekps opened this issue Jul 3, 2024 · 0 comments
Open

package_coverage only showing cpp files, all zero percent #572

jessekps opened this issue Jul 3, 2024 · 0 comments

Comments

@jessekps
Copy link

jessekps commented Jul 3, 2024

Hi,

I used covr::report a few days ago for the first time and it worked as expected, very useful. I have since added some unit tests but I can't get package_coverage to work again. Every time I've ran it since the first time, it only returns results for cpp files, and they are always at 0%.

# run from within the package directory
> package_coverage()
dexter Coverage: 0.00%
src/ability.cpp: 0.00%
src/data.cpp: 0.00%
src/elsym.cpp: 0.00%
src/elsymBinom.cpp: 0.00%
src/enrm.cpp: 0.00%
src/enrmBayes.cpp: 0.00%
src/priors.cpp: 0.00%
src/progress.h: 0.00%
src/pv.cpp: 0.00%
src/shared.cpp: 0.00%
src/shared.h: 0.00%
src/simulation.cpp: 0.00%
Warning messages:
1: In readLines(source_file) :
  incomplete final line found on 'C:/projects/dexter/src/shared.h'
2: In readLines(source_file) :
  incomplete final line found on 'C:/projects/dexter/src/progress.h'
3: In readLines(source_file) :
  incomplete final line found on 'C:/projects/dexter/src/shared.h'
4: In readLines(source_file) :
  incomplete final line found on 'C:/projects/dexter/src/progress.h'
5: In readLines(source_file) :
  incomplete final line found on 'C:/projects/dexter/src/shared.cpp'

I do have a tests/testthat.R file. It has not changed recently. I suspected there might be some left-over files from the first run of package_coverage but I can't find anything. Running with quiet=FALSE shows it does some compiling but it does not run any unit tests. The package builds without errors and devtools::test runs fine:

> devtools::test()
ℹ Testing dexter
# ....
══ Results ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
Duration: 55.3 s

[ FAIL 0 | WARN 0 | SKIP 0 | PASS 247 ]

After a couple failures I updated R, re-installed all packages from Cran and tried again, no change. Do you have any pointers? If you have the time to look, the package is here: https://github.com/dexter-psychometrics/dexter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant