Skip to content

Latest commit

 

History

History
43 lines (25 loc) · 1.51 KB

3. Running - NUnit Tests.md

File metadata and controls

43 lines (25 loc) · 1.51 KB

NUnit Tests

Overview

The tests use NUnit to run instead of the inbuilt Visual Studio test system (more cross platform) <br >

Windows System Paths

In order to run QtCore (or any other Qt module) from within the generated QtSharp wrappers <br > We need to make sure the Qt library Dll's are findable by windows on the default path

  • Go to Start -> Control Panel -> System -> Advanced System Settings
  • Click on Environment Variables at the bottom
  • Select New, and enter in a new variable
  • Name: QTPATH Value: C:\Qt\Qt5.4.1\Tools\mingw491_32\bin;C:\Qt\Qt5.4.1\5.4\mingw491_32\bin

The paths may vary depending on your version of Qt and where it was installed <br >

  • Edit the Path variable and add ;%QTPATH% to the end of it
  • Restart Visual Studio before trying to run the tests

Running NUnit Tests - Visual Studio

In order to run the tests within Visual Studio:

First make sure the NUnit Test Adapter is installed for Visual Studio under the Extensions

  • Within Visual Studio 2013 Tools -> Extensions and Updates -> Install NUnit Test Adapter

Next we need to Build QtSharp.Tests (don't try to run it as a project, just build)

  • Right click the QtSharp.Tests project and select Build

Next make sure the test / platform setting is set to x32 to match the architecture setting of the QtSharp library

  • Test Menu -> Test Settings -> Default Processor Architecture -> X86

Next Run the Tests

  • Test Menu -> Windows -> Test Explorer
  • wait a while for it to analyse the available tests
  • Click Run All