Bug 888643 - Part a: Support CPP_UNIT_TESTS in moz.build files; r=gps

This commit is contained in:
Ms2ger 2013-07-24 09:20:00 +02:00
parent a95c9e4ba5
commit f9325b23fe
6 changed files with 16 additions and 0 deletions

View File

@ -83,6 +83,7 @@ class TreeMetadataEmitter(object):
ASFILES='ASFILES',
CMMSRCS='CMMSRCS',
CPPSRCS='CPP_SOURCES',
CPP_UNIT_TESTS='CPP_UNIT_TESTS',
CSRCS='CSRCS',
DEFINES='DEFINES',
EXTRA_COMPONENTS='EXTRA_COMPONENTS',

View File

@ -119,6 +119,13 @@ VARIABLES = {
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.

View File

@ -13,6 +13,8 @@ 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']

View File

@ -147,6 +147,9 @@ class TestRecursiveMakeBackend(BackendTester):
'CMMSRCS += bar.mm',
'CMMSRCS += foo.mm',
],
'CPP_UNIT_TESTS': [
'CPP_UNIT_TESTS += foo.cpp',
],
'CSRCS': [
'CSRCS += bar.c',
'CSRCS += foo.c',

View File

@ -13,6 +13,8 @@ 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']

View File

@ -129,6 +129,7 @@ class TestEmitterBasic(unittest.TestCase):
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'],