@@ -103,31 +103,33 @@ Starting in your build folder (e.g. Mantid/Code/debug):
- Not possible with ctest.
Visual Studio/ XCode note
#########################
Running Unit Tests from Within Visual Studio
############################################
In Visual Studio the user can alter the properties of the subset of
tests (inside the unitTest directory (e.g. AlgorithmTest). In the
properties box it is possible to specify a specific test to run by
typing its name in the TargetName box. Then to execute the test, right
click the subset of tests and select debug and then start new instance.
Open the Mantid solution in Visual Studio 2015. To run a subset of tests (for example ``UnitTests/AlgorithmsTest``);
To run the tests under one of these environments then you will need to
open a command window and change to the build directory. Once there you
can run the tests by selecting the configuration;
- In the Solution Explorer, right click the top level directory for the tests (in this case ``UnitTests/AlgorithmsTest``) and select Properties.
.. code-block:: sh
- In the Debugging tab of Properties change the Command Arguments box to the name of the test, for example "AddNoteTest".
ctest -C Debug -j4
-Right click the directory again and select Debug->Start new instance.
This runs all tests in Debug mode (note that this will NOT build any
outdated libraries). To select a subset use the ``-R`` option:
Once the build has finished, open a file browser and navigate to the mantid build directory, run the command-prompt.bat file to open a command prompt and run
.. code-block:: sh
.. code-block:: sh
ctest -C Debug -V -R AddNoteTest
For this example, there should be several lines of output ending with the time taken and the line
.. code-block:: sh
100% tests passed, 0 tests failed out of 1
Omitting the ``-R AddNoteTest`` option runs all the tests, but note that any tests which were not built according to the above instructions will fail. Adding the ``-V`` increases the output verbosity.
ctest -C Release -R Kernel -j4
-Alterntively, to use the Visual Studio debugger, add the name of the test to the Target Name field in the General tab of Properties. Then add a breakpoint somewhere in the test header file and select Debug->Start new instance as above.
(-R Kernel), with 4 cores (-j4), in Release mode (-C Release).
The developer documentation is written as .rst files, the html files can be built using a python script;
- Copy the python script ``runsphinx_html.py`` from the ``docs/`` directory from the mantid build directory, into ``dev-docs/``.
- Open the script (in e.g. Notepad++) and modify the paths of the following global variables at the top of the file to point to dev-docs rather than docs: ``CONF_DIR``, ``SPHINX_BUILD_DIR``, ``BUILD_DIR``.
- Open the ``command-prompt.bat`` file in the build directory to open a command prompt and enter (on Windows, for Linux/Mac change from backlslash to forward slashes);
- This will build all the development documentation into ``dev-docs/html/``, for specific files use the option ``-R name`` where name is a regular expression and therefore matched to parts of or entire filenames.