Rosetta 3.1 Release Manual

How to run unit test in Rosetta

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 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 the path to the 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 ~/rosetta_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 ~/rosetta_database -mute core

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


Generated on Tue Apr 20 07:50:05 2010 for Rosetta Projects by  doxygen 1.5.2

© Copyright Rosetta Commons Member Institutions. For more information, see http://www.rosettacommons.org.