Skip to content

Building and running tests

Jorge Bay Gondra edited this page May 14, 2014 · 19 revisions

Prerequisites

To run the unit and integration tests you need to have NUnit 2.6 installed.

To run the integration tests you need a working ccm on your machine and to have python.exe in your %PATH%.

Using Visual Studio

You can use Visual Studio 2012+ to build the solution and run the tests.

Using MSBuild

You can build the solution with msbuild using the build/build.proj file.

Example: MSBuild.exe build/build.proj /v:m /t:test

Check out the MSBuild Command-Line Reference.

Build targets

compile

Clean previous builds and compiles the solution.

$ MSBuild.exe build/build.proj /v:m /t:compile

unit-test

Execute compile target and runs the test located in the Cassandra.Tests project.

$ MSBuild.exe build/build.proj /v:m /t:unit-test

To run the unit test, you will need to have the NUNIT_PATH environment variable pointing to the bin folder of the Nunit installation path, for example: C:\Program Files (x86)\NUnit 2.6.3\bin.

As an alternative, you can set NUNIT_PATH as a project-level property, using the switch /p:

$ MSBuild.exe build/build.proj /v:m /t:unit-test "/p:NUNIT_PATH=C:\Program Files (x86)\NUnit 2.6.3\bin"

test

Runs unit-test target and runs the tests located in the Cassandra.IntegrationTests project.

It also requires NUNIT_PATH environment variable.

ci

Modifies the assembly info to include the build number and runs test target.

You will need to set the BUILD_NUMBER environment variable.

Example using environment variables:

$ MSBuild.exe build/build.proj /v:n /t:ci

Example using command line arguments:

$ MSBuild.exe build/build.proj /v:n /t:ci "/p:NUNIT_PATH=C:\Program Files (x86)\NUnit 2.6.3\bin" /p:BUILD_NUMBER=12345
Clone this wiki locally