def build_gtest_options(enabled_tests, disabled_tests): """Returns gtest options based on |enabled_tests| and |disabled_tests|.""" gtest_options = ['--gtest_color=yes'] if enabled_tests or disabled_tests: enabled_tests = build_common.as_list(enabled_tests) disabled_tests = build_common.as_list(disabled_tests) minus = '-' if disabled_tests else '' gtest_filter = ' --gtest_filter=%s%s%s' % ( ':'.join(enabled_tests), minus, ':'.join(disabled_tests)) gtest_options.append(gtest_filter) return ' '.join(gtest_options)
def get_system_mode_launch_chrome_command(self, name, additional_args=None, additional_metadata=None): additional_args = build_common.as_list(additional_args) return self.get_launch_chrome_command( # We need --stderr-log=I as we will use ALOGI output from # AdbService. See _ADB_SERVICE_PATTERN in system_mode.py. ['--stderr-log=I'] + additional_args, mode='system', name_override=SYSTEM_MODE_PREFIX + name, additional_metadata=additional_metadata)
def _generate_libcommon_ninja(module_name, instances, enable_libcxx, extra_sources): n = ninja_generator.ArchiveNinjaGenerator(module_name, instances=instances, force_compiler='clang', enable_cxx11=True, enable_libcxx=enable_libcxx, base_path='src/common') n.add_compiler_flags('-Werror') if build_common.use_ndk_direct_execution(): n.add_compiler_flags('-DUSE_NDK_DIRECT_EXECUTION') # Common code really should not reach out into external. n.add_include_paths('android_libcommon') _add_compile_flags(n) sources = n.find_all_sources() sources.remove('src/common/plugin_handle.cc') sources.extend(build_common.as_list(extra_sources)) return n.build_default(sources, base_path=None).archive()
def _generate_libcommon_ninja( module_name, instances, enable_libcxx, extra_sources): n = ninja_generator.ArchiveNinjaGenerator(module_name, instances=instances, force_compiler='clang', enable_cxx11=True, enable_libcxx=enable_libcxx, base_path='src/common') n.add_compiler_flags('-Werror') if build_common.use_ndk_direct_execution(): n.add_compiler_flags('-DUSE_NDK_DIRECT_EXECUTION') # Common code really should not reach out into external. n.add_include_paths('android_libcommon') _add_compile_flags(n) sources = n.find_all_sources() sources.remove('src/common/plugin_handle.cc') sources.extend(build_common.as_list(extra_sources)) return n.build_default(sources, base_path=None).archive()
def find_deps(source_path, python_path=None): """Returns the list of dependencies for a python script. Args: source_path: The path to the Python module/script to examine. python_path: A list of paths to use as the Python search path to find imported modules. Returns: The list of returned dependencies, filtered to the files located under the project source code tree. Note that the input source_path is returned as one of the output dependencies. If this function is called while a config.py is running, it records the output dependencies as dependencies of the config.py. """ python_path = build_common.as_list(python_path) + sys.path finder = modulefinder.ModuleFinder(python_path) finder.run_script(source_path) # Examine the paths of all the modules that were loaded. Some of the paths we # get back are relative. Some absolute. Convert everything to absolute. dependencies = [os.path.abspath(module.__file__) for module in finder.modules.itervalues() if module.__file__] # Filter down the dependencies to those that are contained under the project, # and convert paths into project relative paths. # We assume that changes to the Python standard library for example are # irrelevant. result = [build_common.get_project_relpath(path) for path in dependencies if build_common.is_abs_path_in_project(path)] dependency_inspection.add_files(source_path, *result) return sorted(result)