Skip to content
Snippets Groups Projects
Unverified Commit ebb8046b authored by Pete Peterson's avatar Pete Peterson Committed by GitHub
Browse files

Merge pull request #22455 from mantidproject/UpdateUnitTestDocs

Documentation : Running tests in VS and building dev-docs html.
parents 086052b6 f6f902de
No related branches found
No related tags found
No related merge requests found
......@@ -103,31 +103,39 @@ Starting in your build folder (e.g. Mantid/Code/debug):
- Not possible with ctest.
Visual Studio/ XCode note
#########################
Running Unit Tests With Visual Studio and ctest
###############################################
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. 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 project 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.
Running Unit Tests With Visual Studio
#####################################
The unit tests can be run from within Visual Studio, following steps 1-3 above, with the addition in step 2 of;
ctest -C Release -R Kernel -j4
- 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.
(-R Kernel), with 4 cores (-j4), in Release mode (-C Release).
Debugging unit tests
####################
......
.. _DocumentationGuideForDevs:
.. _DocumentationGuideForDevs:
============================
Documentation Guide for Devs
......@@ -247,3 +247,10 @@ For multi-configuration generators such as Visual Studio or XCode you will need
::
bin\Debug\MantidPlot -xq docs\runsphinx_doctest.py -R Rebin
Building the HTML Development Documentation
===========================================
The developer documentation is written as `.rst` files in the mantid source folder under ``dev-docs/``, the html files can be built using the `dev-docs-html` target. This will build all the development documentation into the mantid build folder under ``dev-docs/html/``.
In Visual Studio, this can be found in the "Documentation" folder in the solution explorer for the Mantid solution. Simply right click `dev-docs-html` and select build.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment