Bug 1380665 - Define MOZ_CODE_COVERAGE for the entire tree. r=jmaher
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Thu, 13 Jul 2017 19:12:23 +0200
changeset 368797 32aa8aa9330bb79d7e01d0b4d62895e2dba9f51c
parent 368796 020581c23b7defb44a6b0efa74f0b734634e3653
child 368798 17dd6a9a4b5b282c3a751a8e9d70109749bab210
push id32173
push userryanvm@gmail.com
push dateFri, 14 Jul 2017 12:35:16 +0000
treeherdermozilla-central@66e27c932aae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1380665
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1380665 - Define MOZ_CODE_COVERAGE for the entire tree. r=jmaher
browser/config/mozconfigs/linux64/code-coverage
dom/ipc/moz.build
js/xpconnect/src/moz.build
old-configure.in
toolkit/moz.configure
toolkit/xre/moz.build
xpcom/tests/gtest/moz.build
--- a/browser/config/mozconfigs/linux64/code-coverage
+++ b/browser/config/mozconfigs/linux64/code-coverage
@@ -4,13 +4,13 @@ TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
 
 ac_add_options --disable-install-strip
 ac_add_options --disable-jemalloc
 ac_add_options --disable-crashreporter
 ac_add_options --disable-elf-hack
 ac_add_options --enable-debug
 ac_add_options --disable-sandbox
 ac_add_options --disable-profiling
+ac_add_options --enable-coverage
 
-MOZ_CODE_COVERAGE=1
 export CFLAGS="--coverage"
 export CXXFLAGS="--coverage"
 export LDFLAGS="--coverage -L$TOOLTOOL_DIR/gtk3/usr/local/lib"
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -158,19 +158,16 @@ if CONFIG['OS_ARCH'] != 'WINNT':
 DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG['BIN_SUFFIX']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2'):
     DEFINES['MOZ_ENABLE_FREETYPE'] = True
 
 if CONFIG['MOZ_TOOLKIT_SEARCH']:
     DEFINES['MOZ_TOOLKIT_SEARCH'] = True
 
-if CONFIG['MOZ_CODE_COVERAGE']:
-    DEFINES['MOZ_CODE_COVERAGE'] = True
-
 JAR_MANIFESTS += ['jar.mn']
 
 BROWSER_CHROME_MANIFESTS += ['tests/browser.ini']
 MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
 MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
--- a/js/xpconnect/src/moz.build
+++ b/js/xpconnect/src/moz.build
@@ -59,11 +59,8 @@ LOCAL_INCLUDES += [
     '/dom/workers',
     '/layout/base',
     '/layout/style',
     '/xpcom/reflect/xptinfo',
 ]
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wno-shadow', '-Werror=format']
-
-if CONFIG['MOZ_CODE_COVERAGE']:
-    DEFINES['MOZ_CODE_COVERAGE'] = True
--- a/old-configure.in
+++ b/old-configure.in
@@ -5199,17 +5199,16 @@ AC_SUBST(MOZ_FFVPX)
 AC_SUBST_LIST(FFVPX_ASFLAGS)
 AC_SUBST(MOZ_ANDROID_OMX)
 AC_SUBST(MOZ_OMX_PLUGIN)
 AC_SUBST(VPX_USE_YASM)
 AC_SUBST_LIST(VPX_ASFLAGS)
 AC_SUBST(VPX_AS_CONVERSION)
 AC_SUBST(VPX_X86_ASM)
 AC_SUBST(VPX_ARM_ASM)
-AC_SUBST(MOZ_CODE_COVERAGE)
 AC_SUBST(LIBJPEG_TURBO_USE_YASM)
 AC_SUBST_LIST(LIBJPEG_TURBO_ASFLAGS)
 AC_SUBST(MOZ_LIBAV_FFT)
 AC_SUBST_LIST(LIBAV_FFT_ASFLAGS)
 AC_SUBST(MOZ_DEVTOOLS)
 
 AC_SUBST(MOZ_PACKAGE_JSSHELL)
 AC_SUBST(MOZ_FOLD_LIBS)
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -1219,8 +1219,22 @@ def geckodriver(enable, automation, comp
     if enable.origin == 'default':
         linux32 = target.kernel == 'Linux' and target.cpu == 'x86'
         broken_platforms = cross_compile or linux32 or hazard
 
         if automation and compile_env and not broken_platforms:
             return True
 
 set_config('ENABLE_GECKODRIVER', geckodriver)
+
+# Code Coverage
+# ==============================================================
+
+option('--enable-coverage', env='MOZ_CODE_COVERAGE',
+       help='Enable code coverage')
+
+@depends('--enable-coverage')
+def code_coverage(value):
+    if value:
+        return True
+
+set_config('MOZ_CODE_COVERAGE', code_coverage)
+set_define('MOZ_CODE_COVERAGE', code_coverage)
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -218,11 +218,8 @@ FINAL_TARGET_PP_FILES += [
     'platform.ini'
 ]
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wno-error=shadow']
 
 if CONFIG['MOZ_IPDL_TESTS']:
     DEFINES['MOZ_IPDL_TESTS'] = True
-
-if CONFIG['MOZ_CODE_COVERAGE']:
-    DEFINES['MOZ_CODE_COVERAGE'] = True
--- a/xpcom/tests/gtest/moz.build
+++ b/xpcom/tests/gtest/moz.build
@@ -64,19 +64,16 @@ if CONFIG['MOZ_DEBUG'] and CONFIG['OS_AR
         'TestDeadlockDetectorScalability.cpp',
     ]
 
 if CONFIG['WRAP_STL_INCLUDES'] and not CONFIG['CLANG_CL']:
     UNIFIED_SOURCES += [
         'TestSTLWrappers.cpp',
     ]
 
-if CONFIG['MOZ_CODE_COVERAGE']:
-    DEFINES['MOZ_CODE_COVERAGE'] = True
-
 # Compile TestAllocReplacement separately so Windows headers don't pollute
 # the global namespace for other files.
 SOURCES += [
     'TestAllocReplacement.cpp',
     'TestCOMArray.cpp',
     'TestCOMPtr.cpp', # Redefines IFoo and IBar
     'TestHashtables.cpp', # Redefines IFoo
     'TestNsRefPtr.cpp', # Redefines Foo