From 90c742edc2b464e9cf089f75ba60c483f600e00d Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 23 Jul 2014 13:29:44 +0900 Subject: [PATCH] Bug 1036894 part 6 - Emit SimplePrograms for CPP_UNIT_TESTs, and make the corresponding moz.build config look like that of SIMPLE_PROGRAMS. r=gps --- config/rules.mk | 12 ++- content/base/test/moz.build | 10 ++- content/canvas/compiledtest/moz.build | 4 +- content/media/compiledtest/moz.build | 4 +- content/media/webaudio/compiledtest/moz.build | 4 +- dom/audiochannel/tests/moz.build | 4 +- editor/txmgr/tests/moz.build | 4 +- intl/lwbrk/tests/moz.build | 4 +- media/libcubeb/tests/moz.build | 10 ++- media/mtransport/test/moz.build | 24 +++--- media/webrtc/signaling/test/moz.build | 11 ++- memory/mozalloc/tests/moz.build | 4 +- mfbt/tests/moz.build | 48 +++++------ netwerk/test/moz.build | 6 +- .../mozbuild/backend/recursivemake.py | 9 ++- python/mozbuild/mozbuild/frontend/data.py | 3 +- python/mozbuild/mozbuild/frontend/emitter.py | 8 +- .../mozbuild/frontend/sandbox_symbols.py | 10 ++- .../backend/data/variable_passthru/moz.build | 2 - .../test/backend/test_recursivemake.py | 3 - .../frontend/data/variable-passthru/moz.build | 2 - .../mozbuild/test/frontend/test_emitter.py | 1 - security/manager/ssl/tests/compiled/moz.build | 4 +- startupcache/test/moz.build | 4 +- storage/test/moz.build | 28 ++++--- toolkit/components/places/tests/cpp/moz.build | 4 +- .../components/url-classifier/tests/moz.build | 4 +- widget/tests/moz.build | 8 +- xpcom/tests/moz.build | 80 ++++++++++--------- xpcom/tests/windows/moz.build | 5 +- 30 files changed, 183 insertions(+), 141 deletions(-) diff --git a/config/rules.mk b/config/rules.mk index 5cdbfe0726f..9927e743a89 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -81,19 +81,17 @@ ifdef COMPILE_ENVIRONMENT # Compile the tests to $(DIST)/bin. Make lots of niceties available by default # through TestHarness.h, by modifying the list of includes and the libs against # which stuff links. -CPPSRCS += $(CPP_UNIT_TESTS) -CPP_UNIT_TEST_BINS := $(CPP_UNIT_TESTS:.cpp=$(BIN_SUFFIX)) -SIMPLE_PROGRAMS += $(CPP_UNIT_TEST_BINS) +SIMPLE_PROGRAMS += $(CPP_UNIT_TESTS) INCLUDES += -I$(DIST)/include/testing LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS) ifndef MOZ_PROFILE_GENERATE -libs:: $(CPP_UNIT_TEST_BINS) $(call mkdir_deps,$(DIST)/cppunittests) - $(NSINSTALL) $(CPP_UNIT_TEST_BINS) $(DIST)/cppunittests +libs:: $(CPP_UNIT_TESTS) $(call mkdir_deps,$(DIST)/cppunittests) + $(NSINSTALL) $(CPP_UNIT_TESTS) $(DIST)/cppunittests endif run-cppunittests:: - @$(PYTHON) $(topsrcdir)/testing/runcppunittests.py --xre-path=$(DIST)/bin --symbols-path=$(DIST)/crashreporter-symbols $(subst .cpp,$(BIN_SUFFIX),$(CPP_UNIT_TESTS)) + @$(PYTHON) $(topsrcdir)/testing/runcppunittests.py --xre-path=$(DIST)/bin --symbols-path=$(DIST)/crashreporter-symbols $(CPP_UNIT_TESTS) cppunittests-remote: DM_TRANS?=adb cppunittests-remote: @@ -103,7 +101,7 @@ cppunittests-remote: --localLib=$(DEPTH)/dist/$(MOZ_APP_NAME) \ --dm_trans=$(DM_TRANS) \ --deviceIP=${TEST_DEVICE} \ - $(subst .cpp,$(BIN_SUFFIX),$(CPP_UNIT_TESTS)) $(EXTRA_TEST_ARGS); \ + $(CPP_UNIT_TESTS) $(EXTRA_TEST_ARGS); \ else \ echo 'please prepare your host with environment variables for TEST_DEVICE'; \ fi diff --git a/content/base/test/moz.build b/content/base/test/moz.build index 9a8b309ce7e..002160302d5 100644 --- a/content/base/test/moz.build +++ b/content/base/test/moz.build @@ -16,12 +16,14 @@ if CONFIG['OS_ARCH'] != 'Darwin': XPCSHELL_TESTS_MANIFESTS += ['unit_ipc/xpcshell.ini'] CPP_UNIT_TESTS += [ - 'TestCSPParser.cpp', - 'TestGetURL.cpp', - 'TestNativeXMLHttpRequest.cpp', - 'TestPlainTextSerializer.cpp', + 'TestCSPParser', + 'TestGetURL', + 'TestNativeXMLHttpRequest', + 'TestPlainTextSerializer', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + MOCHITEST_MANIFESTS += [ 'chrome/mochitest.ini', 'mochitest.ini', diff --git a/content/canvas/compiledtest/moz.build b/content/canvas/compiledtest/moz.build index 086a4bbf4ba..6c3e3e22059 100644 --- a/content/canvas/compiledtest/moz.build +++ b/content/canvas/compiledtest/moz.build @@ -5,9 +5,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestWebGLElementArrayCache.cpp', + 'TestWebGLElementArrayCache', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + FAIL_ON_WARNINGS = True LOCAL_INCLUDES += [ diff --git a/content/media/compiledtest/moz.build b/content/media/compiledtest/moz.build index 8a1cffa507b..a7ad6efead2 100644 --- a/content/media/compiledtest/moz.build +++ b/content/media/compiledtest/moz.build @@ -5,9 +5,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestAudioMixer.cpp', + 'TestAudioMixer', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + FAIL_ON_WARNINGS = True LOCAL_INCLUDES += [ diff --git a/content/media/webaudio/compiledtest/moz.build b/content/media/webaudio/compiledtest/moz.build index 146daf31201..ba7b48d81bd 100644 --- a/content/media/webaudio/compiledtest/moz.build +++ b/content/media/webaudio/compiledtest/moz.build @@ -5,9 +5,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestAudioEventTimeline.cpp', + 'TestAudioEventTimeline', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + FAIL_ON_WARNINGS = True LOCAL_INCLUDES += [ diff --git a/dom/audiochannel/tests/moz.build b/dom/audiochannel/tests/moz.build index 883b29f84d4..2400c73071c 100644 --- a/dom/audiochannel/tests/moz.build +++ b/dom/audiochannel/tests/moz.build @@ -5,9 +5,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestAudioChannelService.cpp', + 'TestAudioChannelService', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + if CONFIG['OS_ARCH'] == 'WINNT': DEFINES['NOMINMAX'] = True diff --git a/editor/txmgr/tests/moz.build b/editor/txmgr/tests/moz.build index a764ecda81d..076733539cf 100644 --- a/editor/txmgr/tests/moz.build +++ b/editor/txmgr/tests/moz.build @@ -5,8 +5,10 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestTXMgr.cpp', + 'TestTXMgr', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + FAIL_ON_WARNINGS = True diff --git a/intl/lwbrk/tests/moz.build b/intl/lwbrk/tests/moz.build index 0c938222aa4..53211d13fc5 100644 --- a/intl/lwbrk/tests/moz.build +++ b/intl/lwbrk/tests/moz.build @@ -5,9 +5,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestLineBreak.cpp', + 'TestLineBreak', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + LOCAL_INCLUDES += [ '../public', ] diff --git a/media/libcubeb/tests/moz.build b/media/libcubeb/tests/moz.build index 9c029cdff8c..7fb567614f1 100644 --- a/media/libcubeb/tests/moz.build +++ b/media/libcubeb/tests/moz.build @@ -5,16 +5,18 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'test_tone.cpp' + 'test_tone' ] if CONFIG['OS_TARGET'] != 'Android': CPP_UNIT_TESTS += [ - 'test_audio.cpp', - 'test_latency.cpp', - 'test_sanity.cpp' + 'test_audio', + 'test_latency', + 'test_sanity' ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + LOCAL_INCLUDES += [ '../include' ] diff --git a/media/mtransport/test/moz.build b/media/mtransport/test/moz.build index a51c43d7d39..87bfb0b5066 100644 --- a/media/mtransport/test/moz.build +++ b/media/mtransport/test/moz.build @@ -6,23 +6,25 @@ if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': CPP_UNIT_TESTS += [ - 'buffered_stun_socket_unittest.cpp', - 'ice_unittest.cpp', - 'nrappkit_unittest.cpp', - 'rlogringbuffer_unittest.cpp', - 'runnable_utils_unittest.cpp', - 'simpletokenbucket_unittest.cpp', - 'sockettransportservice_unittest.cpp', - 'TestSyncRunnable.cpp', - 'transport_unittests.cpp', - 'turn_unittest.cpp', + 'buffered_stun_socket_unittest', + 'ice_unittest', + 'nrappkit_unittest', + 'rlogringbuffer_unittest', + 'runnable_utils_unittest', + 'simpletokenbucket_unittest', + 'sockettransportservice_unittest', + 'TestSyncRunnable', + 'transport_unittests', + 'turn_unittest', ] if CONFIG['MOZ_SCTP']: CPP_UNIT_TESTS += [ - 'sctp_unittest.cpp', + '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'): diff --git a/media/webrtc/signaling/test/moz.build b/media/webrtc/signaling/test/moz.build index c5f51301510..f7dd9074c8e 100644 --- a/media/webrtc/signaling/test/moz.build +++ b/media/webrtc/signaling/test/moz.build @@ -6,11 +6,14 @@ if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': CPP_UNIT_TESTS += [ - 'mediaconduit_unittests.cpp', - 'mediapipeline_unittest.cpp', - 'sdp_unittests.cpp', - 'signaling_unittests.cpp', + 'mediaconduit_unittests', + 'mediapipeline_unittest', + 'sdp_unittests', + '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'): diff --git a/memory/mozalloc/tests/moz.build b/memory/mozalloc/tests/moz.build index 2eb19e4fac9..fa0c0769c5e 100644 --- a/memory/mozalloc/tests/moz.build +++ b/memory/mozalloc/tests/moz.build @@ -5,5 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestVolatileBuffer.cpp', + 'TestVolatileBuffer', ] + +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/mfbt/tests/moz.build b/mfbt/tests/moz.build index ae605c38fc5..57eb2fa8a0f 100644 --- a/mfbt/tests/moz.build +++ b/mfbt/tests/moz.build @@ -5,35 +5,37 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestArrayUtils.cpp', - 'TestAtomics.cpp', - 'TestBinarySearch.cpp', - 'TestBloomFilter.cpp', - 'TestCasting.cpp', - 'TestCeilingFloor.cpp', - 'TestCheckedInt.cpp', - 'TestCountPopulation.cpp', - 'TestCountZeroes.cpp', - 'TestEndian.cpp', - 'TestEnumSet.cpp', - 'TestFloatingPoint.cpp', - 'TestIntegerPrintfMacros.cpp', - 'TestMacroArgs.cpp', - 'TestMacroForEach.cpp', - 'TestPair.cpp', - 'TestRollingMean.cpp', - 'TestSHA1.cpp', - 'TestTypedEnum.cpp', - 'TestTypeTraits.cpp', - 'TestUniquePtr.cpp', - 'TestWeakPtr.cpp', + 'TestArrayUtils', + 'TestAtomics', + 'TestBinarySearch', + 'TestBloomFilter', + 'TestCasting', + 'TestCeilingFloor', + 'TestCheckedInt', + 'TestCountPopulation', + 'TestCountZeroes', + 'TestEndian', + 'TestEnumSet', + 'TestFloatingPoint', + 'TestIntegerPrintfMacros', + 'TestMacroArgs', + 'TestMacroForEach', + 'TestPair', + 'TestRollingMean', + 'TestSHA1', + 'TestTypedEnum', + 'TestTypeTraits', + 'TestUniquePtr', + 'TestWeakPtr', ] if not CONFIG['MOZ_ASAN']: CPP_UNIT_TESTS += [ - 'TestPoisonArea.cpp', + '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 diff --git a/netwerk/test/moz.build b/netwerk/test/moz.build index f1260b92c4e..c9c483c7559 100644 --- a/netwerk/test/moz.build +++ b/netwerk/test/moz.build @@ -52,10 +52,12 @@ SOURCES += [ ] CPP_UNIT_TESTS += [ - 'TestSTSParser.cpp', - 'TestUDPSocket.cpp', + 'TestSTSParser', + 'TestUDPSocket', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + RESOURCE_FILES += [ 'urlparse.dat', 'urlparse_unx.dat', diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py index 5f14fc47fb3..31d7cfb29f2 100644 --- a/python/mozbuild/mozbuild/backend/recursivemake.py +++ b/python/mozbuild/mozbuild/backend/recursivemake.py @@ -436,7 +436,7 @@ class RecursiveMakeBackend(CommonBackend): self._process_linked_libraries(obj, backend_file) elif isinstance(obj, SimpleProgram): - self._process_simple_program(obj.program, backend_file) + self._process_simple_program(obj, backend_file) self._process_linked_libraries(obj, backend_file) elif isinstance(obj, HostSimpleProgram): @@ -1017,8 +1017,11 @@ class RecursiveMakeBackend(CommonBackend): def _process_host_program(self, program, backend_file): backend_file.write('HOST_PROGRAM = %s\n' % program) - def _process_simple_program(self, program, backend_file): - backend_file.write('SIMPLE_PROGRAMS += %s\n' % program) + def _process_simple_program(self, obj, backend_file): + if obj.is_unit_test: + backend_file.write('CPP_UNIT_TESTS += %s\n' % obj.program) + else: + backend_file.write('SIMPLE_PROGRAMS += %s\n' % obj.program) def _process_host_simple_program(self, program, backend_file): backend_file.write('HOST_SIMPLE_PROGRAMS += %s\n' % program) diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py index 4c21458427b..b8d09e06663 100644 --- a/python/mozbuild/mozbuild/frontend/data.py +++ b/python/mozbuild/mozbuild/frontend/data.py @@ -362,13 +362,14 @@ class BaseProgram(Linkable): """ __slots__ = ('program') - def __init__(self, sandbox, program): + def __init__(self, sandbox, program, is_unit_test=False): Linkable.__init__(self, sandbox) bin_suffix = sandbox['CONFIG'].get(self.SUFFIX_VAR, '') if not program.endswith(bin_suffix): program += bin_suffix self.program = program + self.is_unit_test = is_unit_test class Program(BaseProgram): diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py index 08ce39f3617..9da7e7a16ac 100644 --- a/python/mozbuild/mozbuild/frontend/emitter.py +++ b/python/mozbuild/mozbuild/frontend/emitter.py @@ -324,7 +324,6 @@ class TreeMetadataEmitter(LoggingMixin): varlist = [ 'ANDROID_GENERATED_RESFILES', 'ANDROID_RES_DIRS', - 'CPP_UNIT_TESTS', 'DISABLE_STL_WRAPPING', 'EXTRA_ASSEMBLER_FLAGS', 'EXTRA_COMPILE_FLAGS', @@ -449,6 +448,7 @@ class TreeMetadataEmitter(LoggingMixin): for kind, cls in [ ('SIMPLE_PROGRAMS', SimpleProgram), + ('CPP_UNIT_TESTS', SimpleProgram), ('HOST_SIMPLE_PROGRAMS', HostSimpleProgram)]: for program in sandbox[kind]: if program in self._binaries: @@ -456,9 +456,11 @@ class TreeMetadataEmitter(LoggingMixin): 'Cannot use "%s" in %s, ' 'because it is already used in %s' % (program, kind, self._binaries[program].relativedir), sandbox) - self._binaries[program] = cls(sandbox, program) + self._binaries[program] = cls(sandbox, program, + is_unit_test=kind == 'CPP_UNIT_TESTS') self._linkage.append((sandbox, self._binaries[program], - kind.replace('SIMPLE_PROGRAM', 'USE_LIBS'))) + 'HOST_USE_LIBS' if kind == 'HOST_SIMPLE_PROGRAMS' + else 'USE_LIBS')) test_js_modules = sandbox.get('TESTING_JS_MODULES') if test_js_modules: diff --git a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py index 44ba4ef0716..c9c68837172 100644 --- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py +++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py @@ -234,10 +234,14 @@ VARIABLES = { """, 'binaries'), 'CPP_UNIT_TESTS': (StrictOrderingOnAppendList, list, - """C++ source files for unit tests. + """Compile a list of C++ unit test names. - This is a list of C++ unit test sources. Entries must be files that - exist. These generally have ``.cpp`` extensions. + Each name in this variable corresponds to an executable built from the + corresponding source file with the same base name. + + If the configuration token ``BIN_SUFFIX`` is set, its value will be + automatically appended to each name. If a name already ends with + ``BIN_SUFFIX``, the name will remain unchanged. """, 'binaries'), 'FAIL_ON_WARNINGS': (bool, bool, diff --git a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build index 9ea6d0c0150..9c166fb58df 100644 --- a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build +++ b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build @@ -10,8 +10,6 @@ EXTRA_PP_COMPONENTS = ['bar.pp.js', 'foo.pp.js'] EXTRA_JS_MODULES = ['bar.jsm', 'foo.jsm'] EXTRA_PP_JS_MODULES = ['bar.pp.jsm', 'foo.pp.jsm'] -CPP_UNIT_TESTS = ['foo.cpp'] - HOST_SOURCES += ['bar.cpp', 'foo.cpp'] HOST_SOURCES += ['bar.c', 'foo.c'] diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py index 262cec399d7..603a19f2e73 100644 --- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py +++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py @@ -262,9 +262,6 @@ class TestRecursiveMakeBackend(BackendTester): 'CMMSRCS += bar.mm', 'CMMSRCS += foo.mm', ], - 'CPP_UNIT_TESTS': [ - 'CPP_UNIT_TESTS += foo.cpp', - ], 'CSRCS': [ 'CSRCS += bar.c', 'CSRCS += foo.c', diff --git a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build index b622ed6510b..6d2efafe5f5 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build +++ b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build @@ -10,8 +10,6 @@ EXTRA_PP_COMPONENTS=['fans.pp.js', 'tans.pp.js'] EXTRA_JS_MODULES = ['bar.jsm', 'foo.jsm'] EXTRA_PP_JS_MODULES = ['bar.pp.jsm', 'foo.pp.jsm'] -CPP_UNIT_TESTS = ['foo.cpp'] - HOST_SOURCES += ['fans.cpp', 'tans.cpp'] HOST_SOURCES += ['fans.c', 'tans.c'] diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py index 4b0537b5608..dcf328dbf9a 100644 --- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py +++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py @@ -158,7 +158,6 @@ class TestEmitterBasic(unittest.TestCase): ASFILES=['fans.asm', 'tans.s'], CMMSRCS=['fans.mm', 'tans.mm'], CSRCS=['fans.c', 'tans.c'], - CPP_UNIT_TESTS=['foo.cpp'], DISABLE_STL_WRAPPING=True, EXTRA_COMPONENTS=['fans.js', 'tans.js'], EXTRA_PP_COMPONENTS=['fans.pp.js', 'tans.pp.js'], diff --git a/security/manager/ssl/tests/compiled/moz.build b/security/manager/ssl/tests/compiled/moz.build index 38878f16e27..32a2059492a 100644 --- a/security/manager/ssl/tests/compiled/moz.build +++ b/security/manager/ssl/tests/compiled/moz.build @@ -5,5 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestCertDB.cpp', + 'TestCertDB', ] + +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/startupcache/test/moz.build b/startupcache/test/moz.build index 96764428d5f..a992af620bf 100644 --- a/startupcache/test/moz.build +++ b/startupcache/test/moz.build @@ -5,9 +5,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestStartupCache.cpp', + 'TestStartupCache', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + EXTRA_COMPONENTS += [ 'TestStartupCacheTelemetry.js', 'TestStartupCacheTelemetry.manifest', diff --git a/storage/test/moz.build b/storage/test/moz.build index 861010b9b00..28984f2b3b8 100644 --- a/storage/test/moz.build +++ b/storage/test/moz.build @@ -7,27 +7,29 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] CPP_UNIT_TESTS += [ - 'test_AsXXX_helpers.cpp', - 'test_async_callbacks_with_spun_event_loops.cpp', - 'test_asyncStatementExecution_transaction.cpp', - 'test_binding_params.cpp', - 'test_file_perms.cpp', - 'test_mutex.cpp', - 'test_service_init_background_thread.cpp', - 'test_statement_scoper.cpp', - 'test_StatementCache.cpp', - 'test_transaction_helper.cpp', - 'test_true_async.cpp', - 'test_unlock_notify.cpp', + 'test_AsXXX_helpers', + 'test_async_callbacks_with_spun_event_loops', + 'test_asyncStatementExecution_transaction', + 'test_binding_params', + 'test_file_perms', + 'test_mutex', + 'test_service_init_background_thread', + 'test_statement_scoper', + 'test_StatementCache', + 'test_transaction_helper', + 'test_true_async', + 'test_unlock_notify', ] if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT', 'Darwin'): # FIXME bug 523392: test_deadlock_detector doesn't like Windows # FIXME bug 523378: also fails on OS X CPP_UNIT_TESTS += [ - 'test_deadlock_detector.cpp', + 'test_deadlock_detector', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + LOCAL_INCLUDES += [ '../src', ] diff --git a/toolkit/components/places/tests/cpp/moz.build b/toolkit/components/places/tests/cpp/moz.build index 58a3ff4e0d9..1a2c3cca5f1 100644 --- a/toolkit/components/places/tests/cpp/moz.build +++ b/toolkit/components/places/tests/cpp/moz.build @@ -5,8 +5,10 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'test_IHistory.cpp', + 'test_IHistory', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + FAIL_ON_WARNINGS = True diff --git a/toolkit/components/url-classifier/tests/moz.build b/toolkit/components/url-classifier/tests/moz.build index 1214da732b4..96d5d3b2fbc 100644 --- a/toolkit/components/url-classifier/tests/moz.build +++ b/toolkit/components/url-classifier/tests/moz.build @@ -15,5 +15,7 @@ JAR_MANIFESTS += ['jar.mn'] # XXX Get this to work in libxul builds. ## simple c++ tests (no xpcom) #CPP_UNIT_TESTS += [ \ -# 'TestUrlClassifierUtils.cpp', \ +# 'TestUrlClassifierUtils', \ #] +# +#SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/widget/tests/moz.build b/widget/tests/moz.build index 442cb571168..1b789ce854c 100644 --- a/widget/tests/moz.build +++ b/widget/tests/moz.build @@ -9,7 +9,7 @@ MOCHITEST_MANIFESTS += ['mochitest.ini'] MOCHITEST_CHROME_MANIFESTS += ['chrome.ini'] CPP_UNIT_TESTS += [ - 'TestAppShellSteadyState.cpp', + 'TestAppShellSteadyState', ] FAIL_ON_WARNINGS = True @@ -18,8 +18,10 @@ FAIL_ON_WARNINGS = True # if CONFIG['NS_ENABLE_TSF']: # Test disabled because it uses the internal string APIs incorrectly # (see bug 582863) -# CPP_UNIT_TESTS += ['TestWinTSF.cpp'] +# CPP_UNIT_TESTS += ['TestWinTSF'] # # Test disabled because it requires the internal API. Re-enabling this test # is bug 652123. -# CPP_UNIT_TESTS += ['TestChromeMargin.cpp'] +# CPP_UNIT_TESTS += ['TestChromeMargin'] + +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) diff --git a/xpcom/tests/moz.build b/xpcom/tests/moz.build index e3153c18ce3..74f05fd142d 100644 --- a/xpcom/tests/moz.build +++ b/xpcom/tests/moz.build @@ -55,65 +55,67 @@ SOURCES += [ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini'] CPP_UNIT_TESTS += [ - 'ShowAlignments.cpp', - 'TestAutoPtr.cpp', - 'TestAutoRef.cpp', - 'TestCOMArray.cpp', - 'TestCOMPtr.cpp', - 'TestCOMPtrEq.cpp', - 'TestDeque.cpp', - 'TestFile.cpp', - 'TestHashtables.cpp', - 'TestID.cpp', - 'TestObserverArray.cpp', - 'TestObserverService.cpp', - 'TestPipe.cpp', - 'TestPLDHash.cpp', - 'TestRefPtr.cpp', - 'TestStringAPI.cpp', - 'TestTArray.cpp', - 'TestTextFormatter.cpp', - 'TestThreadUtils.cpp' + 'ShowAlignments', + 'TestAutoPtr', + 'TestAutoRef', + 'TestCOMArray', + 'TestCOMPtr', + 'TestCOMPtrEq', + 'TestDeque', + 'TestFile', + 'TestHashtables', + 'TestID', + 'TestObserverArray', + 'TestObserverService', + 'TestPipe', + 'TestPLDHash', + 'TestRefPtr', + 'TestStringAPI', + 'TestTArray', + 'TestTextFormatter', + 'TestThreadUtils' ] if CONFIG['MOZ_MEMORY']: CPP_UNIT_TESTS += [ - 'TestJemalloc.cpp', + 'TestJemalloc', ] # XXX Make these tests work in libxul builds. #CPP_UNIT_TESTS += [ -# 'TestArray.cpp', -# 'TestCRT.cpp', -# 'TestEncoding.cpp', -# 'TestExpirationTracker.cpp', -# 'TestPipes.cpp', -# 'TestPriorityQueue.cpp', -# 'TestStorageStream.cpp', -# 'TestStrings.cpp', -# 'TestSynchronization.cpp', -# 'TestTArray.cpp', -# 'TestThreadPool.cpp', -# 'TestThreads.cpp', -# 'TestTimeStamp.cpp', -# 'TestXPIDLString.cpp', -# 'TestUTF.cpp', -# 'TestAtoms.cpp', +# 'TestArray', +# 'TestCRT', +# 'TestEncoding', +# 'TestExpirationTracker', +# 'TestPipes', +# 'TestPriorityQueue', +# 'TestStorageStream', +# 'TestStrings', +# 'TestSynchronization', +# 'TestTArray', +# 'TestThreadPool', +# 'TestThreads', +# 'TestTimeStamp', +# 'TestXPIDLString', +# 'TestUTF', +# 'TestAtoms', #] # FIXME: bug 577500 TestStaticAtoms fails when run in dist/bin #CPP_UNIT_TESTS += [ -# 'TestStaticAtoms.cpp', +# 'TestStaticAtoms', #] if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT', 'Darwin'): # FIXME bug 523392: TestDeadlockDetector doesn't like Windows # FIXME bug 523378: also fails on OS X CPP_UNIT_TESTS += [ - 'TestDeadlockDetector.cpp', - 'TestDeadlockDetectorScalability.cpp', + 'TestDeadlockDetector', + 'TestDeadlockDetectorScalability', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS) + LOCAL_INCLUDES += [ '../ds', ] diff --git a/xpcom/tests/windows/moz.build b/xpcom/tests/windows/moz.build index 8d7955e6b3e..51d3597e318 100644 --- a/xpcom/tests/windows/moz.build +++ b/xpcom/tests/windows/moz.build @@ -5,7 +5,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. CPP_UNIT_TESTS += [ - 'TestCOM.cpp', - 'TestNtPathToDosPath.cpp', + 'TestCOM', + 'TestNtPathToDosPath', ] +SOURCES += sorted('%s.cpp' % t for t in CPP_UNIT_TESTS)