Print this page

QxCppUnit Library Installation Instructions

These installation instructions describe how to build the library from source code. For general instructions see QxRunner Installation first.

Specific Requirements

  • The QxRunner library is installed.
  • The CppUnit library is installed. If not yet then get it from http://sourceforge.net/projects/cppunit.
  • An environment variable named CPPUNIT must point to the top directory of the CppUnit installation.

Configuration Specifics

A QxCppUnit library built with the debug_static or release_static configuration doesn't have to be linked with the QxRunner nor with the CppUnit library.

The debug_dll and release_dll configurations on Windows link the QxCppUnit DLL with the QxRunner DLL and CppUnit DLL in the corresponding debug or release mode.

The debug_dll and release_dll configurations on Linux link the QxCppUnit shared image with the QxRunner shared image in the corresponding debug or release mode. Which CppUnit library is used for linking depends on what files the linker finds in the CPPUNIT/lib directory.

For more details about configurations see the CONFIG values description.

Building the Library on Windows

Directories and Library Names

Configuration specific intermediate build directories and resulting libraries have the following names:

Configuration Build Directory Library Name Remarks
debug_static Debug qxcppunitd.lib
debug_dll Debug_DLL qxcppunitd_dll.dll
qxcppunitd_dll.lib

(import library)
release_static Release qxcppunit.lib
release_dll Release_DLL qxcppunit_dll.dll
qxcppunit_dll.lib

(import library)

If the build of a configuration is successfull the library and related artifacts are copied from the build directory to the QXRUNNER\lib directory.

Building with the Visual Studio IDE

These instructions are valid for the Visual Studio 2005 IDE with CL 14.x only.

  1. Open the solution file qxcppunit.sln in the QXRUNNER\src\qxcppunit directory.
  2. Select the configurations of your choice in the Batch build dialog and press the appropriate button to start the build process:



    Configurations in the IDE have names commonly used in the VS IDE, therefore use these mappings:

    VS IDE corresponds to qmake
    Debug <-> debug_static
    Debug_DLL <-> debug_dll
    Release <-> release_static
    Release_DLL <-> release_dll

Building from the Command Line

These instructions are valid for the MSVC 8.0 build tools.

  1. Open a command window.
  2. Go to the QXRUNNER\src\qxcppunit directory.
  3. Enter

    qmake qxcppunit.pro

    This expands the information in the qmake project file to the file Makefile in the current directory.
  4. Execute the commands in Makefile for compiling and linking the project by entering

    nmake

By default the library is built as a static library in debug mode. Change the configuration by passing the corresponding CONFIG assignment on the command line.

Building the Library on Linux

Directories and Library Names

Configuration specific intermediate build directories and resulting libraries have the following names:

Configuration Build Directory Library Name
debug_static .debug libqxcppunitd.a
debug_dll .debug_shared libqxcppunitd_shared.so
release_static .release libqxcppunit.a
release_dll .release_shared libqxcppunit_shared.so

The library gets created directly in the QXRUNNER/lib directory.

Building from the Command Line

These instructions are valid for the GNU build tools.

  1. Open a terminal window.
  2. Go to the QXRUNNER/src/qxcppunit directory.
  3. Enter

    qmake qxcppunit.pro

    This expands the information in the qmake project file to the file Makefile in the current directory.
  4. Execute the commands in Makefile for compiling and linking the project by entering

    make

By default the library is built as a static library in debug mode. Change the configuration by passing the corresponding CONFIG assignment on the command line.

Verification with the Demo Program

A demo program is provided with the QxRunner distribution that can be used to verify the proper functioning of the QxCppUnit library. If the build of a configuration is successfull the executable qxcppunitdemo.exe on Windows or qxcppunitdemo on Linux can be found in the configuration related build directory. When started the demo program appears on the screen as shown in the Screenshots page.

The same tools as used for building the QxCppUnit library are used to create the demo program. The debug_static and release_static configurations link with the static QxCppUnit library in the corresponding debug or release mode. Configurations debug_dll and release_dll link with the QxCppUnit DLL on Windows or the QxCppUnit shared image on Linux in the corresponding debug or release mode. In addition the program gets linked with the QxRunner and CppUnit libraries in the format suitable for the chosen configuration.

Building on Windows with the Visual Studio IDE

These instructions are valid for the Visual Studio 2005 IDE with CL 14.x only.

  1. Open the solution file qxcppunitdemo.sln in the QXRUNNER\examples\qxcppunitdemo directory.
  2. Select the configurations of your choice in the Batch build dialog and press the appropriate button to start the build process:

Building on Windows from the Command Line

  1. Open a command window.
  2. Go to the QXRUNNER\examples\qxcppunitdemo directory.
  3. Enter

    qmake qxcppunitdemo.pro

  4. Enter

    nmake

By default the program is built in debug mode and linked with the debug static QxCppUnit library and related QxRunner and CppUnit libraries. Change the configuration by passing the corresponding CONFIG assignment on the command line.

Building on Linux from the Command Line

  1. Open a terminal window.
  2. Go to the QXRUNNER/examples/qxcppunitdemo directory.
  3. Enter

    qmake qxcppunitdemo.pro

  4. Enter

    make

By default the program is built in debug mode and linked with the debug static QxCppUnit library and related QxRunner and CppUnit libraries. Change the configuration by passing the corresponding CONFIG assignment on the command line.


Previous page: QxCppUnit Library User Guide
Next page: Screenshots