diff options
Diffstat (limited to 'cc')
-rw-r--r-- | cc/binary_test.go | 6 | ||||
-rw-r--r-- | cc/library_test.go | 2 | ||||
-rw-r--r-- | cc/prebuilt_test.go | 5 |
3 files changed, 12 insertions, 1 deletions
diff --git a/cc/binary_test.go b/cc/binary_test.go index e0b5b5d20..2fac0023b 100644 --- a/cc/binary_test.go +++ b/cc/binary_test.go @@ -15,9 +15,10 @@ package cc import ( - "android/soong/bazel/cquery" "testing" + "android/soong/bazel/cquery" + "android/soong/android" ) @@ -53,6 +54,9 @@ cc_binary { unStrippedFilePath := binMod.(*Module).UnstrippedOutputFile() expectedUnStrippedFile := "outputbase/execroot/__main__/foo.unstripped" android.AssertStringEquals(t, "Unstripped output file", expectedUnStrippedFile, unStrippedFilePath.String()) + + entries := android.AndroidMkEntriesForTest(t, ctx, binMod)[0] + android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_binary", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0]) } func TestCcBinaryWithBazelValidations(t *testing.T) { diff --git a/cc/library_test.go b/cc/library_test.go index de3db99db..dbe2be899 100644 --- a/cc/library_test.go +++ b/cc/library_test.go @@ -464,6 +464,7 @@ cc_library_shared { expectedFlags := []string{"-Ioutputbase/execroot/__main__/include", "-isystem outputbase/execroot/__main__/system_include"} gotFlags := entries.EntryMap["LOCAL_EXPORT_CFLAGS"] android.AssertDeepEquals(t, "androidmk exported cflags", expectedFlags, gotFlags) + android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_library_shared", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0]) } func TestCcLibrarySharedWithBazel(t *testing.T) { @@ -510,6 +511,7 @@ cc_library_shared { expectedFlags := []string{"-Ioutputbase/execroot/__main__/include", "-isystem outputbase/execroot/__main__/system_include"} gotFlags := entries.EntryMap["LOCAL_EXPORT_CFLAGS"] android.AssertDeepEquals(t, "androidmk exported cflags", expectedFlags, gotFlags) + android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_library_shared", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0]) } func TestWholeStaticLibPrebuilts(t *testing.T) { diff --git a/cc/prebuilt_test.go b/cc/prebuilt_test.go index 405680c39..e3ec9d5d4 100644 --- a/cc/prebuilt_test.go +++ b/cc/prebuilt_test.go @@ -169,6 +169,11 @@ func TestPrebuilt(t *testing.T) { if !hasDep(crtx, prebuiltCrtx) { t.Errorf("crtx missing dependency on prebuilt_crtx") } + + entries := android.AndroidMkEntriesForTest(t, ctx, prebuiltLiba)[0] + android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_prebuilt_library_shared", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0]) + entries = android.AndroidMkEntriesForTest(t, ctx, prebuiltLibb)[0] + android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_prebuilt_library_static", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0]) } func TestPrebuiltLibraryShared(t *testing.T) { |