Chapter 4. Testing

Table of Contents
4.1. Simple Test with Array
4.2. Tougher Test with Threads

Now that we've got everything compiled and installed, we need to test to make sure we've got everything working okay.

4.1. Simple Test with Array

Starting from the Boost sources base directory, you can find demo code for most of the parts of the library under the libs/ subdirectory. For example ${base}/libs/array contains a number of *.cpp and one *.hpp files. I copied these out to a location in my ${HOME} directory. I then created the following Makefile:

.PHONY: all clean
ALL=array1 array2 array3 array4 array5
all: ${ALL}
clean:
    ${RM} core* *.o
    ${RM} ${ALL}
   
Simply performing a make built all the demos correctly. No libraries are required for this test, only the Boost header files. These header files are found in /usr/local/include which is one of the directories gcc will search automatically.