Do not call moo_test_coverage_record() without --enable-coverage

This commit is contained in:
Yevgen Muntyan 2011-01-04 03:19:55 -08:00
parent a3d8878c98
commit c840efd772
2 changed files with 11 additions and 0 deletions

View File

@ -3,6 +3,10 @@ import sys
from mpi.module import *
tmpl_file_start = """\
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "moo-lua-api-util.h"
extern "C" void moo_test_coverage_record (const char *function);
@ -13,7 +17,9 @@ tmpl_cfunc_method_start = """\
static int
%(cfunc)s (gpointer pself, G_GNUC_UNUSED lua_State *L, G_GNUC_UNUSED int first_arg)
{
#ifdef MOO_ENABLE_COVERAGE
moo_test_coverage_record ("%(c_name)s");
#endif
MooLuaCurrentFunc cur_func ("%(current_function)s");
%(Class)s *self = (%(Class)s*) pself;
"""
@ -22,7 +28,9 @@ tmpl_cfunc_func_start = """\
static int
%(cfunc)s (G_GNUC_UNUSED lua_State *L)
{
#ifdef MOO_ENABLE_COVERAGE
moo_test_coverage_record ("%(c_name)s");
#endif
MooLuaCurrentFunc cur_func ("%(current_function)s");
"""

View File

@ -110,6 +110,9 @@ AC_ARG_ENABLE(coverage,
MOO_ENABLE_COVERAGE="no"
])
AM_CONDITIONAL(MOO_ENABLE_COVERAGE, test "x$MOO_ENABLE_COVERAGE" = "xyes")
if test "x$MOO_ENABLE_COVERAGE" = "xyes"; then
AC_DEFINE(MOO_ENABLE_COVERAGE, 1, [enable code coverage testing])
fi
if $MOO_OS_WIN32; then
AC_SUBST(MEDIT_WIN32_APP_UID,"7F9F899F-EE8A-47F0-9981-8C525AF78E4D")