mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1059090 - Don't require SOURCES to be set for CPP_UNIT_TESTS and SIMPLE_PROGRAMS. r=mshal
This commit is contained in:
parent
8fd95ad480
commit
c2a27deef9
@ -148,15 +148,24 @@ directory, in which case we can use the ``SimplePrograms`` template
|
||||
'SecondProgram',
|
||||
])
|
||||
|
||||
The corresponding ``SOURCES`` must match:
|
||||
Contrary to ``Program``, which requires corresponding ``SOURCES``, when using
|
||||
``SimplePrograms``, the corresponding ``SOURCES`` are implied. If the
|
||||
corresponding ``sources`` have an extension different from ``.cpp``, it is
|
||||
possible to specify the proper extension:
|
||||
|
||||
SOURCES += [
|
||||
'FirstProgram.cpp',
|
||||
'SecondProgram.c',
|
||||
]
|
||||
SimplePrograms([
|
||||
'ThirdProgram',
|
||||
'FourthProgram',
|
||||
], ext='.c')
|
||||
|
||||
Please note this construct was added for compatibility with what already lives
|
||||
in the mozilla tree ; it is recommended not to add new simple programs with
|
||||
sources with a different extension than ``.cpp``.
|
||||
|
||||
Similar to ``SimplePrograms``, is the ``CppUnitTests`` template, which defines,
|
||||
with the same rules, C++ unit tests programs.
|
||||
with the same rules, C++ unit tests programs. Like ``SimplePrograms``, it takes
|
||||
an ``ext`` argument to specify the extension for the corresponding ``SOURCES``,
|
||||
if it's different from ``.cpp``.
|
||||
|
||||
|
||||
Linking with system libraries
|
||||
|
@ -11,21 +11,23 @@ def Program(name):
|
||||
|
||||
|
||||
@template
|
||||
def SimplePrograms(names):
|
||||
def SimplePrograms(names, ext='.cpp'):
|
||||
'''Template for simple program executables.
|
||||
|
||||
Those have a single source with the same base name as the executable.
|
||||
'''
|
||||
SIMPLE_PROGRAMS += names
|
||||
SOURCES += ['%s%s' % (name, ext) for name in names]
|
||||
|
||||
|
||||
@template
|
||||
def CppUnitTests(names):
|
||||
def CppUnitTests(names, ext='.cpp'):
|
||||
'''Template for C++ unit tests.
|
||||
|
||||
Those have a single source with the same base name as the executable.
|
||||
'''
|
||||
CPP_UNIT_TESTS += names
|
||||
SOURCES += ['%s%s' % (name, ext) for name in names]
|
||||
|
||||
|
||||
@template
|
||||
@ -41,12 +43,14 @@ def HostProgram(name):
|
||||
|
||||
|
||||
@template
|
||||
def HostSimplePrograms(names):
|
||||
def HostSimplePrograms(names, ext='.cpp'):
|
||||
'''Template for simple build tools executables.
|
||||
|
||||
Those have a single source with the same base name as the executable.
|
||||
'''
|
||||
HOST_SIMPLE_PROGRAMS += names
|
||||
HOST_SOURCES += ['%s%s' % (name.replace('host_', ''), ext)
|
||||
for name in names]
|
||||
|
||||
|
||||
@template
|
||||
|
@ -17,8 +17,6 @@ CppUnitTests([
|
||||
'TestPlainTextSerializer',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
MOCHITEST_MANIFESTS += [
|
||||
'chrome/mochitest.ini',
|
||||
'csp/mochitest.ini',
|
||||
|
@ -9,8 +9,6 @@ CppUnitTests([
|
||||
'TestAudioMixer'
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
FAIL_ON_WARNINGS = True
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
|
@ -8,8 +8,6 @@ CppUnitTests([
|
||||
'TestAudioEventTimeline',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
FAIL_ON_WARNINGS = True
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
|
@ -8,8 +8,6 @@ CppUnitTests([
|
||||
'TestAudioChannelService',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||
DEFINES['NOMINMAX'] = True
|
||||
|
||||
|
@ -8,8 +8,6 @@ CppUnitTests([
|
||||
'TestWebGLElementArrayCache',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
FAIL_ON_WARNINGS = True
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
|
@ -8,8 +8,6 @@ CppUnitTests([
|
||||
'TestTXMgr',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
FAIL_ON_WARNINGS = True
|
||||
|
||||
USE_LIBS += [
|
||||
|
@ -8,8 +8,6 @@ CppUnitTests([
|
||||
'TestLineBreak',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
USE_LIBS += [
|
||||
'mozalloc',
|
||||
'nspr',
|
||||
|
@ -6,8 +6,4 @@
|
||||
|
||||
SimplePrograms([
|
||||
'umaptable',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.c' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
], ext='.c')
|
||||
|
@ -6,13 +6,9 @@
|
||||
|
||||
XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
|
||||
|
||||
SOURCES += [
|
||||
'NormalizationTest.cpp',
|
||||
'UnicharSelfTest.cpp',
|
||||
]
|
||||
|
||||
SimplePrograms([
|
||||
"%s" % (fyl[0:-4]) for fyl in SOURCES
|
||||
'NormalizationTest',
|
||||
'UnicharSelfTest',
|
||||
])
|
||||
|
||||
USE_STATIC_LIBS = True
|
||||
|
@ -423,12 +423,8 @@ else:
|
||||
if CONFIG['_MSC_VER'] != '1600':
|
||||
MSVC_ENABLE_PGO = True
|
||||
|
||||
HOST_SOURCES += [
|
||||
'jskwgen.cpp',
|
||||
]
|
||||
|
||||
HostSimplePrograms([
|
||||
'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES
|
||||
'host_jskwgen',
|
||||
])
|
||||
|
||||
# JavaScript must be built shared, even for static builds, as it is used by
|
||||
|
@ -4,12 +4,8 @@
|
||||
# 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/.
|
||||
|
||||
HOST_SOURCES += [
|
||||
'ListCSSProperties.cpp',
|
||||
]
|
||||
|
||||
HostSimplePrograms([
|
||||
'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES
|
||||
'host_ListCSSProperties',
|
||||
])
|
||||
|
||||
MOCHITEST_MANIFESTS += [
|
||||
|
@ -15,8 +15,6 @@ if CONFIG['OS_TARGET'] != 'Android':
|
||||
'test_sanity'
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'../include'
|
||||
]
|
||||
|
@ -23,8 +23,6 @@ if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
|
||||
'sctp_unittest',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
FAIL_ON_WARNINGS = True
|
||||
|
||||
for var in ('HAVE_STRDUP', 'NR_SOCKET_IS_VOID_PTR', 'SCTP_DEBUG', 'INET'):
|
||||
|
@ -12,8 +12,6 @@ if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
|
||||
'signaling_unittests',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
include('/ipc/chromium/chromium-config.mozbuild')
|
||||
|
||||
if CONFIG['OS_TARGET'] in ('Darwin', 'Android'):
|
||||
|
@ -8,8 +8,6 @@ CppUnitTests([
|
||||
'TestVolatileBuffer',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
USE_LIBS += [
|
||||
'mozalloc',
|
||||
'nspr',
|
||||
|
@ -37,8 +37,6 @@ if not CONFIG['MOZ_ASAN']:
|
||||
'TestPoisonArea',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
# Since we link directly with MFBT object files, define IMPL_MFBT
|
||||
DEFINES['IMPL_MFBT'] = True
|
||||
|
||||
|
@ -6,9 +6,6 @@
|
||||
|
||||
NO_DIST_INSTALL = True
|
||||
|
||||
SOURCES += [
|
||||
'TestZip.cpp',
|
||||
]
|
||||
SimplePrograms([
|
||||
'TestZip',
|
||||
])
|
||||
|
@ -6,10 +6,6 @@
|
||||
|
||||
DISABLE_STL_WRAPPING = True
|
||||
|
||||
SOURCES += [
|
||||
'ShowSSEConfig.cpp',
|
||||
]
|
||||
|
||||
CppUnitTests([
|
||||
'ShowSSEConfig',
|
||||
])
|
||||
|
@ -46,18 +46,12 @@ SimplePrograms([
|
||||
# TestUDPSocketProvider',
|
||||
#]
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
|
||||
CppUnitTests([
|
||||
'TestCookie',
|
||||
'TestSTSParser',
|
||||
'TestUDPSocket',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
RESOURCE_FILES += [
|
||||
'urlparse.dat',
|
||||
'urlparse_unx.dat',
|
||||
|
@ -8,8 +8,6 @@ CppUnitTests([
|
||||
'TestCertDB',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
USE_LIBS += [
|
||||
'mozalloc',
|
||||
'nspr',
|
||||
|
@ -13,10 +13,6 @@ SimplePrograms([
|
||||
'OCSPStaplingServer',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'../lib',
|
||||
]
|
||||
|
@ -8,8 +8,6 @@ CppUnitTests([
|
||||
'TestStartupCache',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
EXTRA_COMPONENTS += [
|
||||
'TestStartupCacheTelemetry.js',
|
||||
'TestStartupCacheTelemetry.manifest',
|
||||
|
@ -28,8 +28,6 @@ if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT', 'Darwin'):
|
||||
'test_deadlock_detector',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'../src',
|
||||
]
|
||||
|
@ -8,8 +8,6 @@ CppUnitTests([
|
||||
'test_IHistory',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
FAIL_ON_WARNINGS = True
|
||||
|
||||
USE_LIBS += [
|
||||
|
@ -9,9 +9,5 @@ SimplePrograms([
|
||||
'GoodPlugin',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += ['browser.ini']
|
||||
USE_STATIC_LIBS = True
|
||||
|
@ -18,10 +18,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
|
||||
'TestAUSReadStrings',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'/toolkit/mozapps/update',
|
||||
'/toolkit/mozapps/update/common',
|
||||
|
@ -5,5 +5,4 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
MOCHITEST_CHROME_MANIFESTS += ['chrome.ini']
|
||||
SOURCES += ['TestWebappRT.cpp' ]
|
||||
SimplePrograms(['TestWebappRT'])
|
||||
|
@ -8,18 +8,10 @@ SimplePrograms([
|
||||
'TestXREMakeCommandLineWin',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
|
||||
CppUnitTests([
|
||||
'TestDllInterceptor',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in CPP_UNIT_TESTS
|
||||
]
|
||||
|
||||
DEFINES['NS_NO_XPCOM'] = True
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
|
@ -15,30 +15,19 @@ if not CONFIG['MOZ_PROFILE_GENERATE']:
|
||||
bin_suffix = CONFIG['BIN_SUFFIX']
|
||||
|
||||
|
||||
simple_c_sources = [
|
||||
'leakstats',
|
||||
'tmstats',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
'%s.c' % s for s in simple_c_sources
|
||||
]
|
||||
SOURCES += [
|
||||
'tmreader.c',
|
||||
]
|
||||
|
||||
SimplePrograms(simple_c_sources)
|
||||
SimplePrograms([
|
||||
'leakstats',
|
||||
'tmstats',
|
||||
], ext='.c')
|
||||
|
||||
simple_cpp_sources = [
|
||||
SimplePrograms([
|
||||
'bloatblame',
|
||||
'leaksoup',
|
||||
]
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in simple_cpp_sources
|
||||
]
|
||||
|
||||
SimplePrograms(simple_cpp_sources)
|
||||
])
|
||||
|
||||
RESOURCE_FILES += [
|
||||
'spacetrace.css'
|
||||
|
@ -20,10 +20,6 @@ SimplePrograms([
|
||||
'WriteArgument',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
|
||||
USE_LIBS += [
|
||||
'nspr',
|
||||
]
|
||||
|
@ -24,8 +24,6 @@ FAIL_ON_WARNINGS = True
|
||||
# is bug 652123.
|
||||
# CPP_UNIT_TESTS += ['TestChromeMargin']
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
USE_LIBS += [
|
||||
'mozalloc',
|
||||
'nspr',
|
||||
|
@ -4,10 +4,6 @@
|
||||
# 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/.
|
||||
|
||||
SOURCES += [
|
||||
'stub_test.cpp',
|
||||
]
|
||||
|
||||
SimplePrograms([
|
||||
'stub_test',
|
||||
])
|
||||
|
@ -8,10 +8,6 @@ SimplePrograms([
|
||||
'TestXPTCInvoke',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
|
||||
USE_LIBS += [
|
||||
'mozalloc',
|
||||
'nspr',
|
||||
|
@ -4,10 +4,6 @@
|
||||
# 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/.
|
||||
|
||||
SOURCES += [
|
||||
'TestInterfaceInfo.cpp',
|
||||
]
|
||||
|
||||
SimplePrograms([
|
||||
'TestInterfaceInfo'
|
||||
])
|
||||
|
@ -4,12 +4,6 @@
|
||||
# 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/.
|
||||
|
||||
# We must specify CPP_SOURCES in order to link using the proper c++ linker
|
||||
# on certain platforms.
|
||||
SOURCES += [
|
||||
'nsTestSample.cpp',
|
||||
]
|
||||
|
||||
# SIMPLE_PROGRAMS compiles a single .cpp file into an executable
|
||||
SimplePrograms([
|
||||
'nsTestSample'
|
||||
|
4
xpcom/tests/external/moz.build
vendored
4
xpcom/tests/external/moz.build
vendored
@ -8,10 +8,6 @@ SimplePrograms([
|
||||
'TestMinStringAPI',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
|
||||
USE_LIBS += [
|
||||
'mozalloc',
|
||||
'nspr',
|
||||
|
@ -48,10 +48,6 @@ if CONFIG['WRAP_STL_INCLUDES'] and not CONFIG['CLANG_CL']:
|
||||
'TestSTLWrappers',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in sorted(SIMPLE_PROGRAMS)
|
||||
]
|
||||
|
||||
XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
|
||||
|
||||
CppUnitTests([
|
||||
@ -114,8 +110,6 @@ if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT'):
|
||||
'TestDeadlockDetectorScalability',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'../ds',
|
||||
]
|
||||
|
@ -9,8 +9,6 @@ CppUnitTests([
|
||||
'TestNtPathToDosPath',
|
||||
])
|
||||
|
||||
SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)
|
||||
|
||||
USE_LIBS += [
|
||||
'mozalloc',
|
||||
'nspr',
|
||||
|
@ -9,10 +9,6 @@ SimplePrograms([
|
||||
'SimpleTypeLib',
|
||||
])
|
||||
|
||||
SOURCES += [
|
||||
'%s.cpp' % s for s in SIMPLE_PROGRAMS
|
||||
]
|
||||
|
||||
FAIL_ON_WARNINGS = True
|
||||
|
||||
USE_LIBS += [
|
||||
|
@ -4,10 +4,6 @@
|
||||
# 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/.
|
||||
|
||||
SOURCES += [
|
||||
'windbgdlg.cpp',
|
||||
]
|
||||
|
||||
SimplePrograms([
|
||||
'windbgdlg'
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user