Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 1 | // Copyright 2016 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 cc |
| 16 | |
| 17 | import ( |
| 18 | "path/filepath" |
Dan Willemsen | 0b24c74 | 2016-10-04 15:13:37 -0700 | [diff] [blame] | 19 | "runtime" |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 20 | "strings" |
| 21 | |
| 22 | "github.com/google/blueprint" |
| 23 | |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 24 | "android/soong/android" |
| 25 | ) |
| 26 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 27 | type TestProperties struct { |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 28 | // if set, build against the gtest library. Defaults to true. |
Colin Cross | 600c9df | 2016-09-13 12:26:16 -0700 | [diff] [blame] | 29 | Gtest *bool |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 30 | } |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 31 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 32 | type TestBinaryProperties struct { |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 33 | // Create a separate binary for each source file. Useful when there is |
| 34 | // global state that can not be torn down and reset between each test suite. |
| 35 | Test_per_src *bool |
Dan Willemsen | 3340d60 | 2016-12-27 14:40:40 -0800 | [diff] [blame] | 36 | |
| 37 | // Disables the creation of a test-specific directory when used with |
| 38 | // relative_install_path. Useful if several tests need to be in the same |
| 39 | // directory, but test_per_src doesn't work. |
| 40 | No_named_install_directory *bool |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | func init() { |
Colin Cross | 798bfce | 2016-10-12 14:28:16 -0700 | [diff] [blame] | 44 | android.RegisterModuleType("cc_test", testFactory) |
| 45 | android.RegisterModuleType("cc_test_library", testLibraryFactory) |
| 46 | android.RegisterModuleType("cc_benchmark", benchmarkFactory) |
| 47 | android.RegisterModuleType("cc_test_host", testHostFactory) |
| 48 | android.RegisterModuleType("cc_benchmark_host", benchmarkHostFactory) |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | // Module factory for tests |
| 52 | func testFactory() (blueprint.Module, []interface{}) { |
| 53 | module := NewTest(android.HostAndDeviceSupported) |
| 54 | return module.Init() |
| 55 | } |
| 56 | |
| 57 | // Module factory for test libraries |
| 58 | func testLibraryFactory() (blueprint.Module, []interface{}) { |
| 59 | module := NewTestLibrary(android.HostAndDeviceSupported) |
| 60 | return module.Init() |
| 61 | } |
| 62 | |
| 63 | // Module factory for benchmarks |
| 64 | func benchmarkFactory() (blueprint.Module, []interface{}) { |
| 65 | module := NewBenchmark(android.HostAndDeviceSupported) |
| 66 | return module.Init() |
| 67 | } |
| 68 | |
| 69 | // Module factory for host tests |
| 70 | func testHostFactory() (blueprint.Module, []interface{}) { |
| 71 | module := NewTest(android.HostSupported) |
| 72 | return module.Init() |
| 73 | } |
| 74 | |
| 75 | // Module factory for host benchmarks |
| 76 | func benchmarkHostFactory() (blueprint.Module, []interface{}) { |
| 77 | module := NewBenchmark(android.HostSupported) |
| 78 | return module.Init() |
| 79 | } |
| 80 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 81 | type testPerSrc interface { |
| 82 | testPerSrc() bool |
| 83 | srcs() []string |
| 84 | setSrc(string, string) |
| 85 | } |
| 86 | |
| 87 | func (test *testBinary) testPerSrc() bool { |
| 88 | return Bool(test.Properties.Test_per_src) |
| 89 | } |
| 90 | |
| 91 | func (test *testBinary) srcs() []string { |
| 92 | return test.baseCompiler.Properties.Srcs |
| 93 | } |
| 94 | |
| 95 | func (test *testBinary) setSrc(name, src string) { |
| 96 | test.baseCompiler.Properties.Srcs = []string{src} |
| 97 | test.binaryDecorator.Properties.Stem = name |
| 98 | } |
| 99 | |
| 100 | var _ testPerSrc = (*testBinary)(nil) |
| 101 | |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 102 | func testPerSrcMutator(mctx android.BottomUpMutatorContext) { |
| 103 | if m, ok := mctx.Module().(*Module); ok { |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 104 | if test, ok := m.linker.(testPerSrc); ok { |
| 105 | if test.testPerSrc() && len(test.srcs()) > 0 { |
| 106 | testNames := make([]string, len(test.srcs())) |
| 107 | for i, src := range test.srcs() { |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 108 | testNames[i] = strings.TrimSuffix(filepath.Base(src), filepath.Ext(src)) |
| 109 | } |
| 110 | tests := mctx.CreateLocalVariations(testNames...) |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 111 | for i, src := range test.srcs() { |
| 112 | tests[i].(*Module).linker.(testPerSrc).setSrc(testNames[i], src) |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 113 | } |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 119 | type testDecorator struct { |
| 120 | Properties TestProperties |
| 121 | linker *baseLinker |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 122 | } |
| 123 | |
Colin Cross | 600c9df | 2016-09-13 12:26:16 -0700 | [diff] [blame] | 124 | func (test *testDecorator) gtest() bool { |
| 125 | return test.Properties.Gtest == nil || *test.Properties.Gtest == true |
| 126 | } |
| 127 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 128 | func (test *testDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags { |
Colin Cross | 600c9df | 2016-09-13 12:26:16 -0700 | [diff] [blame] | 129 | if !test.gtest() { |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 130 | return flags |
| 131 | } |
| 132 | |
| 133 | flags.CFlags = append(flags.CFlags, "-DGTEST_HAS_STD_STRING") |
| 134 | if ctx.Host() { |
| 135 | flags.CFlags = append(flags.CFlags, "-O0", "-g") |
| 136 | |
| 137 | switch ctx.Os() { |
| 138 | case android.Windows: |
| 139 | flags.CFlags = append(flags.CFlags, "-DGTEST_OS_WINDOWS") |
| 140 | case android.Linux: |
| 141 | flags.CFlags = append(flags.CFlags, "-DGTEST_OS_LINUX") |
| 142 | flags.LdFlags = append(flags.LdFlags, "-lpthread") |
| 143 | case android.Darwin: |
| 144 | flags.CFlags = append(flags.CFlags, "-DGTEST_OS_MAC") |
| 145 | flags.LdFlags = append(flags.LdFlags, "-lpthread") |
| 146 | } |
| 147 | } else { |
| 148 | flags.CFlags = append(flags.CFlags, "-DGTEST_OS_LINUX_ANDROID") |
| 149 | } |
| 150 | |
| 151 | return flags |
| 152 | } |
| 153 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 154 | func (test *testDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { |
Colin Cross | 600c9df | 2016-09-13 12:26:16 -0700 | [diff] [blame] | 155 | if test.gtest() { |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 156 | if ctx.sdk() && ctx.Device() { |
| 157 | switch ctx.selectedStl() { |
| 158 | case "ndk_libc++_shared", "ndk_libc++_static": |
| 159 | deps.StaticLibs = append(deps.StaticLibs, "libgtest_main_ndk_libcxx", "libgtest_ndk_libcxx") |
| 160 | case "ndk_libgnustl_static": |
| 161 | deps.StaticLibs = append(deps.StaticLibs, "libgtest_main_ndk_gnustl", "libgtest_ndk_gnustl") |
| 162 | default: |
| 163 | deps.StaticLibs = append(deps.StaticLibs, "libgtest_main_ndk", "libgtest_ndk") |
| 164 | } |
| 165 | } else { |
| 166 | deps.StaticLibs = append(deps.StaticLibs, "libgtest_main", "libgtest") |
| 167 | } |
| 168 | } |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 169 | |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 170 | return deps |
| 171 | } |
| 172 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 173 | func (test *testDecorator) linkerInit(ctx BaseModuleContext, linker *baseLinker) { |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 174 | runpath := "../../lib" |
| 175 | if ctx.toolchain().Is64Bit() { |
| 176 | runpath += "64" |
| 177 | } |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 178 | linker.dynamicProperties.RunPaths = append(linker.dynamicProperties.RunPaths, runpath) |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 179 | } |
| 180 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 181 | func (test *testDecorator) linkerProps() []interface{} { |
| 182 | return []interface{}{&test.Properties} |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 183 | } |
| 184 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 185 | func NewTestInstaller() *baseInstaller { |
| 186 | return NewBaseInstaller("nativetest", "nativetest64", InstallInData) |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 187 | } |
| 188 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 189 | type testBinary struct { |
| 190 | testDecorator |
| 191 | *binaryDecorator |
| 192 | *baseCompiler |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 193 | Properties TestBinaryProperties |
| 194 | } |
| 195 | |
| 196 | func (test *testBinary) linkerProps() []interface{} { |
| 197 | props := append(test.testDecorator.linkerProps(), test.binaryDecorator.linkerProps()...) |
| 198 | props = append(props, &test.Properties) |
| 199 | return props |
| 200 | } |
| 201 | |
| 202 | func (test *testBinary) linkerInit(ctx BaseModuleContext) { |
| 203 | test.testDecorator.linkerInit(ctx, test.binaryDecorator.baseLinker) |
| 204 | test.binaryDecorator.linkerInit(ctx) |
| 205 | } |
| 206 | |
Colin Cross | 37047f1 | 2016-12-13 17:06:13 -0800 | [diff] [blame] | 207 | func (test *testBinary) linkerDeps(ctx DepsContext, deps Deps) Deps { |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 208 | deps = test.testDecorator.linkerDeps(ctx, deps) |
| 209 | deps = test.binaryDecorator.linkerDeps(ctx, deps) |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 210 | return deps |
| 211 | } |
| 212 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 213 | func (test *testBinary) linkerFlags(ctx ModuleContext, flags Flags) Flags { |
| 214 | flags = test.binaryDecorator.linkerFlags(ctx, flags) |
| 215 | flags = test.testDecorator.linkerFlags(ctx, flags) |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 216 | return flags |
| 217 | } |
| 218 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 219 | func (test *testBinary) install(ctx ModuleContext, file android.Path) { |
Colin Cross | 600c9df | 2016-09-13 12:26:16 -0700 | [diff] [blame] | 220 | test.binaryDecorator.baseInstaller.dir = "nativetest" |
| 221 | test.binaryDecorator.baseInstaller.dir64 = "nativetest64" |
Dan Willemsen | 3340d60 | 2016-12-27 14:40:40 -0800 | [diff] [blame] | 222 | |
| 223 | if !Bool(test.Properties.No_named_install_directory) { |
| 224 | test.binaryDecorator.baseInstaller.relative = ctx.ModuleName() |
| 225 | } else if test.binaryDecorator.baseInstaller.Properties.Relative_install_path == "" { |
| 226 | ctx.PropertyErrorf("no_named_install_directory", "Module install directory may only be disabled if relative_install_path is set") |
| 227 | } |
| 228 | |
Dan Willemsen | 1d577e2 | 2016-08-29 15:53:15 -0700 | [diff] [blame] | 229 | test.binaryDecorator.baseInstaller.install(ctx, file) |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | func NewTest(hod android.HostOrDeviceSupported) *Module { |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 233 | module, binary := NewBinary(hod) |
| 234 | module.multilib = android.MultilibBoth |
Dan Willemsen | 1d577e2 | 2016-08-29 15:53:15 -0700 | [diff] [blame] | 235 | binary.baseInstaller = NewTestInstaller() |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 236 | |
| 237 | test := &testBinary{ |
| 238 | testDecorator: testDecorator{ |
| 239 | linker: binary.baseLinker, |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 240 | }, |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 241 | binaryDecorator: binary, |
| 242 | baseCompiler: NewBaseCompiler(), |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 243 | } |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 244 | module.compiler = test |
| 245 | module.linker = test |
| 246 | module.installer = test |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 247 | return module |
| 248 | } |
| 249 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 250 | type testLibrary struct { |
| 251 | testDecorator |
| 252 | *libraryDecorator |
| 253 | } |
| 254 | |
| 255 | func (test *testLibrary) linkerProps() []interface{} { |
| 256 | return append(test.testDecorator.linkerProps(), test.libraryDecorator.linkerProps()...) |
| 257 | } |
| 258 | |
| 259 | func (test *testLibrary) linkerInit(ctx BaseModuleContext) { |
| 260 | test.testDecorator.linkerInit(ctx, test.libraryDecorator.baseLinker) |
| 261 | test.libraryDecorator.linkerInit(ctx) |
| 262 | } |
| 263 | |
Colin Cross | 37047f1 | 2016-12-13 17:06:13 -0800 | [diff] [blame] | 264 | func (test *testLibrary) linkerDeps(ctx DepsContext, deps Deps) Deps { |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 265 | deps = test.testDecorator.linkerDeps(ctx, deps) |
| 266 | deps = test.libraryDecorator.linkerDeps(ctx, deps) |
| 267 | return deps |
| 268 | } |
| 269 | |
| 270 | func (test *testLibrary) linkerFlags(ctx ModuleContext, flags Flags) Flags { |
| 271 | flags = test.libraryDecorator.linkerFlags(ctx, flags) |
| 272 | flags = test.testDecorator.linkerFlags(ctx, flags) |
| 273 | return flags |
| 274 | } |
| 275 | |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 276 | func NewTestLibrary(hod android.HostOrDeviceSupported) *Module { |
Colin Cross | ab3b732 | 2016-12-09 14:46:15 -0800 | [diff] [blame] | 277 | module, library := NewLibrary(android.HostAndDeviceSupported) |
Dan Willemsen | 28bda51 | 2016-08-31 16:32:55 -0700 | [diff] [blame] | 278 | library.baseInstaller = NewTestInstaller() |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 279 | test := &testLibrary{ |
| 280 | testDecorator: testDecorator{ |
| 281 | linker: library.baseLinker, |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 282 | }, |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 283 | libraryDecorator: library, |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 284 | } |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 285 | module.linker = test |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 286 | return module |
| 287 | } |
| 288 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 289 | type benchmarkDecorator struct { |
| 290 | *binaryDecorator |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 291 | } |
| 292 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 293 | func (benchmark *benchmarkDecorator) linkerInit(ctx BaseModuleContext) { |
| 294 | runpath := "../../lib" |
| 295 | if ctx.toolchain().Is64Bit() { |
| 296 | runpath += "64" |
| 297 | } |
| 298 | benchmark.baseLinker.dynamicProperties.RunPaths = append(benchmark.baseLinker.dynamicProperties.RunPaths, runpath) |
| 299 | benchmark.binaryDecorator.linkerInit(ctx) |
| 300 | } |
| 301 | |
Colin Cross | 37047f1 | 2016-12-13 17:06:13 -0800 | [diff] [blame] | 302 | func (benchmark *benchmarkDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps { |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 303 | deps = benchmark.binaryDecorator.linkerDeps(ctx, deps) |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 304 | deps.StaticLibs = append(deps.StaticLibs, "libgoogle-benchmark") |
| 305 | return deps |
| 306 | } |
| 307 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 308 | func (benchmark *benchmarkDecorator) install(ctx ModuleContext, file android.Path) { |
Dan Willemsen | 1d577e2 | 2016-08-29 15:53:15 -0700 | [diff] [blame] | 309 | benchmark.binaryDecorator.baseInstaller.dir = filepath.Join("nativetest", ctx.ModuleName()) |
| 310 | benchmark.binaryDecorator.baseInstaller.dir64 = filepath.Join("nativetest64", ctx.ModuleName()) |
| 311 | benchmark.binaryDecorator.baseInstaller.install(ctx, file) |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 312 | } |
| 313 | |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 314 | func NewBenchmark(hod android.HostOrDeviceSupported) *Module { |
Dan Willemsen | 0b24c74 | 2016-10-04 15:13:37 -0700 | [diff] [blame] | 315 | // Benchmarks aren't supported on Darwin |
| 316 | if runtime.GOOS == "darwin" { |
| 317 | switch hod { |
| 318 | case android.HostAndDeviceSupported: |
| 319 | hod = android.DeviceSupported |
| 320 | case android.HostSupported: |
| 321 | hod = android.NeitherHostNorDeviceSupported |
| 322 | } |
| 323 | } |
| 324 | |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 325 | module, binary := NewBinary(hod) |
| 326 | module.multilib = android.MultilibBoth |
Dan Willemsen | 1d577e2 | 2016-08-29 15:53:15 -0700 | [diff] [blame] | 327 | binary.baseInstaller = NewTestInstaller() |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 328 | |
| 329 | benchmark := &benchmarkDecorator{ |
| 330 | binaryDecorator: binary, |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 331 | } |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 332 | module.linker = benchmark |
| 333 | module.installer = benchmark |
Colin Cross | 4d9c2d1 | 2016-07-29 12:48:20 -0700 | [diff] [blame] | 334 | return module |
| 335 | } |