Convert fuchsia tests to use test fixtures

Bug: 181070625
Test: m nothing
Change-Id: Ic2b86f7c603ff1c4b48884cb58908db536d98f37
This commit is contained in:
Paul Duffin
2021-02-24 19:18:42 +00:00
parent a55aefd57b
commit ecdac8a6d6
3 changed files with 22 additions and 21 deletions

View File

@@ -181,13 +181,12 @@ func TestFuchsiaDeps(t *testing.T) {
},
}`
config := TestConfig(buildDir, android.Fuchsia, nil, bp, nil)
ctx := testCcWithConfig(t, config)
result := ccFixtureFactory.Extend(PrepareForTestOnFuchsia).RunTestWithBp(t, bp)
rt := false
fb := false
ld := ctx.ModuleForTests("libTest", "fuchsia_arm64_shared").Rule("ld")
ld := result.ModuleForTests("libTest", "fuchsia_arm64_shared").Rule("ld")
implicits := ld.Implicits
for _, lib := range implicits {
if strings.Contains(lib.Rel(), "libcompiler_rt") {
@@ -218,16 +217,13 @@ func TestFuchsiaTargetDecl(t *testing.T) {
},
}`
config := TestConfig(buildDir, android.Fuchsia, nil, bp, nil)
ctx := testCcWithConfig(t, config)
ld := ctx.ModuleForTests("libTest", "fuchsia_arm64_shared").Rule("ld")
result := ccFixtureFactory.Extend(PrepareForTestOnFuchsia).RunTestWithBp(t, bp)
ld := result.ModuleForTests("libTest", "fuchsia_arm64_shared").Rule("ld")
var objs []string
for _, o := range ld.Inputs {
objs = append(objs, o.Base())
}
if len(objs) != 2 || objs[0] != "foo.o" || objs[1] != "bar.o" {
t.Errorf("inputs of libTest must be []string{\"foo.o\", \"bar.o\"}, but was %#v.", objs)
}
result.AssertArrayString("libTest inputs", []string{"foo.o", "bar.o"}, objs)
}
func TestVendorSrc(t *testing.T) {