summaryrefslogtreecommitdiff
path: root/android/namespace_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/namespace_test.go')
-rw-r--r--android/namespace_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/android/namespace_test.go b/android/namespace_test.go
index 87d13206b..7a387a0bd 100644
--- a/android/namespace_test.go
+++ b/android/namespace_test.go
@@ -602,6 +602,36 @@ func TestRename(t *testing.T) {
// RunTest will report any errors
}
+func TestNamespace_Exports(t *testing.T) {
+ result := GroupFixturePreparers(
+ prepareForTestWithNamespace,
+ FixtureModifyProductVariables(func(variables FixtureProductVariables) {
+ variables.NamespacesToExport = []string{"dir1"}
+ }),
+ dirBpToPreparer(map[string]string{
+ "dir1": `
+ soong_namespace {
+ }
+ test_module {
+ name: "a",
+ }
+ `,
+ "dir2": `
+ soong_namespace {
+ }
+ test_module {
+ name: "b",
+ }
+ `,
+ }),
+ ).RunTest(t)
+
+ aModule := result.Module("a", "")
+ AssertBoolEquals(t, "a exported", true, aModule.ExportedToMake())
+ bModule := result.Module("b", "")
+ AssertBoolEquals(t, "b not exported", false, bModule.ExportedToMake())
+}
+
// some utils to support the tests
var prepareForTestWithNamespace = GroupFixturePreparers(