summaryrefslogtreecommitdiff
path: root/rust/rust_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/rust_test.go')
-rw-r--r--rust/rust_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/rust/rust_test.go b/rust/rust_test.go
index 88d964300..a0ed5345f 100644
--- a/rust/rust_test.go
+++ b/rust/rust_test.go
@@ -64,6 +64,14 @@ func testRust(t *testing.T, bp string) *android.TestContext {
return tctx.parse(t)
}
+func testRustVndk(t *testing.T, bp string) *android.TestContext {
+ tctx := newTestRustCtx(t, bp)
+ tctx.useMockedFs()
+ tctx.generateConfig()
+ tctx.setVndk(t)
+ return tctx.parse(t)
+}
+
// testRustCov returns a TestContext in which a basic environment has been
// setup. This environment explicitly enables coverage.
func testRustCov(t *testing.T, bp string) *android.TestContext {
@@ -140,6 +148,15 @@ func (tctx *testRustCtx) enableCoverage(t *testing.T) {
tctx.config.TestProductVariables.NativeCoveragePaths = []string{"*"}
}
+func (tctx *testRustCtx) setVndk(t *testing.T) {
+ if tctx.config == nil {
+ t.Fatalf("tctx.config not been generated yet. Please call generateConfig first.")
+ }
+ tctx.config.TestProductVariables.DeviceVndkVersion = StringPtr("current")
+ tctx.config.TestProductVariables.ProductVndkVersion = StringPtr("current")
+ tctx.config.TestProductVariables.Platform_vndk_version = StringPtr("VER")
+}
+
// parse validates the configuration and parses the Blueprint file. It returns
// a TestContext which can be used to retrieve the generated modules via
// ModuleForTests.