Bug 1169974 - Tolerate inconsistent-missing-override warnings for MOCK_METHOD2 macro from gtests. r=fitzgen.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 22 Sep 2015 17:33:02 -0700
changeset 263913 731200b5ab4eb8de42f8fc803738849ba341a8ad
parent 263912 b30b0dcc562c4fce5802c1ff222d0cd6c7309f53
child 263914 2343972473dad5ba7a1559b6b9c2300032f22c9a
push id29422
push usercbook@mozilla.com
push dateWed, 23 Sep 2015 10:32:35 +0000
treeherdermozilla-central@abe43c30d78d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs1169974
milestone44.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 1169974 - Tolerate inconsistent-missing-override warnings for MOCK_METHOD2 macro from gtests. r=fitzgen.
devtools/shared/heapsnapshot/tests/gtest/moz.build
layout/base/gtest/moz.build
--- a/devtools/shared/heapsnapshot/tests/gtest/moz.build
+++ b/devtools/shared/heapsnapshot/tests/gtest/moz.build
@@ -16,12 +16,14 @@ UNIFIED_SOURCES = [
     'DoesCrossZoneBoundaries.cpp',
     'DoesntCrossZoneBoundaries.cpp',
     'SerializesEdgeNames.cpp',
     'SerializesEverythingInHeapGraphOnce.cpp',
     'SerializesTypeNames.cpp',
     'UniqueStringHashPolicy.cpp',
 ]
 
-# XXX: We should fix these warnings.
-ALLOW_COMPILER_WARNINGS = True
+# THE MOCK_METHOD2 macro from gtest triggers this clang warning and it's hard
+# to work around, so we just ignore it.
+if CONFIG['CLANG_CXX']:
+  CXXFLAGS += ['-Wno-error=inconsistent-missing-override']
 
 FINAL_LIBRARY = 'xul-gtest'
--- a/layout/base/gtest/moz.build
+++ b/layout/base/gtest/moz.build
@@ -4,20 +4,20 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 UNIFIED_SOURCES += [
     'TestAccessibleCaretEventHub.cpp',
     'TestAccessibleCaretManager.cpp',
 ]
 
-# XXX: Allow -Winconsistent-missing-override for TestAccessibleCaretManager.cpp
-# that stub virtual methods have 'override' keyword while mocked methods by
-# MOCK_METHOD macro does not. (See 1169974)
-ALLOW_COMPILER_WARNINGS = True
+# THE MOCK_METHOD2 macro from gtest triggers this clang warning and it's hard
+# to work around, so we just ignore it.
+if CONFIG['CLANG_CXX']:
+  CXXFLAGS += ['-Wno-error=inconsistent-missing-override']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 LOCAL_INCLUDES += [
     '/docshell/base',
     '/layout/base',
     '/layout/style',
 ]