Bug 888643 - Part a: Support CPP_UNIT_TESTS in moz.build files; r=gps
authorMs2ger <ms2ger@gmail.com>
Wed, 24 Jul 2013 09:20:00 +0200
changeset 151932 8a0c0ccab65f7b204316861fab5004d2fdbf84fc
parent 151931 2983ca6d4d1aa0b425db2bfbd49e9efe338685da
child 151933 321a9432686db2dd566435fef316bb2b6114e48b
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs888643
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 888643 - Part a: Support CPP_UNIT_TESTS in moz.build files; r=gps
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
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -78,16 +78,17 @@ class TreeMetadataEmitter(object):
         # them. We should aim to keep this set small because it violates the
         # desired abstraction of the build definition away from makefiles.
         passthru = VariablePassthru(sandbox)
         varmap = dict(
             # Makefile.in : moz.build
             ASFILES='ASFILES',
             CMMSRCS='CMMSRCS',
             CPPSRCS='CPP_SOURCES',
+            CPP_UNIT_TESTS='CPP_UNIT_TESTS',
             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',
--- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
+++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
@@ -114,16 +114,23 @@ 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.
         """),
 
+    'CPP_UNIT_TESTS': (StrictOrderingOnAppendList, list, [],
+        """C++ source files for unit tests.
+
+        This is a list of C++ unit test sources. Entries must be files that
+        exist. These generally have .cpp extensions.
+        """),
+
     '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, [],
--- 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,18 @@ 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']
 
+CPP_UNIT_TESTS = ['foo.cpp']
+
 GTEST_C_SOURCES = ['test1.c', 'test2.c']
 GTEST_CMM_SOURCES = ['test1.mm', 'test2.mm']
 GTEST_CPP_SOURCES = ['test1.cpp', 'test2.cpp']
 
 HOST_CPPSRCS = ['bar.cpp', 'foo.cpp']
 HOST_CSRCS = ['bar.c', 'foo.c']
 
 HOST_LIBRARY_NAME = 'host_bar'
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -142,16 +142,19 @@ class TestRecursiveMakeBackend(BackendTe
             'ASFILES': [
                 'ASFILES += bar.s',
                 'ASFILES += foo.asm',
             ],
             'CMMSRCS': [
                 'CMMSRCS += bar.mm',
                 'CMMSRCS += foo.mm',
             ],
+            'CPP_UNIT_TESTS': [
+                'CPP_UNIT_TESTS += foo.cpp',
+            ],
             'CSRCS': [
                 'CSRCS += bar.c',
                 'CSRCS += foo.c',
             ],
             'DEFINES': [
                 'DEFINES += -Dbar',
                 'DEFINES += -Dfoo',
             ],
--- 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,18 @@ 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']
 
+CPP_UNIT_TESTS = ['foo.cpp']
+
 GTEST_C_SOURCES = ['test1.c', 'test2.c']
 GTEST_CMM_SOURCES = ['test1.mm', 'test2.mm']
 GTEST_CPP_SOURCES = ['test1.cpp', 'test2.cpp']
 
 HOST_CPPSRCS += ['fans.cpp', 'tans.cpp']
 HOST_CSRCS += ['fans.c', 'tans.c']
 
 HOST_LIBRARY_NAME = 'host_fans'
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -124,16 +124,17 @@ class TestEmitterBasic(unittest.TestCase
         self.assertEqual(len(objs), 2)
         self.assertIsInstance(objs[0], DirectoryTraversal)
         self.assertIsInstance(objs[1], VariablePassthru)
 
         wanted = dict(
             ASFILES=['fans.asm', 'tans.s'],
             CMMSRCS=['fans.mm', 'tans.mm'],
             CSRCS=['fans.c', 'tans.c'],
+            CPP_UNIT_TESTS=['foo.cpp'],
             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_CPPSRCS=['fans.cpp', 'tans.cpp'],
             HOST_CSRCS=['fans.c', 'tans.c'],