Skip to content

Commit

Permalink
Reeanble tests on Travis Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Stubner committed Feb 2, 2018
1 parent fabad35 commit e0e1237
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 15 deletions.
3 changes: 0 additions & 3 deletions tests/testthat/test-fastLm.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ X <- matrix(rnorm(n*p), ncol=p)
y <- X %*% c(rep(0.5, p)) + rnorm(n)

test_that("models from R and AF are similar", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
# fit model with R and AF
modelR <- lm.fit(X, y)
modelAF <- fastLmPure(X, y)
Expand All @@ -20,15 +19,13 @@ test_that("models from R and AF are similar", {
})

test_that("including intercept works", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
X <- cbind(1, X)
modelAF <- fastLmPure(X, y)
expect_true(modelAF$intercept)
expect_equal(length(modelAF$coefficients), p + 1)
})

test_that("models from R and AF on CPU are very similar", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
skip_on_os("mac")
arrayfire_set_backend("CPU")
# fit model with R and AF
Expand Down
5 changes: 0 additions & 5 deletions tests/testthat/test-general.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
context("general")

test_that("info message is produced", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
expect_output(arrayfire_info(), regex = "^ArrayFire v.*")
})

test_that("getting and setting the device works", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
device_count <- arrayfire_count_device()
for (i in 1:device_count) {
arrayfire_set_device(i)
Expand All @@ -15,7 +13,6 @@ test_that("getting and setting the device works", {
})

test_that("getting device info works", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
device_info <- arrayfire_device_info()
expect_type(device_info, "list")
expect_type(device_info$name, "character")
Expand All @@ -26,7 +23,6 @@ test_that("getting device info works", {


test_that("getting and setting the backend works", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
backends <- arrayfire_get_available_backends()
for (backend in backends) {
arrayfire_set_backend(backend)
Expand All @@ -35,7 +31,6 @@ test_that("getting and setting the backend works", {
})

test_that("set_backend w/o argument uses DEFAULT", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
skip_on_os("mac")
arrayfire_set_backend("DEFAULT")
default_backend <- arrayfire_get_active_backend()
Expand Down
4 changes: 0 additions & 4 deletions tests/testthat/test-inline-dims.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,21 @@ doubleArray <- inline::cxxfunction(signature(xs = "RcppArrayFire::typed_array<f3


test_that("1d array multiplication works", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
x <- 1:16
expect_equal(2 * x, doubleArray(x))
})

test_that("2d array multiplication works", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
x <- array(1:16, dim = c(2, 8))
expect_equal(2 * x, doubleArray(x))
})

test_that("3d array multiplication works", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
x <- array(1:16, dim = c(2, 2, 4))
expect_equal(2 * x, doubleArray(x))
})

test_that("4d array multiplication works", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
x <- array(1:16, dim = c(2, 2, 2, 2))
expect_equal(2 * x, doubleArray(x))
})
3 changes: 0 additions & 3 deletions tests/testthat/test-rng.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ context("rng")
seed <- 12345678901234567890

test_that("setting and getting the random seed works", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
arrayfire_set_seed(seed)
expect_equal(seed, arrayfire_get_seed())
})

test_that("setting seed produces identical uniformly distributed numbers", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
arrayfire_set_seed(seed)
u1 <- fastRunif(10)
arrayfire_set_seed(seed)
Expand All @@ -18,7 +16,6 @@ test_that("setting seed produces identical uniformly distributed numbers", {
})

test_that("setting seed produces identical normaly distributed numbers", {
skip_if(identical(Sys.getenv("TRAVIS_OS_NAME"), "osx"), message = "On Travis Mac")
arrayfire_set_seed(seed)
n1 <- fastRnorm(10)
arrayfire_set_seed(seed)
Expand Down

0 comments on commit e0e1237

Please sign in to comment.