Tutorial

xgsa edited this page Mar 13, 2012 · 17 revisions

Tutorial: How to try C/C++ Tests Runner for Eclipse CDT

Requirements:

C/C++ Tests Runner requires Eclipse Platform (3.6 or higher) and CDT (7 or higher) installed and one of the unit testing libraries (Boost.Test, Qt Test or Google Testing Framework). You also need test modules (executable files that were built with one of the testing frameworks). You can also get a few demo test modules for windows or for linux.

Installation:

  • The easies way is to use project demo Eclipse update site. Copy this link to your Eclipse update manager.
  • Otherwise you can go to the project page and download zipped update site (or get it directly).

Tests running

  1. Run Eclipse and select a workspace or create a new one.
  2. Create a new C/C++ Project (if there is no in workspace yet).
  3. Add a new run configuration "Run C/C++ Tests":
    • specify project name on the "Main" tab
    • specify binary file which is a test module on the "Main" tab;
    • choose the tests runner (Boost or Qt) on the "C/C++ Testing" tab;
    • you should also configure sources path if necessary (if you use demo test modules mentioned above you should add a directory with test modules to the source lookup paths). Tests Runner Selection Screenshot

Now you can run created configuration.

Testing results will be shown in the "C++ Test Results" view. You can view tests hierarchy, tests status and testing errors (if any). You can also go to the error location by clicking (or double clicking) on message (if source lookup was configured correctly).

Test results view for Qt test module: Qt Tests Results View Screenshot

Test results view for Boost test module: Boost Tests Results View Screenshot

Test results view for Google test module: Google Tests Results View Screenshot


Show all the features and known problems.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.