-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (22 loc) · 794 Bytes
/
Makefile
File metadata and controls
28 lines (22 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.PHONY: test
install:
Rscript -e 'packages <- readLines("packages.txt"); install.packages(packages)'
test:
rm -rf src/tests/testthat/results
Rscript -e "setwd('src/'); library(devtools); test()"
test-%:
rm -rf src/tests/testthat/results
@echo "running test file: test-$*"
$(eval ARGS := $(if $(suffix $(*)),$(*),$(*).R))
$(eval path := tests/testthat/test-$(ARGS))
Rscript -e "setwd('src/'); library(devtools); devtools::load_all(); library(testthat); test_file('$(path)')"
build:
Rscript -e "setwd('src/'); library(devtools); devtools::load_all(); devtools::document(); devtools::build()"
buildtest:
rm -rf src/tests/testthat/results
make build
R CMD check pam_2.2.0.tar.gz
buildtestcran:
rm -rf src/tests/testthat/results
make build
R CMD check --as-cran pam_2.2.0.tar.gz