Software tests: Difference between revisions

From VrlWiki
Jump to navigation Jump to search
Line 12: Line 12:


<pre>
<pre>
> /systest/bin/vrl_test -config  <My work area>/<Custom configuration>.cfg
> /systest/bin/vrl_fast -config  <My work area>/<Custom configuration>.cfg
</pre>
</pre>



Revision as of 14:11, 23 April 2010

Running Tests

The test driver is installed on all CS department machines. A configuration file is used to launch tests and mail results to subscribers. You can subscribe to a test summary or receive notices when select tests fail. The default configuration file is: $G/common/build/site/test.platform.cfg

If you want to perform a private test run and suppress mail notifications run:

> /systest/bin/vrl_fast  -noemail

To run a set of select tests and specify alternative mail notifications (usually to yourself) you can create and run using a custom configuration file. Make a private copy of the default configuration file and modify it. The comments in the default configuration file describe the format. Then run using the new configuration:

> /systest/bin/vrl_fast  -config  <My work area>/<Custom configuration>.cfg

Here is an example of a small custom configuration file.

#########################  test.platform.fast.cfg  #############################
#
Developer:  you@cs.brown.edu
Summary:    none

nag      none  linux common/build/valid/test.project.py common/include/nag
libnr    none  linux common/build/valid/test.project.py common/gg/libnr
libgg    none  linux common/build/valid/test.project.py common/gg/libgg
libds    none  linux common/build/valid/test.project.py common/gg/libds
libggpp  none  linux common/build/valid/test.project.py common/gg/libggpp
libnum   none  linux common/build/valid/test.project.py common/gg/libnum
libcff2  none  linux common/build/valid/test.project.py common/gg/libcff2
libmri   none  linux common/build/valid/test.project.py common/mri/libmri

#
#######################  end  test.platform.fast.cfg  ##########################

Writing Tests

It is a good idea to provide one or more quick tests that can be included in the test suite we run each night. Tests need to run in batch mode and simply return a zero status if successful and non-zero if they fail.

Create a make test target that runs a test that returns a zero status for success and a non-zero status for an error. The test should be able to run as a batch job (not interactive). Projects with multiple tests can use a target named test.<name> for each individual test and a target alltest to run them all.

Test targets should limit themselves to commands supported on both linux and Windows or use Python scripts. Currently only the "rm -f" and "diff" commands are supported. As always, absolute path names are to be avoided.

Large raw input files such as MRI images should be copied to a directory named $GROOT/data/<project>/test/. Cooked data and test output should go to a test directory inside the project directory. Tests should clear output files from prior runs to avoid false positives. Regression tests that use diff to check output should comapare against a file named: <root name>_base.<suffix>