From 2c4ca8d73f91913792bc59958ef951a29b8f24d9 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Sun, 7 Mar 2021 19:18:38 +0000 Subject: Support test fixtures in rust package Replaces the rust specific rustTestCtx mechanism with the general test fixtures mechanism as converting it to use preparers was not possible. Also, removes usages of the buildDir variable and removes it as it is no longer needed. Bug: 181070625 Test: m nothing Change-Id: I0176a7b6fb2d390ae23693f1e198da5124b4be63 --- rust/project_json_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'rust/project_json_test.go') diff --git a/rust/project_json_test.go b/rust/project_json_test.go index 289bcb81d..8f64f56e2 100644 --- a/rust/project_json_test.go +++ b/rust/project_json_test.go @@ -27,15 +27,14 @@ import ( // testProjectJson run the generation of rust-project.json. It returns the raw // content of the generated file. func testProjectJson(t *testing.T, bp string) []byte { - tctx := newTestRustCtx(t, bp) - tctx.env = map[string]string{"SOONG_GEN_RUST_PROJECT": "1"} - tctx.generateConfig() - tctx.parse(t) + result := prepareForRustTest. + Extend(android.FixtureMergeEnv(map[string]string{"SOONG_GEN_RUST_PROJECT": "1"})). + RunTestWithBp(t, bp) // The JSON file is generated via WriteFileToOutputDir. Therefore, it // won't appear in the Output of the TestingSingleton. Manually verify // it exists. - content, err := ioutil.ReadFile(filepath.Join(buildDir, rustProjectJsonFileName)) + content, err := ioutil.ReadFile(filepath.Join(result.Config.BuildDir(), rustProjectJsonFileName)) if err != nil { t.Errorf("rust-project.json has not been generated") } -- cgit v1.2.3-59-g8ed1b