How to run unit test in Rosetta 3

Compile source in test mode

Run
 scons cat=test 
. To build only the core tests (just like only building the rosetta++ code), you can do
 scons cat=test core 
. Protocols:
 scons cat=test protocols 

Run Unit Tests

There is two option to run unit test: 1. Run all unit test suits at once. 2. Run individual test suit. 3. Run individual unit test.

1. Run all unit test suits at once. This is preferred method for testing mini build before committing changes in to svn. To do this you will need to execute test/run.py python script. This can be done by following command: python test/run.py <optional command="" line="" arg>=""> Note: for most tests you will need to supply path to mini database with the following option: -database <path>

Currently run script execute following tests: ObjexxFCL, core, numeric, protocols, utility.

2. Run one test suite or one one particular test from one of the test suit. This method is useful if you working on unit test debugging, and want to save time by skipping some tests. To run one test suite you need first to locate it executable. Currently all builded unit test executable located in: build/test/... directory, executable files named by adding .test to the unit test suite name. Note: path may vary depending on platform you working on, for example for 32 bit Linux compiled with gcc it will be: 'build/test/debug/linux/2.6/32/x86/gcc'.

Test executable should be running from the build directory, this is important since some unit test will try to locate additional files needed using relative path. Example of command to run only core test executable:

cd build/test/debug/linux/2.6/32/x86/gcc ./core.test -database ~/minirosetta_database -mute core

If you want to run only one test or just one suite - you will need to supply name of the test function or name of the suite as a *first* argument to the test executable. Here the example of running only test_simple_min and suite MyTestSuite from core tests:

cd build/test/debug/linux/2.6/32/x86/gcc ./core.test test_simple_min -database ~/minirosetta_database -mute core

cd build/test/debug/linux/2.6/32/x86/gcc ./core.test MyTestSuite -database ~/minirosetta_database -mute core


Generated on Fri Mar 6 12:55:46 2009 for Rosetta Projects by  doxygen 1.5.2