Running the unit tests
From MantidProject
Contents |
Scons build
The Scons build builds all the unit tests for a package (e.g. Kernel, API etc.) into a single executable in the Build/Tests directory.
Linux/Mac
The excutables can be run directly, though you will need to set your LD_LIBRARY_PATH (DYLD_LIBRARY_PATH on Mac OSX) to point to Mantid/release or Mantid/debug according to you most recent build.
Windows Visual Studio
Type RunTests.bat followed by the executable file you want to run. The Windows RunTests.bat file can also be run without an argument in which case it will run all executable files in the directory. You may need to add Mantid\debug to your PATH environment variable
Visual studio or Eclipse build
For running tests during code development it is often easier to use the following mechanism. Within each sub project of Mantid (eg. API, Geometry, Algorithms) there is a test directory that holds the .h files that define the unit tests. Also with each of these directories are two files to simplify the process of compiling and running the tests: runTests.bat and runTests.sh. Both of these scripts work in the same way:
- Runs cxxtest.py to create a cpp file from the unit test .h files
- Compiles the cpp and .h files and links in to the Mantid shared libraries in the debug directory
- Runs the unit tests
Example usage: runTests.bat(sh) (This will run all of the unit tests in this directory) or runTests.bat(sh) WorkspaceTest.h (this will only run the tests in WorkspaceTest.h)
Debugging unit tests in your IDE
See the instructions here
Next: Building MantidPlot
