1ecfeb160abcad4b6f5b378cbab209fd65390a64
[sliver-openvswitch.git] / tests / lcov-pre.at
1 AT_BANNER([code coverage])
2
3 m4_define([_OVS_RUN_LCOV], [test $LCOV = false || lcov -b $abs_top_builddir -d $abs_top_builddir $1])
4
5 AT_SETUP([initialize lcov])
6 AT_CHECK([rm -fr $abs_builddir/coverage.html])
7 AT_CHECK([rm -f $abs_builddir/coverage.info])
8 AT_CHECK([$LCOV || exit 77])
9 AT_CHECK([_OVS_RUN_LCOV([-c -i -o - > $abs_builddir/coverage.info])], [0], [ignore], [ignore])
10 AT_CLEANUP
11
12 # OVS_CHECK_LCOV(COMMAND, [STATUS = `0'], [STDOUT = `'], [STDERR = `'], 
13 #                [RUN-IF-FAIL], [RUN-IF-PASS])
14 #
15 # This macro is equivalent to AT_CHECK, except that COMMAND should be a single
16 # shell command that invokes a program whose code coverage is to be measured
17 # (if configure was invoked with --coverage).  
18 m4_define([OVS_CHECK_LCOV],
19     [AT_CHECK([_OVS_RUN_LCOV([-z])], [0], [ignore], [ignore])
20      AT_CHECK($@)
21      AT_CHECK([_OVS_RUN_LCOV([-c -o - >> $abs_builddir/coverage.info])], [0], [ignore], [ignore])])