Step 1:

Install dependencies

For OS X: brew install lcov
For RHEL: sudo yum install lcov

Step 2:

Run cmake with coverage enabled

export MADLIB_ROOT=~/incubator-madlib
cd $MADLIB_ROOT
rm -rf build
mkdir build
cd build
cmake -DENABLE_COVERAGE=ON ..

Step 3:

Run make/install/tests as usual

make
$MADLIB_ROOT/build/src/bin/madpack -p postgres install
$MADLIB_ROOT/build/src/bin/madpack -p postgres install-check

Step 4:

Generate reports and view

make GenCoverageReport
open -a "Google Chrome" $MADLIB_ROOT/build/CodeCoverageReport/index.html

Step 5:

Reset coverage counters and run other tests

make ResetCoverageCounters
$MADLIB_ROOT/build/src/bin/madpack -p postgres install-check -t convex/lmf
make GenCoverageReport
open -a "Google Chrome" $MADLIB_ROOT/build/CodeCoverageReport/index.html
  • No labels