summaryrefslogtreecommitdiff
path: root/Source/UnitTests/README.md
blob: 5e70bc182eb2516957a7cb9b5a5929de67d017ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Unit testing infrastructure
===========================

Boogie uses [NUnit](http://www.nunit.org/) unit test framework.
We currently use NUnit 2.6.3, which was the latest stable
version available at the time of writing.


Installing NUnit
================

NUnit should be installed via [NuGet](https://www.nuget.org/) package manager.

The NuGet client is available as

* An extension to Visual Studio
* An add-in in Monodevelop
* A command line utility from the NuGet website

Note Mono ships with an old version of NUnit (2.4.8) which will cause
compilation issues. To fix this you must install NUnit via NuGet.


Running the tests
=================

Command line
------------

The ``run-unittests.py`` python script in the root directory of the project can be used to run the unit tests on the command line. This script is a simple wrapper for ``nunit-console.exe``.

```
$ python run-unittests.py Release
```

Run the following to see all the available options

```
$ python run-unittests.py --help
```

Monodevelop
-----------

Monodevelop has built in support for running NUnit tests. Goto the "Unit Tests"
panel and click "Run All".

Visual Studio
-------------

Visual studio needs the "NUnit Test Adapter for VS2012 and VS2013" add-in to be installed (Tools > Extensions and Updates). Once that is installed you can run unit tests by going 

1. Going to the Test Explorer (TEST > Windows > Test Explorer)
2. Clicking on "Run All" in the Test Explorer.