Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 1 | // Copyright 2019 Google Inc. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package java |
| 16 | |
| 17 | import ( |
| 18 | "fmt" |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 19 | "reflect" |
| 20 | "sort" |
Paul Duffin | 4fd997b | 2021-02-03 20:06:33 +0000 | [diff] [blame] | 21 | "strings" |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 22 | "testing" |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 23 | |
| 24 | "android/soong/android" |
Colin Cross | f28329d | 2020-02-15 11:00:10 -0800 | [diff] [blame] | 25 | "android/soong/cc" |
Ulya Trafimovich | 24813e1 | 2020-10-07 15:05:21 +0100 | [diff] [blame] | 26 | "android/soong/dexpreopt" |
Liz Kammer | dd849a8 | 2020-06-12 16:38:45 -0700 | [diff] [blame] | 27 | "android/soong/python" |
| 28 | |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 29 | "github.com/google/blueprint" |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 30 | ) |
| 31 | |
Paul Duffin | 95bdab4 | 2021-03-08 21:48:46 +0000 | [diff] [blame] | 32 | const defaultJavaDir = "default/java" |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 33 | |
Paul Duffin | 95bdab4 | 2021-03-08 21:48:46 +0000 | [diff] [blame] | 34 | // Test fixture preparer that will register most java build components. |
| 35 | // |
| 36 | // Singletons and mutators should only be added here if they are needed for a majority of java |
| 37 | // module types, otherwise they should be added under a separate preparer to allow them to be |
| 38 | // selected only when needed to reduce test execution time. |
| 39 | // |
| 40 | // Module types do not have much of an overhead unless they are used so this should include as many |
| 41 | // module types as possible. The exceptions are those module types that require mutators and/or |
| 42 | // singletons in order to function in which case they should be kept together in a separate |
| 43 | // preparer. |
| 44 | var PrepareForTestWithJavaBuildComponents = android.FixtureRegisterWithContext(RegisterRequiredBuildComponentsForTest) |
| 45 | |
| 46 | // Test fixture preparer that will define default java modules, e.g. standard prebuilt modules. |
| 47 | var PrepareForTestWithJavaDefaultModules = android.GroupFixturePreparers( |
| 48 | // Make sure that mutators and module types, e.g. prebuilt mutators available. |
| 49 | android.PrepareForTestWithAndroidBuildComponents, |
| 50 | // Make sure that all the module types used in the defaults are registered. |
| 51 | PrepareForTestWithJavaBuildComponents, |
| 52 | // The java default module definitions. |
| 53 | android.FixtureAddTextFile(defaultJavaDir+"/Android.bp", GatherRequiredDepsForTest()), |
| 54 | ) |
| 55 | |
| 56 | // Prepare a fixture to use all java module types, mutators and singletons fully. |
| 57 | // |
| 58 | // This should only be used by tests that want to run with as much of the build enabled as possible. |
| 59 | var PrepareForIntegrationTestWithJava = android.GroupFixturePreparers( |
| 60 | cc.PrepareForIntegrationTestWithCc, |
| 61 | PrepareForTestWithJavaDefaultModules, |
| 62 | ) |
| 63 | |
Paul Duffin | bf028b5 | 2021-03-13 22:19:17 +0000 | [diff] [blame] | 64 | // Prepare a fixture with the standard files required by a java_sdk_library module. |
| 65 | var PrepareForTestWithJavaSdkLibraryFiles = android.FixtureMergeMockFs(javaSdkLibraryFiles) |
| 66 | |
| 67 | var javaSdkLibraryFiles = android.MockFS{ |
| 68 | "api/current.txt": nil, |
| 69 | "api/removed.txt": nil, |
| 70 | "api/system-current.txt": nil, |
| 71 | "api/system-removed.txt": nil, |
| 72 | "api/test-current.txt": nil, |
| 73 | "api/test-removed.txt": nil, |
| 74 | "api/module-lib-current.txt": nil, |
| 75 | "api/module-lib-removed.txt": nil, |
| 76 | "api/system-server-current.txt": nil, |
| 77 | "api/system-server-removed.txt": nil, |
| 78 | } |
| 79 | |
Paul Duffin | 2ff6d1b | 2021-03-13 22:37:27 +0000 | [diff] [blame] | 80 | // FixtureWithLastReleaseApis creates a preparer that creates prebuilt versions of the specified |
| 81 | // modules for the `last` API release. By `last` it just means last in the list of supplied versions |
| 82 | // and as this only provides one version it can be any value. |
| 83 | // |
| 84 | // This uses FixtureWithPrebuiltApis under the covers so the limitations of that apply to this. |
| 85 | func FixtureWithLastReleaseApis(moduleNames ...string) android.FixturePreparer { |
| 86 | return FixtureWithPrebuiltApis(map[string][]string{ |
| 87 | "30": moduleNames, |
| 88 | }) |
| 89 | } |
| 90 | |
| 91 | // PrepareForTestWithPrebuiltsOfCurrentApi is a preparer that creates prebuilt versions of the |
| 92 | // standard modules for the current version. |
| 93 | // |
| 94 | // This uses FixtureWithPrebuiltApis under the covers so the limitations of that apply to this. |
| 95 | var PrepareForTestWithPrebuiltsOfCurrentApi = FixtureWithPrebuiltApis(map[string][]string{ |
| 96 | "current": {}, |
| 97 | // Can't have current on its own as it adds a prebuilt_apis module but doesn't add any |
| 98 | // .txt files which causes the prebuilt_apis module to fail. |
| 99 | "30": {}, |
| 100 | }) |
| 101 | |
| 102 | // FixtureWithPrebuiltApis creates a preparer that will define prebuilt api modules for the |
| 103 | // specified releases and modules. |
| 104 | // |
| 105 | // The supplied map keys are the releases, e.g. current, 29, 30, etc. The values are a list of |
| 106 | // modules for that release. Due to limitations in the prebuilt_apis module which this preparer |
| 107 | // uses the set of releases must include at least one numbered release, i.e. it cannot just include |
| 108 | // "current". |
| 109 | // |
| 110 | // This defines a file in the mock file system in a predefined location (prebuilts/sdk/Android.bp) |
| 111 | // and so only one instance of this can be used in each fixture. |
| 112 | func FixtureWithPrebuiltApis(release2Modules map[string][]string) android.FixturePreparer { |
| 113 | mockFS := android.MockFS{} |
| 114 | path := "prebuilts/sdk/Android.bp" |
| 115 | |
| 116 | bp := fmt.Sprintf(` |
| 117 | prebuilt_apis { |
| 118 | name: "sdk", |
| 119 | api_dirs: ["%s"], |
| 120 | imports_sdk_version: "none", |
| 121 | imports_compile_dex: true, |
| 122 | } |
| 123 | `, strings.Join(android.SortedStringKeys(release2Modules), `", "`)) |
| 124 | |
| 125 | for release, modules := range release2Modules { |
| 126 | libs := append([]string{"android", "core-for-system-modules"}, modules...) |
| 127 | mockFS.Merge(prebuiltApisFilesForLibs([]string{release}, libs)) |
| 128 | } |
| 129 | return android.GroupFixturePreparers( |
| 130 | // A temporary measure to discard the definitions provided by default by javaMockFS() to allow |
| 131 | // the changes that use this preparer to fix tests to be separated from the change to remove |
| 132 | // javaMockFS(). |
| 133 | android.FixtureModifyMockFS(func(fs android.MockFS) { |
| 134 | for k, _ := range fs { |
| 135 | if strings.HasPrefix(k, "prebuilts/sdk/") { |
| 136 | delete(fs, k) |
| 137 | } |
| 138 | } |
| 139 | }), |
| 140 | android.FixtureAddTextFile(path, bp), |
| 141 | android.FixtureMergeMockFs(mockFS), |
| 142 | ) |
| 143 | } |
| 144 | |
Paul Duffin | 95bdab4 | 2021-03-08 21:48:46 +0000 | [diff] [blame] | 145 | func javaMockFS() android.MockFS { |
| 146 | mockFS := android.MockFS{ |
Anton Hansson | dff2c78 | 2020-12-21 17:10:01 +0000 | [diff] [blame] | 147 | "prebuilts/sdk/tools/core-lambda-stubs.jar": nil, |
| 148 | "prebuilts/sdk/Android.bp": []byte(`prebuilt_apis { name: "sdk", api_dirs: ["14", "28", "30", "current"], imports_sdk_version: "none", imports_compile_dex:true,}`), |
Paul Duffin | 0c5bae5 | 2020-06-02 13:00:08 +0100 | [diff] [blame] | 149 | |
Liz Kammer | dd849a8 | 2020-06-12 16:38:45 -0700 | [diff] [blame] | 150 | "bin.py": nil, |
| 151 | python.StubTemplateHost: []byte(`PYTHON_BINARY = '%interpreter%' |
| 152 | MAIN_FILE = '%main%'`), |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 153 | } |
| 154 | |
Anton Hansson | dff2c78 | 2020-12-21 17:10:01 +0000 | [diff] [blame] | 155 | levels := []string{"14", "28", "29", "30", "current"} |
| 156 | libs := []string{ |
| 157 | "android", "foo", "bar", "sdklib", "barney", "betty", "foo-shared_library", |
| 158 | "foo-no_shared_library", "core-for-system-modules", "quuz", "qux", "fred", |
| 159 | "runtime-library", |
| 160 | } |
| 161 | for k, v := range prebuiltApisFilesForLibs(levels, libs) { |
| 162 | mockFS[k] = v |
| 163 | } |
| 164 | |
Paul Duffin | 95bdab4 | 2021-03-08 21:48:46 +0000 | [diff] [blame] | 165 | return mockFS |
| 166 | } |
| 167 | |
| 168 | func TestConfig(buildDir string, env map[string]string, bp string, fs map[string][]byte) android.Config { |
| 169 | bp += GatherRequiredDepsForTest() |
| 170 | |
| 171 | mockFS := javaMockFS() |
Paul Duffin | bf028b5 | 2021-03-13 22:19:17 +0000 | [diff] [blame] | 172 | mockFS.Merge(javaSdkLibraryFiles) |
Paul Duffin | 95bdab4 | 2021-03-08 21:48:46 +0000 | [diff] [blame] | 173 | |
Colin Cross | f28329d | 2020-02-15 11:00:10 -0800 | [diff] [blame] | 174 | cc.GatherRequiredFilesForTest(mockFS) |
| 175 | |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 176 | for k, v := range fs { |
| 177 | mockFS[k] = v |
| 178 | } |
| 179 | |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 180 | if env == nil { |
| 181 | env = make(map[string]string) |
| 182 | } |
| 183 | if env["ANDROID_JAVA8_HOME"] == "" { |
| 184 | env["ANDROID_JAVA8_HOME"] = "jdk8" |
| 185 | } |
Colin Cross | 98be1bb | 2019-12-13 20:41:13 -0800 | [diff] [blame] | 186 | config := android.TestArchConfig(buildDir, env, bp, mockFS) |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 187 | |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 188 | return config |
| 189 | } |
| 190 | |
Anton Hansson | dff2c78 | 2020-12-21 17:10:01 +0000 | [diff] [blame] | 191 | func prebuiltApisFilesForLibs(apiLevels []string, sdkLibs []string) map[string][]byte { |
| 192 | fs := make(map[string][]byte) |
| 193 | for _, level := range apiLevels { |
| 194 | for _, lib := range sdkLibs { |
| 195 | for _, scope := range []string{"public", "system", "module-lib", "system-server", "test"} { |
| 196 | fs[fmt.Sprintf("prebuilts/sdk/%s/%s/%s.jar", level, scope, lib)] = nil |
Anton Hansson | 370fd0b | 2021-01-22 15:05:04 +0000 | [diff] [blame] | 197 | // No finalized API files for "current" |
| 198 | if level != "current" { |
| 199 | fs[fmt.Sprintf("prebuilts/sdk/%s/%s/api/%s.txt", level, scope, lib)] = nil |
| 200 | fs[fmt.Sprintf("prebuilts/sdk/%s/%s/api/%s-removed.txt", level, scope, lib)] = nil |
| 201 | } |
Anton Hansson | dff2c78 | 2020-12-21 17:10:01 +0000 | [diff] [blame] | 202 | } |
| 203 | } |
| 204 | fs[fmt.Sprintf("prebuilts/sdk/%s/public/framework.aidl", level)] = nil |
| 205 | } |
| 206 | return fs |
| 207 | } |
| 208 | |
Paul Duffin | c059c8c | 2021-01-20 17:13:52 +0000 | [diff] [blame] | 209 | // Register build components provided by this package that are needed by tests. |
| 210 | // |
| 211 | // In particular this must register all the components that are used in the `Android.bp` snippet |
| 212 | // returned by GatherRequiredDepsForTest() |
| 213 | func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) { |
| 214 | RegisterAARBuildComponents(ctx) |
| 215 | RegisterAppBuildComponents(ctx) |
| 216 | RegisterAppImportBuildComponents(ctx) |
| 217 | RegisterAppSetBuildComponents(ctx) |
Paul Duffin | 3451e16 | 2021-01-20 15:16:56 +0000 | [diff] [blame] | 218 | RegisterBootImageBuildComponents(ctx) |
Paul Duffin | c059c8c | 2021-01-20 17:13:52 +0000 | [diff] [blame] | 219 | RegisterDexpreoptBootJarsComponents(ctx) |
| 220 | RegisterDocsBuildComponents(ctx) |
| 221 | RegisterGenRuleBuildComponents(ctx) |
| 222 | RegisterJavaBuildComponents(ctx) |
| 223 | RegisterPrebuiltApisBuildComponents(ctx) |
| 224 | RegisterRuntimeResourceOverlayBuildComponents(ctx) |
| 225 | RegisterSdkLibraryBuildComponents(ctx) |
| 226 | RegisterStubsBuildComponents(ctx) |
| 227 | RegisterSystemModulesBuildComponents(ctx) |
Paul Duffin | 635aa08 | 2021-01-25 19:11:24 +0000 | [diff] [blame] | 228 | |
| 229 | // Make sure that any tool related module types needed by dexpreopt have been registered. |
| 230 | dexpreopt.RegisterToolModulesForTest(ctx) |
Paul Duffin | c059c8c | 2021-01-20 17:13:52 +0000 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | // Gather the module definitions needed by tests that depend upon code from this package. |
| 234 | // |
| 235 | // Returns an `Android.bp` snippet that defines the modules that are needed by this package. |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 236 | func GatherRequiredDepsForTest() string { |
| 237 | var bp string |
| 238 | |
| 239 | extraModules := []string{ |
| 240 | "core-lambda-stubs", |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 241 | "ext", |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 242 | "android_stubs_current", |
| 243 | "android_system_stubs_current", |
| 244 | "android_test_stubs_current", |
Jiyong Park | 50146e9 | 2020-01-30 18:00:15 +0900 | [diff] [blame] | 245 | "android_module_lib_stubs_current", |
Anton Hansson | ba6ab2e | 2020-03-19 15:23:38 +0000 | [diff] [blame] | 246 | "android_system_server_stubs_current", |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 247 | "core.current.stubs", |
Pete Gillin | 1f41dbf | 2020-06-02 15:59:45 +0100 | [diff] [blame] | 248 | "legacy.core.platform.api.stubs", |
| 249 | "stable.core.platform.api.stubs", |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 250 | "kotlin-stdlib", |
Colin Cross | 0b03d97 | 2019-05-13 11:06:25 -0700 | [diff] [blame] | 251 | "kotlin-stdlib-jdk7", |
| 252 | "kotlin-stdlib-jdk8", |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 253 | "kotlin-annotations", |
| 254 | } |
| 255 | |
| 256 | for _, extra := range extraModules { |
| 257 | bp += fmt.Sprintf(` |
| 258 | java_library { |
| 259 | name: "%s", |
| 260 | srcs: ["a.java"], |
Paul Duffin | 52d398a | 2019-06-11 12:31:14 +0100 | [diff] [blame] | 261 | sdk_version: "none", |
Pete Gillin | 84c3807 | 2020-07-09 18:03:41 +0100 | [diff] [blame] | 262 | system_modules: "stable-core-platform-api-stubs-system-modules", |
Liz Kammer | 5ca3a62 | 2020-08-05 15:40:41 -0700 | [diff] [blame] | 263 | compile_dex: true, |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 264 | } |
| 265 | `, extra) |
| 266 | } |
| 267 | |
Ulya Trafimovich | 24813e1 | 2020-10-07 15:05:21 +0100 | [diff] [blame] | 268 | // For class loader context and <uses-library> tests. |
| 269 | dexpreoptModules := []string{"android.test.runner"} |
| 270 | dexpreoptModules = append(dexpreoptModules, dexpreopt.CompatUsesLibs...) |
| 271 | dexpreoptModules = append(dexpreoptModules, dexpreopt.OptionalCompatUsesLibs...) |
| 272 | |
| 273 | for _, extra := range dexpreoptModules { |
| 274 | bp += fmt.Sprintf(` |
| 275 | java_library { |
| 276 | name: "%s", |
| 277 | srcs: ["a.java"], |
| 278 | sdk_version: "none", |
| 279 | system_modules: "stable-core-platform-api-stubs-system-modules", |
| 280 | compile_dex: true, |
| 281 | installable: true, |
| 282 | } |
| 283 | `, extra) |
| 284 | } |
| 285 | |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 286 | bp += ` |
Colin Cross | 3047fa2 | 2019-04-18 10:56:44 -0700 | [diff] [blame] | 287 | java_library { |
| 288 | name: "framework", |
| 289 | srcs: ["a.java"], |
Paul Duffin | a3d0986 | 2019-06-11 13:40:47 +0100 | [diff] [blame] | 290 | sdk_version: "none", |
Pete Gillin | 84c3807 | 2020-07-09 18:03:41 +0100 | [diff] [blame] | 291 | system_modules: "stable-core-platform-api-stubs-system-modules", |
Colin Cross | 3047fa2 | 2019-04-18 10:56:44 -0700 | [diff] [blame] | 292 | aidl: { |
| 293 | export_include_dirs: ["framework/aidl"], |
| 294 | }, |
| 295 | } |
| 296 | |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 297 | android_app { |
| 298 | name: "framework-res", |
Paul Duffin | 50c217c | 2019-06-12 13:25:22 +0100 | [diff] [blame] | 299 | sdk_version: "core_platform", |
Ulya Trafimovich | 24813e1 | 2020-10-07 15:05:21 +0100 | [diff] [blame] | 300 | }` |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 301 | |
| 302 | systemModules := []string{ |
Neil Fuller | ba88c41 | 2018-10-21 22:57:26 +0100 | [diff] [blame] | 303 | "core-current-stubs-system-modules", |
Pete Gillin | 1f41dbf | 2020-06-02 15:59:45 +0100 | [diff] [blame] | 304 | "legacy-core-platform-api-stubs-system-modules", |
Pete Gillin | 40a0642 | 2020-07-01 10:59:00 +0100 | [diff] [blame] | 305 | "stable-core-platform-api-stubs-system-modules", |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | for _, extra := range systemModules { |
| 309 | bp += fmt.Sprintf(` |
| 310 | java_system_modules { |
Paul Duffin | 68289b0 | 2019-09-20 13:50:52 +0100 | [diff] [blame] | 311 | name: "%[1]s", |
| 312 | libs: ["%[1]s-lib"], |
| 313 | } |
| 314 | java_library { |
| 315 | name: "%[1]s-lib", |
| 316 | sdk_version: "none", |
| 317 | system_modules: "none", |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 318 | } |
| 319 | `, extra) |
| 320 | } |
| 321 | |
Paul Duffin | 635aa08 | 2021-01-25 19:11:24 +0000 | [diff] [blame] | 322 | // Make sure that any tools needed for dexpreopting are defined. |
| 323 | bp += dexpreopt.BpToolModulesForTest() |
| 324 | |
Paul Duffin | 1ab6186 | 2021-01-20 17:44:53 +0000 | [diff] [blame] | 325 | // Make sure that the dex_bootjars singleton module is instantiated for the tests. |
| 326 | bp += ` |
| 327 | dex_bootjars { |
| 328 | name: "dex_bootjars", |
| 329 | } |
| 330 | ` |
| 331 | |
Colin Cross | b197453 | 2019-02-15 10:37:39 -0800 | [diff] [blame] | 332 | return bp |
| 333 | } |
Paul Duffin | cee7e66 | 2020-07-09 17:32:57 +0100 | [diff] [blame] | 334 | |
| 335 | func CheckModuleDependencies(t *testing.T, ctx *android.TestContext, name, variant string, expected []string) { |
| 336 | t.Helper() |
| 337 | module := ctx.ModuleForTests(name, variant).Module() |
| 338 | deps := []string{} |
| 339 | ctx.VisitDirectDeps(module, func(m blueprint.Module) { |
| 340 | deps = append(deps, m.Name()) |
| 341 | }) |
| 342 | sort.Strings(deps) |
| 343 | |
| 344 | if actual := deps; !reflect.DeepEqual(expected, actual) { |
| 345 | t.Errorf("expected %#q, found %#q", expected, actual) |
| 346 | } |
| 347 | } |
Paul Duffin | 4fd997b | 2021-02-03 20:06:33 +0000 | [diff] [blame] | 348 | |
| 349 | func CheckHiddenAPIRuleInputs(t *testing.T, expected string, hiddenAPIRule android.TestingBuildParams) { |
Paul Duffin | 3785673 | 2021-02-26 14:24:15 +0000 | [diff] [blame] | 350 | t.Helper() |
Paul Duffin | 4fd997b | 2021-02-03 20:06:33 +0000 | [diff] [blame] | 351 | actual := strings.TrimSpace(strings.Join(android.NormalizePathsForTesting(hiddenAPIRule.Implicits), "\n")) |
| 352 | expected = strings.TrimSpace(expected) |
| 353 | if actual != expected { |
| 354 | t.Errorf("Expected hiddenapi rule inputs:\n%s\nactual inputs:\n%s", expected, actual) |
| 355 | } |
| 356 | } |