RComp is a simple framework for testing command line application output. It works by passing a specified command tests (files) by argument and comparing the result with expected output.
$ gem install rcomp
$ rcomp
Tasks:
rcomp generate # Generate expected output for all tests
rcomp help [TASK] # Describe available tasks or one specific task
rcomp init # Setup rcomp test directory
rcomp test # Run all tests
rcomp version # Prints RComp's version information
In your project root directory, run:
$ rcomp init
Then create some tests in rcomp/tests
After running rcomp init
the following directories are created by default:
.
|--rcomp
|----tests
|----expected
|----results
Stores test files. All subdirectories will be searched for tests.
Stores the expected output of tests. Format is testname.out
for stdout
and testname.err
for stderr
.
Managed by RComp. Stores the results of your most recent test suite run.
A simple RComp suite might look like:
.
|--rcomp
|----tests
|------test1.test
|------dir
|--------test2.test
|----expected
|------test1.out
|------dir
|--------test2.out
|--------test2.err
All custom configuration is stored in .rcomp
as YAML
Setting | Config | Default | Description |
---|---|---|---|
command | command: [COMMAND] |
Command RComp will run tests with | |
directory | directory: [DIRECTORY] |
rcomp |
Directory RComp will store tests, results and expected in |
ignore |
ignore:
- [PATTERN]
|
List of patterns RComp will ignore when finding tests | |
timeout | timeout: [TIMEOUT] |
5 |
Test execution time limit (seconds) |
Task | Alias |
---|---|
test |
t |
generate |
g |
version |
-v --version |
Copyright (c) 2012 Chris Knadler. See LICENSE for details.