aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-05-10 18:09:30 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-10 18:09:30 +0000
commite6ca5992ed6633d20fa8e4f828603718a38b2ade (patch)
tree560ef6a2ac27fe0bb3e8a9585038a41f83c93d50 /android
parent3c292920eae795f7fe268188d8595273b992121a (diff)
parent766a3d52d7768f573c78b1c1ed42b1547adb4bf6 (diff)
downloadbuild_soong-e6ca5992ed6633d20fa8e4f828603718a38b2ade.tar.gz
build_soong-e6ca5992ed6633d20fa8e4f828603718a38b2ade.tar.bz2
build_soong-e6ca5992ed6633d20fa8e4f828603718a38b2ade.zip
Merge changes If90975c8,I2a873fc6 am: 570e18ffaa am: e4b293ebee
am: 766a3d52d7 Change-Id: I5e3318688695d69ce4b953f22ec7c5da65d89fea
Diffstat (limited to 'android')
-rw-r--r--android/paths.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/android/paths.go b/android/paths.go
index 75e5980e..0d26dc02 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -721,3 +721,25 @@ func validatePath(ctx PathContext, paths ...string) string {
}
return validateSafePath(ctx, paths...)
}
+
+type testPath struct {
+ basePath
+}
+
+func (p testPath) String() string {
+ return p.path
+}
+
+func PathForTesting(paths ...string) Path {
+ p := validateSafePath(nil, paths...)
+ return testPath{basePath{path: p, rel: p}}
+}
+
+func PathsForTesting(strs []string) Paths {
+ p := make(Paths, len(strs))
+ for i, s := range strs {
+ p[i] = PathForTesting(s)
+ }
+
+ return p
+}