Skip to content

Commit

Permalink
add support for Travis checks from GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Jan 6, 2014
1 parent 17d4254 commit 66ca350
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 8 deletions.
1 change: 0 additions & 1 deletion .Rinstignore

This file was deleted.

32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Sample .travis.yml for R projects.
#
# See the r-travis repo and its wiki
# https://github.com/craigcitro/r-travis/wiki
# https://github.com/eddelbuettel/r-travis/

language: c

env:
global:
- _R_CHECK_FORCE_SUGGESTS_=FALSE
- RunRRedisTests=yes

before_install:
- curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh
- chmod 755 ./travis-tool.sh
- ./travis-tool.sh bootstrap

install:
- ./travis-tool.sh install_aptget redis-server

script:
- ./travis-tool.sh run_tests

after_failure:
- ./travis-tool.sh dump_logs

notifications:
email:
on_success: change
on_failure: change

3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Package: rredis
Type: Package
Title: Redis client for R
Version: 1.6.8.1
Version: 1.6.8.2
Date: 2014-01-05
Author: B. W. Lewis
Maintainer: B. W. Lewis <blewis@illposed.net>
Description: An R client for the Redis persistent key-value database available from http://redis.io.
License: Apache License (>= 2.0)
LazyLoad: yes
Suggests: RUnit
6 changes: 0 additions & 6 deletions inst/test/runTest.R

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 42 additions & 0 deletions tests/runUnitTests.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

## doRUnit.R --- Run RUnit tests
##
## with credits to package fUtilities in RMetrics
## which credits Gregor Gojanc's example in CRAN package 'gdata'
## as per the R Wiki http://wiki.r-project.org/rwiki/doku.php?id=developers:runit
## and changed further by Martin Maechler
## and more changes by Murray Stokely in HistogramTools
##
## Dirk Eddelbuettel, Jan 2014

stopifnot(require(RUnit, quietly=TRUE))
stopifnot(require(rredis, quietly=TRUE))

## Set a seed to make the test deterministic
set.seed(42)

## Define tests
testSuite <- defineTestSuite(name="rredis Unit Tests",
dirs=system.file("test", package="rredis"),
testFuncRegexp = "^[Tt]est+")

## rredis requires a redis server
## we cannot always assume one, so default to FALSE
runTests <- FALSE

## if we a redis server is set up, we can sigmal this
if (Sys.getenv("RunRRedisTests")=="yes") runTests <- TRUE

## Tests for test run
if (runTests) {
## Run tests
tests <- runTestSuite(testSuite)

## Print results
printTextProtocol(tests)

## Return success or failure to R CMD CHECK
if (getErrors(tests)$nFail > 0) {
stop("TEST FAILED!")
}
}

0 comments on commit 66ca350

Please sign in to comment.