summaryrefslogtreecommitdiff
path: root/apex/builder.go
diff options
context:
space:
mode:
author Jooyung Han <jooyung@google.com> 2024-11-22 14:05:20 +0900
committer Jooyung Han <jooyung@google.com> 2024-11-25 12:56:15 +0900
commitb9518073037aee71b0ed71cbcd930e44cde0a592 (patch)
treeab94eceee4407f25ac7b7c23dbd94ea7e38c2c07 /apex/builder.go
parent1a6f176ce066fc39574db6b7bcb69da82e579199 (diff)
Add apex_test.skip_validations
Run validations for apex_test modules as well. If a test apex needs to be invalid for testing, it needs to specify which validation it needs to skip. This is to prevent cases like using apex_test to avoid a certain validation, but accidentally skipping all validations. For now, host_apex_verifier/apex_sepolicy_tests can be skipped. Bug: 363090062 Test: m nothing --no-skip-soong-tests Test: mmma system/apex Change-Id: I2d14f25f579eabe92ed2bd0e28b5ed19583df99d
Diffstat (limited to 'apex/builder.go')
-rw-r--r--apex/builder.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/apex/builder.go b/apex/builder.go
index d0acc8d6c..e5ae10622 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -924,14 +924,14 @@ func (a *apexBundle) buildApex(ctx android.ModuleContext) {
var validations android.Paths
validations = append(validations, runApexLinkerconfigValidation(ctx, unsignedOutputFile, imageDir))
// TODO(b/279688635) deapexer supports [ext4]
- if !a.testApex && suffix == imageApexSuffix && ext4 == a.payloadFsType {
+ if !a.skipValidation(apexSepolicyTests) && suffix == imageApexSuffix && ext4 == a.payloadFsType {
validations = append(validations, runApexSepolicyTests(ctx, unsignedOutputFile))
}
if !a.testApex && len(a.properties.Unwanted_transitive_deps) > 0 {
validations = append(validations,
runApexElfCheckerUnwanted(ctx, unsignedOutputFile, a.properties.Unwanted_transitive_deps))
}
- if !a.testApex && android.InList(a.payloadFsType, []fsType{ext4, erofs}) {
+ if !a.skipValidation(hostApexVerifier) && android.InList(a.payloadFsType, []fsType{ext4, erofs}) {
validations = append(validations, runApexHostVerifier(ctx, a, unsignedOutputFile))
}
ctx.Build(pctx, android.BuildParams{
@@ -1220,7 +1220,7 @@ func runApexLinkerconfigValidation(ctx android.ModuleContext, apexFile android.P
// $ deapexer list -Z {apex_file} > {file_contexts}
// $ apex_sepolicy_tests -f {file_contexts}
func runApexSepolicyTests(ctx android.ModuleContext, apexFile android.Path) android.Path {
- timestamp := android.PathForModuleOut(ctx, "sepolicy_tests.timestamp")
+ timestamp := android.PathForModuleOut(ctx, "apex_sepolicy_tests.timestamp")
ctx.Build(pctx, android.BuildParams{
Rule: apexSepolicyTestsRule,
Input: apexFile,