the Compartmented Robust Posix C++ Unit Test system |
|
---|
Before going on with the actual building, you need to run CMake. Create a temporary directory, which will be referred to as the <build-directory>.
Now, step by step
bash > cd <build-directory>
Run CMake with the parameters mentioned above. For example, with <build-directory>=/tmp/crpcut-1.9.4, support for google-mock installed in a directory not known to CMake, and with <prefix-dir> just next to google-mock.
bash > cmake -DCMAKE_BUILD_TYPE=debug -DWITH_GOOGLE_MOCK \
> -DGOOGLE_MOCK_DIR=/usr/local/development-tools/gmock \
> -DCMAKE_INSTALL_PREFIX=/usr/local/development-tools/crpcut \
> /tmp/crpcut-1.9.4
The output should look something like:
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test HAVE_CXX0X
-- Performing Test HAVE_CXX0X - Success
-- Looking for clock_gettime()
-- Looking for clock_gettime() - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for mach_absolute_time
-- Looking for mach_absolute_time - not found
-- Looking for getitimer
-- Looking for getitimer - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
*** compiling with support for valgrind
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/crpcut-1.9.4
Now you are ready to build crpcut All it takes is to run make.
bash > make
The output from make is too much to list here.
Run the self test, if you can. Before you start it, make sure the machine is lightly loaded.
Caution | |
---|---|
If you run the self test on a very slow computer, like a net book, timeout tests are likely to fail. |
The self test includes a lot of timeout tests, which can be affected by the load on the host. The self test may take up to a minute to run, with all those timeout tests under many different configurations.
bash > make selftest
Again, the output is a bit much to list here.
You are now ready to install crpcut Installation is done by running make install. Make sure you have write permission to <prefix-dir>.
The file <build-directory>/install_manifest contains a list of every file installed, should you want to remove them.
Now that the installation is done, you may want to get on with writing tests.