Skip to content
petamaj edited this page Mar 19, 2013 · 2 revisions

Welcome

This is the testR repository. Please be kind and patient, the source is still very young and is likely to change. Any suggestions are welcome.

Prerequisites

Only Python 3 and R are necessary. Currently only tested on Win8, but should work on all platforms that support the above languages (if it does not please let me know and also let me know if you are running it correctly on an os not listed here:)

Getting Started

To run all the tests, go to the root of the cloned source and type:

python testR.py -tp=GNU_R_PATH -t=gnur -r -v "language tests"

where GNU_R_PATH is path to your R executable. This will run all the language tests that are currently pushed in a verbose mode. For further help type --help, or even better see the code:)

#Test Structure

Each file in the directory specified that has an R suffix is considered to be a test file. Each test file consists of at least one R test. And each test starts with commands prefixed with #! and then the R code for the test. By default a test is executed and its output is checked to be only TRUE. Optional commands can be used to change the test outcome. The test commands are not necessary except for the #! command which sets the name of the test.

Commands

  • !t OUTPUT // tests against the OUTPUT and that no warning has been produced
  • !w TEXT // checks that the given warning was produced
  • !e TEXT // checks that the given error was produced
  • !o TEXT // tests against the TEXT in output (exact matching)

Sample test

#! This is a sample test to check that 2+3 is 5
a = 2
b = 3
c = a + b
c

See the tests already provided for more details.

Additional Pages

Test Structure Creating new VM adapters

Clone this wiki locally