Improve coverage computation
This commit is contained in:
1 parent
1d163a396e
commit
aebe1308fc
8 files changed
+22
-8
No files matched your search
+1
-1
@@ -68,7 +68,7 @@ all:
|
|||||||
awk ' printit { print } /END_COVERAGE/ { printit=1}' $< > $<.end.c
|
awk ' printit { print } /END_COVERAGE/ { printit=1}' $< > $<.end.c
|
||||||
$(CC) $(CPPFLAGS) -E -DNDEBUG -DWITHIN_COVERAGE $< |grep -v '^#' |awk ' /END_COVERAGE/ { printit=0} printit { print } /START_COVERAGE/ { printit=1 }' |perl -p -e "s/;(?![\"'])/;\n/g ; s/}(?![\"'])/}\n/g ; s/{(?![\"'])/{\n/g" > $<.middle.c
|
$(CC) $(CPPFLAGS) -E -DNDEBUG -DWITHIN_COVERAGE $< |grep -v '^#' |awk ' /END_COVERAGE/ { printit=0} printit { print } /START_COVERAGE/ { printit=1 }' |perl -p -e "s/;(?![\"'])/;\n/g ; s/}(?![\"'])/}\n/g ; s/{(?![\"'])/{\n/g" > $<.middle.c
|
||||||
cat $<.first.c $<.middle.c $<.end.c > $<.c
|
cat $<.first.c $<.middle.c $<.end.c > $<.c
|
||||||
$(CC) $(CPPFLAGS) -ftest-coverage -fprofile-arcs -O -g $<.c -o $<.exe $(LDFLAGS)
|
$(CC) $(CPPFLAGS) -DBUILD_COVERAGE -ftest-coverage -fprofile-arcs -O -g $<.c -o $<.exe $(LDFLAGS)
|
||||||
$(LOG_COMPILER) ./$<.exe
|
$(LOG_COMPILER) ./$<.exe
|
||||||
LANG=C gcov -b $<.gcno > `basename $< .c`.synt
|
LANG=C gcov -b $<.gcno > `basename $< .c`.synt
|
||||||
cat `basename $< .c`.synt
|
cat `basename $< .c`.synt
|
||||||
|
|||||||
+5
-2
@@ -40,10 +40,9 @@
|
|||||||
It'll contain the macro expanded & annotated.
|
It'll contain the macro expanded & annotated.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef WITHIN_COVERAGE
|
#if defined(WITHIN_COVERAGE) || defined (BUILD_COVERAGE)
|
||||||
/* For coverage build, expand the typical macros assert, avoid expanding then
|
/* For coverage build, expand the typical macros assert, avoid expanding then
|
||||||
to not disturb coverage measurement */
|
to not disturb coverage measurement */
|
||||||
#undef assert
|
|
||||||
#undef M_ASSERT
|
#undef M_ASSERT
|
||||||
#define M_ASSERT(...) (void)0
|
#define M_ASSERT(...) (void)0
|
||||||
#undef M_ASSERT_SLOW
|
#undef M_ASSERT_SLOW
|
||||||
@@ -127,7 +126,11 @@
|
|||||||
/* Overwrite M_UNLIKELY_NOMEM so that it can never fails, to avoid spurious coverage */
|
/* Overwrite M_UNLIKELY_NOMEM so that it can never fails, to avoid spurious coverage */
|
||||||
#undef M_UNLIKELY_NOMEM
|
#undef M_UNLIKELY_NOMEM
|
||||||
#define M_UNLIKELY_NOMEM(...) 0
|
#define M_UNLIKELY_NOMEM(...) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WITHIN_COVERAGE
|
||||||
/* For coverage build, do not expand other likes NULL, etc. */
|
/* For coverage build, do not expand other likes NULL, etc. */
|
||||||
|
#undef assert
|
||||||
#undef M_STATIC_FAILURE
|
#undef M_STATIC_FAILURE
|
||||||
#undef NULL
|
#undef NULL
|
||||||
#undef M_LIKELY
|
#undef M_LIKELY
|
||||||
|
|||||||
@@ -21,8 +21,9 @@
|
|||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "m-string.h"
|
#include "m-string.h"
|
||||||
|
#include "coverage.h"
|
||||||
|
|
||||||
#include "m-bitset.h"
|
#include "m-bitset.h"
|
||||||
|
|
||||||
static void test1(void)
|
static void test1(void)
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "m-thread.h"
|
#include "m-thread.h"
|
||||||
#include "m-atomic.h"
|
#include "m-atomic.h"
|
||||||
|
#include "m-core.h"
|
||||||
|
#include "coverage.h"
|
||||||
|
|
||||||
#include "m-genint.h"
|
#include "m-genint.h"
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,14 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "m-serial-bin.h"
|
|
||||||
#include "m-tuple.h"
|
#include "m-tuple.h"
|
||||||
#include "m-array.h"
|
#include "m-array.h"
|
||||||
#include "m-variant.h"
|
#include "m-variant.h"
|
||||||
#include "m-list.h"
|
#include "m-list.h"
|
||||||
#include "m-dict.h"
|
#include "m-dict.h"
|
||||||
|
#include "coverage.h"
|
||||||
|
|
||||||
|
#include "m-serial-bin.h"
|
||||||
|
|
||||||
// Serial bin is not supported for standard types if not C11
|
// Serial bin is not supported for standard types if not C11
|
||||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||||
|
|||||||
@@ -20,12 +20,14 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "m-serial-json.h"
|
|
||||||
#include "m-tuple.h"
|
#include "m-tuple.h"
|
||||||
#include "m-array.h"
|
#include "m-array.h"
|
||||||
#include "m-variant.h"
|
#include "m-variant.h"
|
||||||
#include "m-list.h"
|
#include "m-list.h"
|
||||||
#include "m-dict.h"
|
#include "m-dict.h"
|
||||||
|
#include "coverage.h"
|
||||||
|
|
||||||
|
#include "m-serial-json.h"
|
||||||
|
|
||||||
// Serial json is not supported for standard types if not C11
|
// Serial json is not supported for standard types if not C11
|
||||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||||
|
|||||||
@@ -22,6 +22,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define M_USE_ADDITIONAL_CHECKS 1
|
#define M_USE_ADDITIONAL_CHECKS 1
|
||||||
|
#include "m-core.h"
|
||||||
|
#include "coverage.h"
|
||||||
|
|
||||||
#include "m-string.h"
|
#include "m-string.h"
|
||||||
|
|
||||||
BOUNDED_STRING_DEF(string16, 16)
|
BOUNDED_STRING_DEF(string16, 16)
|
||||||
|
|||||||
@@ -20,8 +20,9 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include "m-core.h"
|
||||||
#include <assert.h>
|
#include "coverage.h"
|
||||||
|
|
||||||
#include "m-worker.h"
|
#include "m-worker.h"
|
||||||
|
|
||||||
/* Compute Fibonacci number using thread systems. */
|
/* Compute Fibonacci number using thread systems. */
|
||||||
|
|||||||
Reference in new issue
Block a user