diff --git a/dev-docs/source/RunningTheUnitTests.rst b/dev-docs/source/RunningTheUnitTests.rst index bb6ebc6c6786f1fd45d6d2bab05120fd907ffa30..fb93f74bca9bdb8def74fe9394435d0bd73f291d 100644 --- a/dev-docs/source/RunningTheUnitTests.rst +++ b/dev-docs/source/RunningTheUnitTests.rst @@ -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 #################### diff --git a/dev-docs/source/Standards/DocumentationGuideForDevs.rst b/dev-docs/source/Standards/DocumentationGuideForDevs.rst index a022439e85589f6dab17661f6fb862f058d534d2..81dd7ba2e2264540719ab7110866631a9a65269d 100644 --- a/dev-docs/source/Standards/DocumentationGuideForDevs.rst +++ b/dev-docs/source/Standards/DocumentationGuideForDevs.rst @@ -1,4 +1,4 @@ -.. _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