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

Commit fe13786c authored by Spandan Das's avatar Spandan Das
Browse files

Delete filegroup test for mixed builds

Mixed builds are no longer supported.

Change-Id: Ib6f8776d60a39acafac49a62040cda5b37d95608
Test: presubmits
parent 0ff28b68
Loading
Loading
Loading
Loading
+0 −46
Original line number Diff line number Diff line
package android

import (
	"path/filepath"
	"testing"
)

func TestFileGroupWithPathProp(t *testing.T) {
	// TODO(b/247782695), TODO(b/242847534) Fix mixed builds for filegroups
	t.Skip("Re-enable once filegroups are corrected for mixed builds")
	outBaseDir := "outputbase"
	pathPrefix := outBaseDir + "/execroot/__main__"
	expectedOutputfile := filepath.Join(pathPrefix, "a/b/c/d/test.aidl")

	testCases := []struct {
		bp  string
		rel string
	}{
		{
			bp: `
	filegroup {
		name: "baz",
		srcs: ["a/b/c/d/test.aidl"],
		path: "a/b",
		bazel_module: { label: "//:baz" },
	}
`,
			rel: "c/d/test.aidl",
		},
		{
			bp: `
	filegroup {
		name: "baz",
		srcs: ["a/b/c/d/test.aidl"],
		bazel_module: { label: "//:baz" },
	}
`,
			rel: "a/b/c/d/test.aidl",
		},
	}

	for _, testCase := range testCases {
		result := GroupFixturePreparers(
			PrepareForTestWithFilegroup,
		).RunTestWithBp(t, testCase.bp)

		fg := result.Module("baz", "").(*fileGroup)
		AssertStringEquals(t, "src relativeRoot", testCase.rel, fg.srcs[0].Rel())
		AssertStringEquals(t, "src full path", expectedOutputfile, fg.srcs[0].String())
	}
}

func TestFilegroupDefaults(t *testing.T) {
	bp := FixtureAddTextFile("p/Android.bp", `
		filegroup_defaults {