To get a feel for the various options for testing, I played around with all the options suggested.
First, I downloaded all the source code from github into pkg/ and unzipped, renaming the unzipped dir from codemetar-master/ to codemetar.
Then in the terminal, I navigated to dir pkg/
Anna [master|✚ 2…190]
17:27 $ R CMD build codemetar
* checking for file ‘codemetar/DESCRIPTION’ ... OK
* preparing ‘codemetar’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a ‘data/datalist’ file should be added
* building ‘codemetar_0.1.0.tar.gz’
All ok
Anna [master|✚ 2…190]
17:29 $ R CMD check codemetar_0.1.0.tar.gz
* using log directory ‘/Users/Anna/Documents/workflows/rOpenSci/codemetar-review/pkg/codemetar.Rcheck’
* using R version 3.4.1 (2017-06-30)
* using platform: x86_64-apple-darwin15.6.0 (64-bit)
* using session charset: UTF-8
* checking for file ‘codemetar/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘codemetar’ version ‘0.1.0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘codemetar’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking R/sysdata.rda ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘testthat.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ...
‘codemeta-intro.Rmd’ using ‘UTF-8’ ... OK
‘codemeta-parsing.Rmd’ using ‘UTF-8’ ... OK
‘translating.Rmd’ using ‘UTF-8’ ... OK
‘validation-in-json-ld.Rmd’ using ‘UTF-8’ ... OK
NONE
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: OK
test
and check
library(devtools)
devtools::check("../pkg/codemetar")
Updating codemetar documentation
Loading codemetar
Setting env vars ---------------------------------------------------------
CFLAGS : -Wall -pedantic
CXXFLAGS: -Wall -pedantic
Building codemetar -------------------------------------------------------
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file \
--no-environ --no-save --no-restore --quiet CMD build \
'/Users/Anna/Documents/workflows/rOpenSci/codemetar-review/pkg/codemetar' \
--no-resave-data --no-manual
Setting env vars ---------------------------------------------------------
_R_CHECK_CRAN_INCOMING_ : FALSE
_R_CHECK_FORCE_SUGGESTS_: FALSE
Checking codemetar -------------------------------------------------------
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file \
--no-environ --no-save --no-restore --quiet CMD check \
'/var/folders/8p/87cqdx2s34vfvcgh04l6z72w0000gr/T//RtmplZ2dJ9/codemetar_0.1.0.tar.gz' \
--as-cran --timings --no-manual
R CMD check results
0 errors | 0 warnings | 0 notes
devtools::test("../pkg/codemetar")
Loading codemetar
Loading required package: testthat
Testing codemetar
cloned repo: ..
codemeta_description.R:
validate: ..
crosswalk.R: ....
test frame: ....
guess_metadata: ........
test-many-packages: S
parse citation: .
parse_depends.R: ....
parse_people.R: ....
spdx_license.R: ..
utils.R: ..
write_codemeta: ...W.W.
Skipped -------------------------------------------------------------------
1. Test the creation of codemeta for many packages (@test-many-packages.R#11) - not also testing against 100 random installed packages today...,
consider testing that locally instead
Warnings ------------------------------------------------------------------
1. We can parse author lists
that use Authors@R, Authors, or both (@test-write_codemeta.R#64) - the condition has length > 1 and only the first element will be used
2. We can parse author lists
that use Authors@R, Authors, or both (@test-write_codemeta.R#77) - the condition has length > 1 and only the first element will be used
DONE ======================================================================
library(goodpractice)
gp("../pkg/codemetar")
Preparing: covr
Preparing: cyclocomp
Skipping 1 packages ahead of CRAN: Rcpp
Preparing: description
Preparing: lintr
Preparing: namespace
Preparing: rcmdcheck
── GP codemetar ───────────────────────────────────────────────────────────
It is good practice to
✖ write unit tests for all functions, and all package code in
general. 98% of code lines are covered by test cases.
R/codemeta_description.R:24:NA
R/codemeta_validate.R:23:NA
R/guess_metadata.R:127:NA
R/guess_metadata.R:144:NA
R/parse_citation.R:77:NA
... and 2 more lines
───────────────────────────────────────────────────────────────────────────
testthat
on the installed package from githublibrary(testthat)
library(codemetar)
test_package("codemetar")
cloned repo: ..
codemeta_description.R:
validate: ..
crosswalk.R: ....
test frame: ....
guess_metadata: ........
test-many-packages: S
parse citation: .
parse_depends.R: ....
parse_people.R: ....
spdx_license.R: ..
utils.R: ..
write_codemeta: ...W.W.
Skipped -------------------------------------------------------------------
1. Test the creation of codemeta for many packages (@test-many-packages.R#7) - On CRAN
Warnings ------------------------------------------------------------------
1. We can parse author lists
that use Authors@R, Authors, or both (@test-write_codemeta.R#64) - the condition has length > 1 and only the first element will be used
2. We can parse author lists
that use Authors@R, Authors, or both (@test-write_codemeta.R#77) - the condition has length > 1 and only the first element will be used
DONE ======================================================================
This is essentially what is launched when running devtools::test()