Skip to content

Commit cd57ecc

Browse files
TESTS: More test coverage
1 parent 9652003 commit cd57ecc

File tree

5 files changed

+56
-4
lines changed

5 files changed

+56
-4
lines changed

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: future.batchtools
22
==========================
33

4-
Version: 0.4.0-9000 [2017-05-16]
4+
Version: 0.4.0-9000 [2017-06-01]
55

66
o ...
77

tests/future,labels.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
source("incl/start.R")
2-
supportedStrategies <- future:::supportedStrategies
32

43
message("*** Futures - labels ...")
54

6-
strategies <- supportedStrategies()
7-
strategies <- setdiff(strategies, "multiprocess")
85
strategies <- c("batchtools_local")
96

107
for (strategy in strategies) {

tests/future,lazy.R

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
source("incl/start.R")
2+
3+
message("*** Futures - lazy ...")
4+
5+
strategies <- c("batchtools_local")
6+
7+
for (strategy in strategies) {
8+
mprintf("- plan('%s') ...", strategy)
9+
plan(strategy)
10+
11+
a <- 42
12+
f <- future(2 * a, lazy = TRUE)
13+
a <- 21
14+
v <- value(f)
15+
stopifnot(v == 84)
16+
17+
a <- 42
18+
v %<-% { 2 * a } %lazy% TRUE
19+
a <- 21
20+
stopifnot(v == 84)
21+
22+
mprintf("- plan('%s') ... DONE", strategy)
23+
} ## for (strategy ...)
24+
25+
message("*** Futures - lazy ... DONE")
26+
27+
source("incl/end.R")

tests/resources_OP.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
source("incl/start.R")
2+
3+
message("*** %resources% ...")
4+
5+
plan(batchtools_local)
6+
7+
## This will test `%resources%` but it'll be ignored
8+
## (with a warning) by batchtools_local()
9+
y %<-% { 42 } %resources% list(mem = "42gb")
10+
11+
message("*** %resources% ... DONE")
12+
13+
source("incl/end.R")

tests/zzz.onUnload.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
source("incl/start.R")
2+
3+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4+
# Load and unload of package
5+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6+
loadNamespace("future.batchtools")
7+
8+
message("*** .onUnload() ...")
9+
10+
libpath <- dirname(system.file(package = "future.batchtools"))
11+
future.batchtools:::.onUnload(libpath)
12+
13+
message("*** .onUnload() ... DONE")
14+
15+
source("incl/end.R")

0 commit comments

Comments
 (0)