Bug 885019 - Move GTEST_CPPSRCS, GTEST_CMMSRCS, and GTEST_CSRCS to moz.build as GTEST_CPP_SOURCES, GTEST_CMM_SOURCES, and GTEST_C_SOURCES. r=gps
☠☠ backed out by 2dd0c63b054e ☠ ☠
authorBrian O'Keefe <bokeefe@alum.wpi.edu>
Sat, 22 Jun 2013 10:33:31 -0400
changeset 136503 94c939eeb5f6a8361eebc00cf3618c6188a375b0
parent 136502 db69e91e26243e610d8cd17a0ac2b940d198dbfe
child 136504 ca7394903dd3fe7c9e35843c0b4c2e9e0920ec49
push id30139
push userryanvm@gmail.com
push dateWed, 26 Jun 2013 13:46:35 +0000
treeherdermozilla-inbound@4e41ddaef7c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs885019
milestone25.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 885019 - Move GTEST_CPPSRCS, GTEST_CMMSRCS, and GTEST_CSRCS to moz.build as GTEST_CPP_SOURCES, GTEST_CMM_SOURCES, and GTEST_C_SOURCES. r=gps
config/rules.mk
gfx/tests/gtest/Makefile.in
gfx/tests/gtest/moz.build
js/src/config/rules.mk
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/frontend/sandbox_symbols.py
python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
python/mozbuild/mozbuild/test/frontend/test_emitter.py
testing/gtest/Makefile.in
testing/gtest/moz.build
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -12,16 +12,19 @@ endif
 
 # Integrate with mozbuild-generated make files. We first verify that no
 # variables provided by the automatically generated .mk files are
 # present. If they are, this is a violation of the separation of
 # responsibility between Makefile.in and mozbuild files.
 _MOZBUILD_EXTERNAL_VARIABLES := \
   DIRS \
   EXTRA_PP_COMPONENTS \
+  GTEST_CMMSRCS \
+  GTEST_CPPSRCS \
+  GTEST_CSRCS \
   HOST_CSRCS \
   HOST_LIBRARY_NAME \
   MODULE \
   PARALLEL_DIRS \
   TEST_DIRS \
   TIERS \
   TOOL_DIRS \
   XPIDL_MODULE \
--- a/gfx/tests/gtest/Makefile.in
+++ b/gfx/tests/gtest/Makefile.in
@@ -18,28 +18,11 @@ IS_COMPONENT   = 1
 EXPORT_LIBRARY = 1
 
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/gfx/layers \
   -I$(topsrcdir)/gfx/2d \
   -I$(topsrcdir)/gfx/2d/unittest \
   $(NULL)
 
-GTEST_CPPSRCS = \
-  TestLayers.cpp \
-  TestTiledLayerBuffer.cpp \
-  TestAsyncPanZoomController.cpp \
-  $(NULL)
-
-# Because of gkmedia on windows we wont find these
-# symbols in xul.dll.
-ifneq ($(MOZ_WIDGET_TOOLKIT),windows)
-GTEST_CPPSRCS += \
-  TestMoz2D.cpp \
-  TestBase.cpp \
-  TestPoint.cpp \
-  TestScaling.cpp \
-  $(NULL)
-endif
-
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
--- a/gfx/tests/gtest/moz.build
+++ b/gfx/tests/gtest/moz.build
@@ -3,8 +3,23 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # 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/.
 
 MODULE = 'gfxtest'
 
 LIBRARY_NAME = 'gfxtest'
 
+GTEST_CPP_SOURCES += [
+    'TestAsyncPanZoomController.cpp',
+    'TestLayers.cpp',
+    'TestTiledLayerBuffer.cpp',
+]
+
+# Because of gkmedia on windows we wont find these
+# symbols in xul.dll.
+if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'windows':
+    GTEST_CPP_SOURCES += [
+        'TestBase.cpp'
+        'TestMoz2D.cpp'
+        'TestPoint.cpp'
+        'TestScaling.cpp'
+    ]
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -12,16 +12,19 @@ endif
 
 # Integrate with mozbuild-generated make files. We first verify that no
 # variables provided by the automatically generated .mk files are
 # present. If they are, this is a violation of the separation of
 # responsibility between Makefile.in and mozbuild files.
 _MOZBUILD_EXTERNAL_VARIABLES := \
   DIRS \
   EXTRA_PP_COMPONENTS \
+  GTEST_CMMSRCS \
+  GTEST_CPPSRCS \
+  GTEST_CSRCS \
   HOST_CSRCS \
   HOST_LIBRARY_NAME \
   MODULE \
   PARALLEL_DIRS \
   TEST_DIRS \
   TIERS \
   TOOL_DIRS \
   XPIDL_MODULE \
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -82,16 +82,19 @@ class TreeMetadataEmitter(object):
             ASFILES='ASFILES',
             CMMSRCS='CMMSRCS',
             CPPSRCS='CPP_SOURCES',
             CSRCS='CSRCS',
             DEFINES='DEFINES',
             EXTRA_COMPONENTS='EXTRA_COMPONENTS',
             EXTRA_JS_MODULES='EXTRA_JS_MODULES',
             EXTRA_PP_COMPONENTS='EXTRA_PP_COMPONENTS',
+            GTEST_CMMSRCS='GTEST_CMM_SOURCES',
+            GTEST_CPPSRCS='GTEST_CPP_SOURCES',
+            GTEST_CSRCS='GTEST_C_SOURCES',
             HOST_CSRCS='HOST_CSRCS',
             HOST_LIBRARY_NAME='HOST_LIBRARY_NAME',
             JS_MODULES_PATH='JS_MODULES_PATH',
             LIBRARY_NAME='LIBRARY_NAME',
             LIBS='LIBS',
             MODULE='MODULE',
             SDK_LIBRARY='SDK_LIBRARY',
             SHARED_LIBRARY_LIBS='SHARED_LIBRARY_LIBS',
--- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
+++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
@@ -113,16 +113,37 @@ VARIABLES = {
 
     'EXTRA_PP_COMPONENTS': (StrictOrderingOnAppendList, list, [],
         """Javascript XPCOM files.
 
        This variable contains a list of files to preprocess.  Generated
        files will be installed in the /components directory of the distribution.
         """),
 
+    'GTEST_C_SOURCES': (StrictOrderingOnAppendList, list, [],
+        """C code source files for GTest unit tests.
+
+        This variable contains a list of C GTEST unit test source files to
+        compile.
+        """),
+
+    'GTEST_CMM_SOURCES': (StrictOrderingOnAppendList, list, [],
+        """Sources for GTest unit tests to compile with the Objective C/C++ compiler.
+
+        This variable contains a list of objective-C++ GTest unit test sources
+        to compile.
+        """),
+
+    'GTEST_CPP_SOURCES': (list, list, [],
+        """C++ source files for GTest unit tests.
+
+        This is a list of C++ GTest unit test sources. Entries must be files
+        that exist. These generally have .cpp, .cc, or .cxx extensions.
+        """),
+
     'HOST_CSRCS': (StrictOrderingOnAppendList, list, [],
         """C source files to compile with the host compiler.
 
         This variable contains a list of C source files to compile.
         """),
 
     'PARALLEL_DIRS': (list, list, [],
         """A parallel version of DIRS.
--- a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
+++ b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
@@ -8,16 +8,20 @@ XPIDL_FLAGS = ['-Idir1', '-Idir2', '-Idi
 
 ASFILES = ['bar.s', 'foo.asm']
 
 DEFINES = ['-Dbar', '-Dfoo']
 
 EXTRA_COMPONENTS = ['bar.js', 'foo.js']
 EXTRA_PP_COMPONENTS = ['bar.pp.js', 'foo.pp.js']
 
+GTEST_C_SOURCES = ['test1.c', 'test2.c']
+GTEST_CMM_SOURCES = ['test1.mm', 'test2.mm']
+GTEST_CPP_SOURCES = ['test1.cpp', 'test2.cpp']
+
 HOST_CSRCS = ['bar.c', 'foo.c']
 
 HOST_LIBRARY_NAME = 'host_bar'
 
 LIBRARY_NAME = 'lib_name'
 LIBS = ['bar.lib', 'foo.lib']
 
 SDK_LIBRARY = ['bar.sdk', 'foo.sdk']
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -157,16 +157,28 @@ class TestRecursiveMakeBackend(BackendTe
             'EXTRA_COMPONENTS': [
                 'EXTRA_COMPONENTS += bar.js',
                 'EXTRA_COMPONENTS += foo.js',
             ],
             'EXTRA_PP_COMPONENTS': [
                 'EXTRA_PP_COMPONENTS += bar.pp.js',
                 'EXTRA_PP_COMPONENTS += foo.pp.js',
             ],
+            'GTEST_CMMSRCS': [
+                'GTEST_CMMSRCS += test1.mm',
+                'GTEST_CMMSRCS += test2.mm',
+            ],
+            'GTEST_CPPSRCS': [
+                'GTEST_CPPSRCS += test1.cpp',
+                'GTEST_CPPSRCS += test2.cpp',
+            ],
+            'GTEST_CSRCS': [
+                'GTEST_CSRCS += test1.c',
+                'GTEST_CSRCS += test2.c',
+            ],
             'HOST_CSRCS': [
                 'HOST_CSRCS += bar.c',
                 'HOST_CSRCS += foo.c',
             ],
             'HOST_LIBRARY_NAME': [
                 'HOST_LIBRARY_NAME := host_bar',
             ],
             'LIBRARY_NAME': [
--- a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
+++ b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
@@ -8,16 +8,20 @@ XPIDL_FLAGS += ['-Idir1', '-Idir2', '-Id
 
 ASFILES += ['fans.asm', 'tans.s']
 
 DEFINES=['-Dfans', '-Dtans']
 
 EXTRA_COMPONENTS=['fans.js', 'tans.js']
 EXTRA_PP_COMPONENTS=['fans.pp.js', 'tans.pp.js']
 
+GTEST_C_SOURCES = ['test1.c', 'test2.c']
+GTEST_CMM_SOURCES = ['test1.mm', 'test2.mm']
+GTEST_CPP_SOURCES = ['test1.cpp', 'test2.cpp']
+
 HOST_CSRCS += ['fans.c', 'tans.c']
 
 HOST_LIBRARY_NAME = 'host_fans'
 
 LIBRARY_NAME = 'lib_name'
 LIBS += ['fans.lib', 'tans.lib']
 
 SDK_LIBRARY += ['fans.sdk', 'tans.sdk']
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -126,16 +126,19 @@ class TestEmitterBasic(unittest.TestCase
 
         wanted = dict(
             ASFILES=['fans.asm', 'tans.s'],
             CMMSRCS=['fans.mm', 'tans.mm'],
             CSRCS=['fans.c', 'tans.c'],
             DEFINES=['-Dfans', '-Dtans'],
             EXTRA_COMPONENTS=['fans.js', 'tans.js'],
             EXTRA_PP_COMPONENTS=['fans.pp.js', 'tans.pp.js'],
+            GTEST_CSRCS=['test1.c', 'test2.c'],
+            GTEST_CMMSRCS=['test1.mm', 'test2.mm'],
+            GTEST_CPPSRCS=['test1.cpp', 'test2.cpp'],
             HOST_CSRCS=['fans.c', 'tans.c'],
             HOST_LIBRARY_NAME='host_fans',
             LIBRARY_NAME='lib_name',
             LIBS=['fans.lib', 'tans.lib'],
             SDK_LIBRARY=['fans.sdk', 'tans.sdk'],
             SHARED_LIBRARY_LIBS=['fans.sll', 'tans.sll'],
             SIMPLE_PROGRAMS=['fans.x', 'tans.x'],
             SSRCS=['fans.S', 'tans.S'],
--- a/testing/gtest/Makefile.in
+++ b/testing/gtest/Makefile.in
@@ -17,20 +17,16 @@ VPATH = \
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE_NAME = gtest
 EXPORT_LIBRARY = 1
 LIBXUL_LIBRARY = 1
 IS_COMPONENT = 1
 
-GTEST_CPPSRCS = \
-  SanityTest.cpp \
-  $(NULL)
-
 LOCAL_INCLUDES += \
   -I$(srcdir)/gtest \
   -I$(srcdir)/gtest/include \
   -I$(srcdir)/gmock \
   -I$(srcdir)/gmock/include \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/testing/gtest/moz.build
+++ b/testing/gtest/moz.build
@@ -56,8 +56,12 @@ EXPORTS.gmock.internal += [
 CPP_SOURCES += [
     'GTestRunner.cpp',
     'gmock-all.cc',
     'gtest-all.cc',
 ]
 
 LIBRARY_NAME = 'gtest'
 
+GTEST_CPP_SOURCES += [
+    'SanityTest.cpp',
+]
+