summaryrefslogtreecommitdiff
path: root/android/testing.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-03-24 10:40:38 +0000
committer Paul Duffin <paulduffin@google.com> 2021-03-30 19:35:35 +0100
commite8366da1f61cbff804cefe3b69f6293b4bad0c98 (patch)
tree34b781c8f22d8f72d2592147037baf7309c9cfad /android/testing.go
parentb2786a3fdc36cb87c5ef5a9b4940cacffc0a90f2 (diff)
Automatically call TestingBuildParams.RelativeToTop()
Fixes the few tests that break due to this and which cannot easily be separated into their own changes. Bug: 183650682 Test: m nothing Change-Id: Ia2f31213a1f114a78e66a81d89279ecde9f4c465
Diffstat (limited to 'android/testing.go')
-rw-r--r--android/testing.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/android/testing.go b/android/testing.go
index acec6fc01..f4f5c98e2 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -558,7 +558,7 @@ func (p TestingBuildParams) RelativeToTop() TestingBuildParams {
return p
}
if p.config.config == nil {
- panic("cannot call RelativeToTop() on a TestingBuildParams previously returned by RelativeToTop()")
+ return p
}
// Take a copy of the build params and replace any args that contains test specific temporary
// paths with paths relative to the top.
@@ -670,7 +670,7 @@ func (b baseTestingComponent) newTestingBuildParams(bparams BuildParams) Testing
config: b.config,
BuildParams: bparams,
RuleParams: b.provider.RuleParamsForTests()[bparams.Rule],
- }
+ }.RelativeToTop()
}
func (b baseTestingComponent) maybeBuildParamsFromRule(rule string) (TestingBuildParams, []string) {