Testing and program analysis
Program analysis and testing are essential components that work together to ensure the quality of our solutions. For instance, using Valgrind is more effective when running test code (because of its consistency and coverage). Therefore, we will configure testing and program analysis in the same place. Figure 15.5 illustrates the execution flow and files needed to set them up:
Figure 15.5: Files used to enable testing and program analysis
The numbers in parentheses represent the sequence in which listfiles are processed. Start from the top-level listfile and add the src
and test
directories:
- In
src
, includeCoverage
,Format
, andCppCheck
modules, and add thesrc/calc
andsrc/calc_console
directories. - In
src/calc
, define targets and configure them with included modules. - In
src/calc_console
, define targets and configure them with included modules. - In
test
, includeTesting
(which includesMemcheck
) and add thetest...