Rosetta 3.3
Mover test HowTo

The test::UMoverTest package provides a system for quickly and simple way to add new Unit test for Movers classes using UMoverTest class and macros.

Purpose of this document is to provide user with HowTo document to help create new unit tests.


1. Deciding on location for Unit Test. In most cases, if NewMover is not require any special initialization, then good location for adding unit test will be existing file: test/protocols/moves/MoversTest.cxxtest.hh

2. creating unit test macro. In function MoversTest.cxxtest.hh:test_AllMovers: add following line: TEST_MOVER(NewMover, "protocols/moves/test_in.pdb", "protocols/moves/newmover_out.pdb");

3. Compile mini and mini unit test by running: 'scons -j8 && scons -j8 cat=test'. Make sure thats both compilation finished without error.

4. Run unit test to create pdb file on which NewMover was applied: 'python test/ -database ~/minirosetta_database'

5. Unit test for test_AllMovers will fail - that to be expected. Failing message will be something like: Test suite: MoversTest (test/protocols/moves/MoversTest.cxxtest.hh) File: ./test/protocols/moves/MoversTest.cxxtest.hh Line:47 MoversTest::NewMoverFiles are not equal! CXXTEST_ERROR: test_AllMovers:NewMover Failed!

In MoversTest::test_AllMovers: ./test/protocols/moves/MoversTest.cxxtest.hh:47: Error: Test failed: test_AllMovers CXXTEST_ERROR: test_AllMovers Failed!

6. Check if the result PDB file is correct. Find output PDB file in the test build folder inside protocols/moves. File name will be: 'newmover_out.pdb._tmp_' (Note; depending of the platform path to PDB may vary. For example for gcc build on Linux it may be:'build/test/debug/linux/2.6/32/x86/gcc/protocols/moves') Load output PDB in to pymol or otherwise check if output PDB is correct.

7. Rename and copy output pdb file to test/protocols/moves/newmover_out.pdb.

8. Modify test/protocols.test.settings by adding line: "moves/newmoves_out.pdb", in to 'testinputfiles = [ "moves/test_in.pdb", ' group.

9. Recompile mini unit tests. Note: you will need to modify file MoversTest.cxxtest.hh to triger copy file mechanics.

10. Run unit test, make sure it complete without errors.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines