qttestrunner_exa.png

General Remarks

Notes about Qt 4.x:

General Requirements

QtTestRunner for Microsoft Windows

This section describes how to create the QtTestRunner library for Windows (2000, XP) with Microsoft VC++ 7.0 and Qt 3.x. The library can either be built with the Microsoft IDE or from the command line using qmake with Qt project files (.pro). Working with the IDE is the preferred approach because it ensures that all environment settings are correct and one isn't bothered with the proper settings of the PATH, INCLUDE or LIB environment variables.

Prerequisites

Building the QtTestRunner Library with the Microsoft IDE

The solution and project files mentioned in this section were created with the Microsoft Development Environment 2003 for VC++ 7.0 and the .NET framework 1.1.

  1. The CppUnit distribution contains all the QtTestRunner source files as well as the solution file QtTestRunner.sln and the project files qttestrunner.vcproj and qttestrunner_dll.vcproj suitable for the IDE.

  2. Unpack the CppUnit distribution into a folder of your choice.

  3. Open QtTestRunner.sln with the IDE which will show the two projects qttestrunner and qttestrunner_dll in the solution explorer.

  4. To successfully build the QtTestRunner library as a DLL the Qt library name must be adjusted in the linker's additional dependencies settings of the qttestrunner_dll project to correspond with your Qt version. For creating a static QtTestRunner library the Qt library isn't needed.

  5. Choose the configurations of interest in the IDE and let the build process start. After successful completion there will be, depending on the chosen configurations, static and dynamic versions of the QtTestRunner library in debug and release mode in the CPPUNIT\lib directory, namely qttestrunnerd.lib, qttestrunner.lib, qttestrunnerd_dll.lib, qttestrunnerd_dll.dll, qttestrunner_dll.lib and qttestrunner_dll.dll.

Building the QtTestRunner Library from the Command Line

The qmake and nmake utilities are used when creating the QtTestRunner library from the command line. However, if possible build the library with the IDE, otherwise you could end up spending some time for adjusting environment variables. This is especially true if different VC++ versions are installed on a system.

  1. Open a command window and set the working directory to CPPUNIT\src\qttestrunner.

  2. Enter
    qmake qttestrunnerlib.pro
    to create the file Makefile in the current directory. To run qmake like this QTDIR\bin must be in the PATH environment variable.

  3. Enter
    nmake
    which uses Makefile to build the QtTestRunner library. By default the library is built as static in debug mode. See the comments in qttestrunnerlib.pro for how to build it in another fashion. After successful completion there will be, depending on the chosen configurations, static and dynamic versions of the QtTestRunner library in debug and release mode in the CPPUNIT\lib directory, namely qttestrunnerd.lib, qttestrunner.lib, qttestrunnerd_dll.lib, qttestrunnerd_dll.dll, qttestrunner_dll.lib and qttestrunner_dll.dll.

  4. In the CppUnit distribution the script make_lib.bat is included, which does the last two steps at once by successively running qmake and nmake.

Related Pictures

This picture shows where to set preprocessor definitions in the project properties dialog of the Microsoft IDE:

preprocessor_defs.png

This picture shows where to set the runtime library in the project properties dialog of the Microsoft IDE:

runtime_lib.png

This picture shows where to define additional input files for the linker in the project properties dialog of the Microsoft IDE:

linker_input.png

QtTestRunner for Linux/Unix

This section describes how to create the QtTestRunner library for Linux (2.6.5-7.95-smp) with g++ (2.95.3) and Qt 3.x. The library is built from the command line using qmake with Qt project files (.pro). Building the library on other Unix OS should work as well.

Prerequisites

Building the QtTestRunner Library

The qmake and make utilities are used for creating the QtTestRunner library from the command line.

  1. Open an XTERM or similar console window and set the working directory to CPPUNIT/src/qttestrunner.

  2. Enter
    qmake qttestrunnerlib.pro
    to create the file Makefile in the current directory. To run qmake like this QTDIR/bin must be in the PATH environment variable.

  3. Enter
    make
    which uses Makefile to build the QtTestRunner library. By default the library is built as static in debug mode. See the comments in qttestrunnerlib.pro for how to build it in another fashion. After successful completion there will be, depending on the chosen configurations, static and dynamic versions of the QtTestRunner library in debug and release mode in the CPPUNIT/lib directory, namely libqttestrunnerd.a, libqttestrunner.a, libqttestrunnerd_shared.so and libqttestrunner_shared.so.

  4. In the CppUnit distribution the tcsh shell script make_lib is included, which does the last two steps at once by successively running qmake and make.

Verifying the QtTestRunner Library

Requirements

Verification on Microsoft Windows

This section describes how to create the QtTestRunner example program for Windows (2000, XP) with Microsoft VC++ 7.0 and Qt 3.x. The library can either be built with the Microsoft IDE or from the command line using qmake with Qt project files (.pro).

Prerequisites

Building the QtTestRunner Example with the Microsoft IDE

The solution and project files mentioned in this section were created with the Microsoft Development Environment 2003 for VC++ 7.0 and the .NET framework 1.1.

  1. Open qt_example.sln in folder CPPUNIT\examples\qt with the IDE which will show the two projects qt_example and qt_example_dll in the solution explorer. As the names suggest the qt_example project links with the static CppUnit and QtTestRunner libraries while the qt_example_dll project links with the dynamic CppUnit and QtTestRunner libraries.

    • To successfully link the example program the Qt library name must be adjusted in the linker's additional dependencies settings of the projects to correspond with your Qt version.
  2. Choose the projects and configurations of interest in the IDE and let the build process start. After successful completion there will be the executable qt_example.exe in the corresponding projects target destination subdirectory which can be Debug, DebugDLL, Release or ReleaseDLL.

  3. Run the program!
    • Make sure that CPPUNIT\lib is in the PATH environment variable when running the example program which uses the DLL's so it can load them at run-time.

Building the QtTestRunner Example from the Command Line

The qmake and nmake utilities are used when creating the QtTestRunner example from the command line. However, if possible build the program with the IDE, otherwise again you could end up spending some time for adjusting environment variables.

  1. Open a command window and set the working directory to CPPUNIT\examples\qt.

  2. Enter
    qmake qt_example.pro
    to create the file Makefile in the current directory. To run qmake like this QTDIR\bin must be in the PATH environment variable.

  3. Enter
    nmake
    which uses Makefile to build the QtTestRunner example program. By default the program is built using the static CppUnit and QtTestRunner libraries. See the comments in qt_example.pro for how to build it in another fashion.

  4. After successful completion there will be the executable qt_example.exe in the corresponding projects target destination subdirectory which can be Debug, DebugDLL, Release or ReleaseDLL.

  5. Run the program!
    • Make sure that CPPUNIT\lib is in the PATH environment variable when running the example program which uses the DLL's so it can load them at run-time.

  6. In the example directory there is the script make_example.bat which successively runs qmake and nmake as described above.

Verification on Linux/Unix

The configuration files needed to build the QtTestRunner example program are written for Linux (2.6.5-7.95-smp) with g++ (2.95.3) but should work fine in similar environments.

Prerequisites

Building the QtTestRunner Example

The qmake and make utilities are used for creating the QtTestRunner example from the command line.

  1. Open an XTERM or similar console window and set the working directory to CPPUNIT/examples/qt.

  2. Enter
    qmake qt_example.pro
    to create the file Makefile in the current directory. To run qmake like this QTDIR/bin must be in the PATH environment variable.

  3. Enter
    make
    which uses Makefile to build the QtTestRunner example program. By default the program is built using the static QtTestRunner library. See the comments in qt_example.pro for how to build it in another fashion.

  4. After successful completion there will be the executable qt_example in the current working directory.

  5. Run the program!
    • Make sure that CPPUNIT/lib is in the LD_LIBRARY_PATH environment variable when running the example program which uses the dynamic libraries so it can load them at run-time.

  6. In the example directory there is the tcsh shell script make_example which successively runs qmake and make as described above.

QtTestRunner (last edited 2008-02-26 06:29:58 by localhost)

SourceForge.net Logo