summaryrefslogtreecommitdiff
path: root/rust/rust_test.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2021-04-14 19:02:49 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-04-14 19:02:49 +0000
commitd466b4a1f5ab2b1553bb3b6ed849e006713d9f31 (patch)
tree7b86cc8b71d47b03e1fce90bb179bb16dbbb0a4b /rust/rust_test.go
parente8dfbdfb59ba807b809c368c604b684157747b46 (diff)
parentc08897c1e442be2e0f6db99ca310c9dc7c2e3194 (diff)
Merge changes from topic "rust_vendor_support"
* changes: Add more Rust vendor image support. rust: Use new common image mutator interface.
Diffstat (limited to 'rust/rust_test.go')
-rw-r--r--rust/rust_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/rust/rust_test.go b/rust/rust_test.go
index 890fb262b..47c64a9ad 100644
--- a/rust/rust_test.go
+++ b/rust/rust_test.go
@@ -113,6 +113,24 @@ func testRustError(t *testing.T, pattern string, bp string) {
RunTestWithBp(t, bp)
}
+// testRustVndkError is similar to testRustError, but can be used to test VNDK-related errors.
+func testRustVndkError(t *testing.T, pattern string, bp string) {
+ skipTestIfOsNotSupported(t)
+ android.GroupFixturePreparers(
+ prepareForRustTest,
+ rustMockedFiles.AddToFixture(),
+ android.FixtureModifyProductVariables(
+ func(variables android.FixtureProductVariables) {
+ variables.DeviceVndkVersion = StringPtr("current")
+ variables.ProductVndkVersion = StringPtr("current")
+ variables.Platform_vndk_version = StringPtr("VER")
+ },
+ ),
+ ).
+ ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(pattern)).
+ RunTestWithBp(t, bp)
+}
+
// testRustCtx is used to build a particular test environment. Unless your
// tests requires a specific setup, prefer the wrapping functions: testRust,
// testRustCov or testRustError.