Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d35d92a7 authored by Paul Duffin's avatar Paul Duffin Committed by Gerrit Code Review
Browse files

Merge "Improve TestGetDistForGoals debuggability"

parents 463ab7a2 0cc047ad
Loading
Loading
Loading
Loading
+40 −31
Original line number Diff line number Diff line
@@ -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,
					)
				}
			}
		})
	}
}