Revert "deletion of clang_cflags & clang_asflags from Soong"
Revert submission 2154033-delete clang_cflags clang_asflags Reason for revert: Broke build on git_tm-dev-plus-aosp and downstream branches Reverted Changes: I5c499a37e:Default BuildBrokenClangCFlags & BuildBrokenClang... Ic1d90b72d:deletion of clang_cflags & clang_asflags from Soon... Change-Id: Ic55dd85a824cf1a543249e0b00072b8c08a475b8
This commit is contained in:
@@ -4386,93 +4386,3 @@ func TestCcBuildBrokenClangProperty(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestCcBuildBrokenClangAsFlags(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
clangAsFlags []string
|
||||
BuildBrokenClangAsFlags bool
|
||||
err string
|
||||
}{
|
||||
{
|
||||
name: "error when clang_asflags is set",
|
||||
clangAsFlags: []string{"-a", "-b"},
|
||||
err: "clang_asflags: property is deprecated",
|
||||
},
|
||||
{
|
||||
name: "no error when BuildBrokenClangAsFlags is explicitly set to true",
|
||||
clangAsFlags: []string{"-a", "-b"},
|
||||
BuildBrokenClangAsFlags: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
bp := fmt.Sprintf(`
|
||||
cc_library {
|
||||
name: "foo",
|
||||
clang_asflags: %s,
|
||||
}`, `["`+strings.Join(test.clangAsFlags, `","`)+`"]`)
|
||||
|
||||
if test.err == "" {
|
||||
android.GroupFixturePreparers(
|
||||
prepareForCcTest,
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
if test.BuildBrokenClangAsFlags {
|
||||
variables.BuildBrokenClangAsFlags = test.BuildBrokenClangAsFlags
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, bp)
|
||||
} else {
|
||||
prepareForCcTest.
|
||||
ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern(test.err)).
|
||||
RunTestWithBp(t, bp)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestCcBuildBrokenClangCFlags(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
clangCFlags []string
|
||||
BuildBrokenClangCFlags bool
|
||||
err string
|
||||
}{
|
||||
{
|
||||
name: "error when clang_cflags is set",
|
||||
clangCFlags: []string{"-a", "-b"},
|
||||
err: "clang_cflags: property is deprecated",
|
||||
},
|
||||
{
|
||||
name: "no error when BuildBrokenClangCFlags is explicitly set to true",
|
||||
clangCFlags: []string{"-a", "-b"},
|
||||
BuildBrokenClangCFlags: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
bp := fmt.Sprintf(`
|
||||
cc_library {
|
||||
name: "foo",
|
||||
clang_cflags: %s,
|
||||
}`, `["`+strings.Join(test.clangCFlags, `","`)+`"]`)
|
||||
|
||||
if test.err == "" {
|
||||
android.GroupFixturePreparers(
|
||||
prepareForCcTest,
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
if test.BuildBrokenClangCFlags {
|
||||
variables.BuildBrokenClangCFlags = test.BuildBrokenClangCFlags
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, bp)
|
||||
} else {
|
||||
prepareForCcTest.
|
||||
ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern(test.err)).
|
||||
RunTestWithBp(t, bp)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user