Add Soong test to verify runtime_deps doesn't have afdo variant
Test: go test Change-Id: If6ef4f5ee529b322a251b11ebdceca4bbcacdd63
This commit is contained in:
@@ -150,3 +150,31 @@ func TestAfdoEnabledOnStaticDepNoAfdo(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAfdoEnabledWithRuntimeDepNoAfdo(t *testing.T) {
|
||||||
|
bp := `
|
||||||
|
cc_library {
|
||||||
|
name: "libTest",
|
||||||
|
srcs: ["foo.c"],
|
||||||
|
runtime_libs: ["libFoo"],
|
||||||
|
afdo: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libFoo",
|
||||||
|
}
|
||||||
|
`
|
||||||
|
prepareForAfdoTest := android.FixtureAddTextFile("toolchain/pgo-profiles/sampling/libTest.afdo", "TEST")
|
||||||
|
|
||||||
|
result := android.GroupFixturePreparers(
|
||||||
|
prepareForCcTest,
|
||||||
|
prepareForAfdoTest,
|
||||||
|
).RunTestWithBp(t, bp)
|
||||||
|
|
||||||
|
libFooVariants := result.ModuleVariantsForTests("libFoo")
|
||||||
|
for _, v := range libFooVariants {
|
||||||
|
if strings.Contains(v, "afdo-") {
|
||||||
|
t.Errorf("Expected no afdo variant of 'foo', got %q", v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user