Merge "Improve TestGetDistForGoals debuggability"
This commit is contained in:
@@ -104,10 +104,12 @@ func TestAndroidMkSingleton_PassesUpdatedAndroidMkDataToCustomCallback(t *testin
|
||||
|
||||
func TestGetDistForGoals(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
bp string
|
||||
expectedAndroidMkLines []string
|
||||
}{
|
||||
{
|
||||
name: "dist-without-tag",
|
||||
bp: `
|
||||
custom {
|
||||
name: "foo",
|
||||
@@ -122,6 +124,7 @@ func TestGetDistForGoals(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dist-with-tag",
|
||||
bp: `
|
||||
custom {
|
||||
name: "foo",
|
||||
@@ -137,6 +140,7 @@ func TestGetDistForGoals(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dists-with-tag",
|
||||
bp: `
|
||||
custom {
|
||||
name: "foo",
|
||||
@@ -154,6 +158,7 @@ func TestGetDistForGoals(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "multiple-dists-with-and-without-tag",
|
||||
bp: `
|
||||
custom {
|
||||
name: "foo",
|
||||
@@ -175,6 +180,7 @@ func TestGetDistForGoals(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dist-plus-dists-without-tags",
|
||||
bp: `
|
||||
custom {
|
||||
name: "foo",
|
||||
@@ -196,6 +202,7 @@ func TestGetDistForGoals(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dist-plus-dists-with-tags",
|
||||
bp: `
|
||||
custom {
|
||||
name: "foo",
|
||||
@@ -249,6 +256,7 @@ func TestGetDistForGoals(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
t.Run(testCase.name, func(t *testing.T) {
|
||||
config := TestConfig(buildDir, nil, testCase.bp, nil)
|
||||
config.katiEnabled = true // Enable androidmk Singleton
|
||||
|
||||
@@ -282,10 +290,11 @@ func TestGetDistForGoals(t *testing.T) {
|
||||
if line != expectedLine {
|
||||
t.Errorf(
|
||||
"Expected AndroidMk line to be '%s', got '%s'",
|
||||
line,
|
||||
expectedLine,
|
||||
line,
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user