diff options
author | 2020-02-25 19:26:33 +0000 | |
---|---|---|
committer | 2020-03-02 19:31:26 +0000 | |
commit | 1356d8c0f32dfd598e586e1b135445d0c4af68dc (patch) | |
tree | a311142208dba9b7ebad1b2ef790b0b6d002f633 /sdk/cc_sdk_test.go | |
parent | 109c2add59ea2bcbfd0ae7f6ba95bb3db8223ca5 (diff) |
Add CommonOS variant for sdk
Adds a CommonOS variant for sdk that depends on the os specific
variants and is used to generate a single sdk for multiple OsTypes,
e.g. host linux and android.
At the minute the member types only support a single OsType but the
basic mechanism for managing the CommonOS variant and collating the
variants across all of them is there.
The only visible effect of this change is that the location of the
generated snapshot is changed, it is no longer os specific and instead
is in the same location irrespective of which os it is built for.
A lot of tests needed to be changed to specify "common_os" as the
variant type instead of the specific os type. As that is the same across
all tests it is hard coded in CheckSnapshot method.
Test: m nothing
Bug: 150451422
Change-Id: If36be39b06d6910453649f7c288c2d34f688b2f4
Diffstat (limited to 'sdk/cc_sdk_test.go')
-rw-r--r-- | sdk/cc_sdk_test.go | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go index ecb1da0a0..45b548ccb 100644 --- a/sdk/cc_sdk_test.go +++ b/sdk/cc_sdk_test.go @@ -17,6 +17,7 @@ package sdk import ( "testing" + "android/soong/android" "android/soong/cc" ) @@ -54,7 +55,7 @@ func TestSdkIsCompileMultilibBoth(t *testing.T) { arm64Output := result.Module("sdkmember", "android_arm64_armv8-a_shared").(*cc.Module).OutputFile() var inputs []string - buildParams := result.Module("mysdk", "android_common").BuildParamsForTests() + buildParams := result.Module("mysdk", android.CommonOS.Name).BuildParamsForTests() for _, bp := range buildParams { if bp.Input != nil { inputs = append(inputs, bp.Input.String()) @@ -250,7 +251,7 @@ func TestSnapshotWithCcDuplicateHeaders(t *testing.T) { } `) - result.CheckSnapshot("mysdk", "android_common", "", + result.CheckSnapshot("mysdk", "", checkAllCopyRules(` include/Test.h -> include/include/Test.h .intermediates/mynativelib1/android_arm64_armv8-a_shared/mynativelib1.so -> arm64/lib/mynativelib1.so @@ -287,7 +288,7 @@ func TestSnapshotWithCcSharedLibraryCommonProperties(t *testing.T) { } `) - result.CheckSnapshot("mysdk", "android_common", "", + result.CheckSnapshot("mysdk", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -356,7 +357,7 @@ func TestSnapshotWithCcBinary(t *testing.T) { } `) - result.CheckSnapshot("mymodule_exports", "android_common", "", + result.CheckSnapshot("mymodule_exports", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -422,7 +423,7 @@ func TestSnapshotWithCcSharedLibrary(t *testing.T) { } `) - result.CheckSnapshot("mysdk", "android_common", "", + result.CheckSnapshot("mysdk", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -510,7 +511,7 @@ func TestHostSnapshotWithCcSharedLibrary(t *testing.T) { } `) - result.CheckSnapshot("mysdk", "linux_glibc_common", "", + result.CheckSnapshot("mysdk", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -597,7 +598,7 @@ func TestSnapshotWithCcStaticLibrary(t *testing.T) { } `) - result.CheckSnapshot("myexports", "android_common", "", + result.CheckSnapshot("myexports", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -685,7 +686,7 @@ func TestHostSnapshotWithCcStaticLibrary(t *testing.T) { } `) - result.CheckSnapshot("myexports", "linux_glibc_common", "", + result.CheckSnapshot("myexports", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -784,7 +785,7 @@ func TestHostSnapshotWithMultiLib64(t *testing.T) { } `) - result.CheckSnapshot("myexports", "linux_glibc_common", "", + result.CheckSnapshot("myexports", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -856,7 +857,7 @@ func TestSnapshotWithCcHeadersLibrary(t *testing.T) { } `) - result.CheckSnapshot("mysdk", "android_common", "", + result.CheckSnapshot("mysdk", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -909,7 +910,7 @@ func TestHostSnapshotWithCcHeadersLibrary(t *testing.T) { } `) - result.CheckSnapshot("mysdk", "linux_glibc_common", "", + result.CheckSnapshot("mysdk", "", checkAndroidBpContents(` // This is auto-generated. DO NOT EDIT. |