Bug 1259806 - Remove toolkit/components/ctypes/tests/Makefile.in; r?ted draft
authorMike Shal <mshal@mozilla.com>
Fri, 25 Mar 2016 14:25:17 -0400
changeset 345300 a1ae72755a1bf6a869da7236b10f41b1b6d477ce
parent 344995 63be002b4a803df1122823841ef7633b7561d873
child 517146 88288c816ac0312f7a9a46b1ab0ca5b17c80cbc2
push id14037
push userbmo:mshal@mozilla.com
push dateMon, 28 Mar 2016 18:54:57 +0000
reviewersted
bugs1259806
milestone48.0a1
Bug 1259806 - Remove toolkit/components/ctypes/tests/Makefile.in; r?ted MozReview-Commit-ID: EVCZVXukFQf
python/mozbuild/mozbuild/frontend/emitter.py
toolkit/components/ctypes/tests/Makefile.in
toolkit/components/ctypes/tests/moz.build
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -364,17 +364,17 @@ class TreeMetadataEmitter(LoggingMixin):
         # context more or less truthful about where the external library is.
         context = Context(config=self.config)
         context.add_source(mozpath.join(self.config.topsrcdir, dir, 'dummy'))
         if force_static:
             return ExternalStaticLibrary(context, name)
         else:
             return ExternalSharedLibrary(context, name)
 
-    def _handle_linkables(self, context, passthru):
+    def _handle_linkables(self, context, passthru, generated_files):
         has_linkables = False
 
         for kind, cls in [('PROGRAM', Program), ('HOST_PROGRAM', HostProgram)]:
             program = context.get(kind)
             if program:
                 if program in self._binaries:
                     raise SandboxValidationError(
                         'Cannot use "%s" as %s name, '
@@ -555,16 +555,17 @@ class TreeMetadataEmitter(LoggingMixin):
                         symbols_file.full_path), context)
                 shared_args['symbols_file'] = True
 
             if shared_lib:
                 lib = SharedLibrary(context, libname, **shared_args)
                 self._libs[libname].append(lib)
                 self._linkage.append((context, lib, 'USE_LIBS'))
                 has_linkables = True
+                generated_files.add(lib.lib_name)
                 if is_component and not context['NO_COMPONENTS_MANIFEST']:
                     yield ChromeManifestEntry(context,
                         'components/components.manifest',
                         ManifestBinaryComponent('components', lib.lib_name))
                 if symbols_file:
                     script = mozpath.join(
                         mozpath.dirname(mozpath.dirname(__file__)),
                         'action', 'generate_symbols_file.py')
@@ -816,17 +817,17 @@ class TreeMetadataEmitter(LoggingMixin):
         for local_include in context.get('LOCAL_INCLUDES', []):
             if (not isinstance(local_include, ObjDirPath) and
                     not os.path.exists(local_include.full_path)):
                 raise SandboxValidationError('Path specified in LOCAL_INCLUDES '
                     'does not exist: %s (resolved to %s)' % (local_include,
                     local_include.full_path), context)
             yield LocalInclude(context, local_include)
 
-        for obj in self._handle_linkables(context, passthru):
+        for obj in self._handle_linkables(context, passthru, generated_files):
             yield obj
 
         generated_files.update(['%s%s' % (k, self.config.substs.get('BIN_SUFFIX', '')) for k in self._binaries.keys()])
 
         components = []
         for var, cls in (
             ('BRANDING_FILES', BrandingFiles),
             ('EXPORTS', Exports),
deleted file mode 100644
--- a/toolkit/components/ctypes/tests/Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
-# 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/.
-
-LIB_1_FILES = $(SHARED_LIBRARY)
-LIB_1_DEST = $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
-INSTALL_TARGETS += LIB_1
-
-LIB_3_FILES = $(SHARED_LIBRARY)
-LIB_3_DEST = $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/chrome
-INSTALL_TARGETS += LIB_3
--- a/toolkit/components/ctypes/tests/moz.build
+++ b/toolkit/components/ctypes/tests/moz.build
@@ -18,8 +18,13 @@ UNIFIED_SOURCES += [
 SharedLibrary('jsctypes-test')
 
 LOCAL_INCLUDES += [
     '/js/src/ctypes',
 ]
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wshadow']
+
+if CONFIG['COMPILE_ENVIRONMENT']:
+    shared_library = '!%sjsctypes-test%s' % (CONFIG['DLL_PREFIX'], CONFIG['DLL_SUFFIX'])
+    TEST_HARNESS_FILES.xpcshell.toolkit.components.ctypes.tests.unit += [shared_library]
+    TEST_HARNESS_FILES.testing.mochitest.chrome.toolkit.components.ctypes.tests.chrome += [shared_library]