Skip to content

Commit b1b1832

Browse files
authored
cc now by default not run tests (#4185)
1 parent cd4464f commit b1b1832

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

.dev/CRAN_Release.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ grep asCharacter *.c | grep -v PROTECT | grep -v SET_VECTOR_ELT | grep -v setAtt
208208

209209
cd ..
210210
R
211-
cc(clean=TRUE, CC="gcc-8") # to compile with -pedandic -Wall, latest gcc as CRAN: https://cran.r-project.org/web/checks/check_flavors.html
211+
cc(test=TRUE, clean=TRUE, CC="gcc-8") # to compile with -pedandic -Wall, latest gcc as CRAN: https://cran.r-project.org/web/checks/check_flavors.html
212212
saf = options()$stringsAsFactors
213213
options(stringsAsFactors=!saf) # check tests (that might be run by user) are insensitive to option, #2718
214214
test.data.table()

.dev/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77
Developer helper script providing `cc` function. If one starts R session in `data.table` project root directory `.dev/cc.R` file should be automatically sourced (due to local `.Rprofile` file) making `cc()` (and `dd()`) function available straightaway.
88

99
```r
10-
cc(test=TRUE, clean=FALSE, debug=FALSE, omp=!debug, cc_dir, path=Sys.getenv("PROJ_PATH"), CC="gcc")
10+
cc(test=FALSE, clean=FALSE, debug=FALSE, omp=!debug, cc_dir, path=Sys.getenv("PROJ_PATH"), CC="gcc")
1111
```
1212

13-
Use `cc` to re-compile all C sources and attach all `data.table` R functions (including non-exported ones).
14-
By default `cc(test=TRUE)` will also run main test script `"tests.Rraw"`, so one may want to use `cc(F)` to re-compile and attach newly modified code but not run any test script. As of now running main tests with `cc()` requires to uninstall package to avoid S4 classes namespace issues (see [#3808](https://github.com/Rdatatable/data.table/issues/3808)).
13+
Use `cc()` to re-compile all C sources and attach all `data.table` R functions (including non-exported ones).
14+
One might want to re-compile and run main test script `"tests.Rraw"` automatically, then `cc(test=TRUE)` should be used. As of now running main tests with `cc(T)` requires to uninstall package to avoid S4 classes namespace issues (see [#3808](https://github.com/Rdatatable/data.table/issues/3808)).
1515
When working on a bigger feature, one may want to put new unit tests into dedicated test file, then `cc("feature.Rraw")` can be used to run only chosen test script.
1616

1717
Usage of `cc()` from `R`:
1818
```r
19-
# run test
19+
# re-compile and attach
2020
cc()
21-
# change some files, run test
21+
# change some files, re-compile and re-attach
2222
cc()
23-
# compile, reload but not test
24-
cc(F)
25-
# clean, compile, reload but not test
23+
# compile, reload and run main test script
24+
cc(T)
25+
# clean, compile, reload
2626
cc(F, T)
27-
# clean, compile using specific compiler version, reload but not test
27+
# clean, compile using specific compiler version, reload
2828
cc(F, T, CC="gcc-8")
2929
```
3030

.dev/cc.R

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
# > cc()
66
# # change some files
77
# > cc()
8-
# # compile, reload but not test
9-
# > cc(F)
10-
# # clean, compile, reload but not test
8+
# # run your tests
9+
# # to compile, reload and run main test script
10+
# > cc(T)
11+
# # clean, compile, reload
1112
# > cc(F, T)
12-
# # clean, compile using specific version, reload but not test
13+
# # clean, compile using specific version, reload
1314
# > cc(F, T, CC="gcc-8")
1415
#
1516
# To debug C level :
@@ -23,7 +24,7 @@
2324

2425
options(datatable.print.class = TRUE)
2526

26-
sourceDir <- function(path=getwd(), trace = TRUE, ...) {
27+
sourceDir = function(path=getwd(), trace = TRUE, ...) {
2728
# copied verbatim from example(source) in base R
2829
for (nm in list.files(path, pattern = "\\.[RrSsQq]$")) {
2930
if(trace) cat(nm," ")
@@ -32,7 +33,7 @@ sourceDir <- function(path=getwd(), trace = TRUE, ...) {
3233
if(trace) cat("\n")
3334
}
3435

35-
cc = function(test=TRUE, clean=FALSE, debug=FALSE, omp=!debug, cc_dir, path=Sys.getenv("PROJ_PATH"), CC="gcc") {
36+
cc = function(test=FALSE, clean=FALSE, debug=FALSE, omp=!debug, cc_dir, path=Sys.getenv("PROJ_PATH"), CC="gcc") {
3637
if (!missing(cc_dir)) {
3738
warning("'cc_dir' arg is deprecated, use 'path' argument or 'PROJ_PATH' env var instead")
3839
path = cc_dir
@@ -87,5 +88,5 @@ cc = function(test=TRUE, clean=FALSE, debug=FALSE, omp=!debug, cc_dir, path=Sys.
8788
invisible()
8889
}
8990

90-
dd = function(omp=FALSE)cc(FALSE,debug=TRUE,omp=omp,clean=TRUE)
91+
dd = function(omp=FALSE)cc(test=FALSE,debug=TRUE,omp=omp,clean=TRUE)
9192

0 commit comments

Comments
 (0)