summaryrefslogtreecommitdiff
path: root/apex/aconfig_test.go
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2024-07-01 17:04:46 +0000
committer Jihoon Kang <jihoonkang@google.com> 2024-08-27 17:30:42 +0000
commitbb678f82d6bb5cd89bf282e88a879123d9763d61 (patch)
treee158cdfc87bc019e85dc2f861c3abdebc7426927 /apex/aconfig_test.go
parent601939d0a78e393058c2582b9ff73ffd500f6747 (diff)
Implement detecting container violations.
This change introduces a method to detect violating inter-container dependencies between modules. The method is run in `ModuleBase.GenerateBuildActions`, after the container info provider is set. Given that the provider of the direct dependencies would have been set at this time, the method utilizes this information to determine the violations, which are introduced in https://r.android.com/3141104. Note that this enforcement does not turn all inter-container dependencies as errors. Instead, it will only turn dependencies that matches the pre-defined violations into errors. Even if the dependency matches the violation, an error will not be thrown if the dependency satisfies any of the exception functions (e.g. the dependent module is stubs, or the two modules belong to the same apexes). Test: m nothing --no-skip-soong-tests Bug: 338660802 Change-Id: I36e9cd956c5a076a53635be0c6ff27f77725516e
Diffstat (limited to 'apex/aconfig_test.go')
-rw-r--r--apex/aconfig_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/apex/aconfig_test.go b/apex/aconfig_test.go
index 14c0b6394..bb811f58a 100644
--- a/apex/aconfig_test.go
+++ b/apex/aconfig_test.go
@@ -74,6 +74,8 @@ func TestValidationAcrossContainersExportedPass(t *testing.T) {
apex_available: [
"myapex",
],
+ sdk_version: "none",
+ system_modules: "none",
}`,
},
{
@@ -122,6 +124,8 @@ func TestValidationAcrossContainersExportedPass(t *testing.T) {
apex_available: [
"myapex",
],
+ sdk_version: "none",
+ system_modules: "none",
}`,
},
{
@@ -345,6 +349,8 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) {
apex_available: [
"myapex",
],
+ sdk_version: "none",
+ system_modules: "none",
}`,
expectedError: `.*my_java_library_foo/myapex depends on my_java_aconfig_library_foo/otherapex/production across containers`,
},
@@ -392,6 +398,8 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) {
apex_available: [
"myapex",
],
+ sdk_version: "none",
+ system_modules: "none",
}`,
expectedError: `.*my_android_app_foo/myapex depends on my_java_aconfig_library_foo/otherapex/production across containers`,
},
@@ -693,6 +701,8 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) {
apex_available: [
"myapex",
],
+ sdk_version: "none",
+ system_modules: "none",
}`,
expectedError: `.*my_android_app_foo/myapex depends on my_java_aconfig_library_foo/otherapex/production across containers`,
},
@@ -769,6 +779,8 @@ func TestValidationNotPropagateAcrossShared(t *testing.T) {
apex_available: [
"myapex",
],
+ sdk_version: "none",
+ system_modules: "none",
}`,
},
}