自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
ModuleSplitter
public
class
ModuleSplitter
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.testtype.suite.ModuleSplitter
|
用于将由 IConfiguration
表示的模块列表拆分为由 ModuleDefinition
表示的执行单元列表的辅助程序。
每个配置可能会生成 1 个或多个 ModuleDefinition
,具体取决于其选项和测试类型:
摘要
公共构造函数
ModuleSplitter
public ModuleSplitter ()
公共方法
public static splitConfiguration (TestInformation testInfo,
runConfig,
suitePreparersPerDevice,
int shardCount,
boolean dynamicModule,
boolean intraModuleSharding)
根据加载的配置映射创建可执行单元 ModuleDefinition
的列表。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# ModuleSplitter\n==============\n\n\n`\npublic\n\n\nclass\nModuleSplitter\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|----------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.testtype.suite.ModuleSplitter |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nHelper to split a list of modules represented by [IConfiguration](../../../../../../../reference/tradefed/com/android/tradefed/config/IConfiguration.html) into a list of execution\nunits represented by [ModuleDefinition](../../../../../../../reference/tradefed/com/android/tradefed/testtype/suite/ModuleDefinition.html).\n\nEach configuration may generate 1 or more [ModuleDefinition](../../../../../../../reference/tradefed/com/android/tradefed/testtype/suite/ModuleDefinition.html) depending on its options\nand test types:\n\n- A non-shardable [IConfiguration](../../../../../../../reference/tradefed/com/android/tradefed/config/IConfiguration.html) will generate a single [ModuleDefinition](../../../../../../../reference/tradefed/com/android/tradefed/testtype/suite/ModuleDefinition.html).\n- A shardable [IConfiguration](../../../../../../../reference/tradefed/com/android/tradefed/config/IConfiguration.html) will generate a number of ModuleDefinition linked to the [IRemoteTest](../../../../../../../reference/tradefed/com/android/tradefed/testtype/IRemoteTest.html) properties:\n - A non - [IShardableTest](../../../../../../../reference/tradefed/com/android/tradefed/testtype/IShardableTest.html) will generate a single ModuleDefinition.\n - A [IShardableTest](../../../../../../../reference/tradefed/com/android/tradefed/testtype/IShardableTest.html) generates one ModuleDefinition per tests returned by [IShardableTest.split()](../../../../../../../reference/tradefed/com/android/tradefed/testtype/IShardableTest.html#split()).\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[ModuleSplitter](../../../../../../../reference/tradefed/com/android/tradefed/testtype/suite/ModuleSplitter.html#ModuleSplitter())`() ` |\n\n| ### Public methods ||\n|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static ` | ` `[splitConfiguration](../../../../../../../reference/tradefed/com/android/tradefed/testtype/suite/ModuleSplitter.html#splitConfiguration(com.android.tradefed.invoker.TestInformation,%20\u003cany\u003e,%20\u003cany\u003e,%20int,%20boolean,%20boolean))`(`[TestInformation](../../../../../../../reference/tradefed/com/android/tradefed/invoker/TestInformation.html)` testInfo, ` runConfig, suitePreparersPerDevice, int shardCount, boolean dynamicModule, boolean intraModuleSharding) Create a List of executable unit [ModuleDefinition](../../../../../../../reference/tradefed/com/android/tradefed/testtype/suite/ModuleDefinition.html)s based on the map of configuration that was loaded. |\n\nPublic constructors\n-------------------\n\n### ModuleSplitter\n\n```\npublic ModuleSplitter ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### splitConfiguration\n\n```\npublic static splitConfiguration (../../../../../../../reference/tradefed/com/android/tradefed/invoker/TestInformation.html testInfo, \n runConfig, \n suitePreparersPerDevice, \n int shardCount, \n boolean dynamicModule, \n boolean intraModuleSharding)\n```\n\nCreate a List of executable unit [ModuleDefinition](../../../../../../../reference/tradefed/com/android/tradefed/testtype/suite/ModuleDefinition.html)s based on the map of configuration\nthat was loaded.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `testInfo` | `TestInformation`: the current [TestInformation](../../../../../../../reference/tradefed/com/android/tradefed/invoker/TestInformation.html) to proceed with sharding. \u003cbr /\u003e |\n| `runConfig` | : [ERROR(/LinkedHashMap)](../../../../../../../) loaded from [ITestSuite.loadTests()](../../../../../../../reference/tradefed/com/android/tradefed/testtype/suite/ITestSuite.html#loadTests()). \u003cbr /\u003e |\n| `suitePreparersPerDevice` | : map of suite level preparers per test device. \u003cbr /\u003e |\n| `shardCount` | `int`: a shard count hint to help with sharding. \u003cbr /\u003e |\n| `dynamicModule` | `boolean`: Whether or not module can be shared in pool or must be independent (strict sharding). \u003cbr /\u003e |\n| `intraModuleSharding` | `boolean`: Whether or not to shard within the modules. \u003cbr /\u003e |\n\n| Returns ||\n|---|--------------------------------------------------------------------------------------------------------------------------------------|\n| | List of [ModuleDefinition](../../../../../../../reference/tradefed/com/android/tradefed/testtype/suite/ModuleDefinition.html) \u003cbr /\u003e |"]]