Merge changes from topic "soong_tests_ndk"

* changes:
  Make apex use cc.GatherRequiredDepsForTests
  Move NDK test modules into cc/testing.go
This commit is contained in:
Treehugger Robot
2020-02-20 20:39:16 +00:00
committed by Gerrit Code Review
11 changed files with 132 additions and 219 deletions

View File

@@ -1858,42 +1858,6 @@ func TestAndroidTestImport_NoJinUncompressForPresigned(t *testing.T) {
func TestStl(t *testing.T) {
ctx, _ := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
cc_library {
name: "ndk_libunwind",
sdk_version: "current",
stl: "none",
system_shared_libs: [],
}
cc_library {
name: "libc.ndk.current",
sdk_version: "current",
stl: "none",
system_shared_libs: [],
}
cc_library {
name: "libm.ndk.current",
sdk_version: "current",
stl: "none",
system_shared_libs: [],
}
cc_library {
name: "libdl.ndk.current",
sdk_version: "current",
stl: "none",
system_shared_libs: [],
}
cc_object {
name: "ndk_crtbegin_so.27",
}
cc_object {
name: "ndk_crtend_so.27",
}
cc_library {
name: "libjni",
sdk_version: "current",
@@ -1914,10 +1878,6 @@ func TestStl(t *testing.T) {
compile_multilib: "both",
sdk_version: "current",
}
ndk_prebuilt_shared_stl {
name: "ndk_libc++_shared",
}
`)
testCases := []struct {

View File

@@ -92,7 +92,6 @@ func testContext() *android.TestContext {
// Register module types and mutators from cc needed for JNI testing
cc.RegisterRequiredBuildComponentsForTest(ctx)
ctx.RegisterModuleType("ndk_prebuilt_shared_stl", cc.NdkPrebuiltSharedStlFactory)
dexpreopt.RegisterToolModulesForTest(ctx)

View File

@@ -18,6 +18,7 @@ import (
"fmt"
"android/soong/android"
"android/soong/cc"
)
func TestConfig(buildDir string, env map[string]string, bp string, fs map[string][]byte) android.Config {
@@ -52,8 +53,6 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string
"assets_a/a": nil,
"assets_b/b": nil,
"prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so": nil,
"prebuilts/sdk/14/public/android.jar": nil,
"prebuilts/sdk/14/public/framework.aidl": nil,
"prebuilts/sdk/14/system/android.jar": nil,
@@ -122,6 +121,8 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string
"stubs/sources/foo/Foo.java": nil,
}
cc.GatherRequiredFilesForTest(mockFS)
for k, v := range fs {
mockFS[k] = v
}