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

Commit 2b11ced7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I4a044e86,Ibf8b0feb,I2e1d7ac7,Icc61f2c3 into main

* changes:
  Remove sort from mergeApexVariations
  Support reading Providers from TransitionMutator IncomingTransition and OutgoingTransition
  Set DebugMutators and DebugVariations when creating Transition variations
  Fix more tests when ANDROID_BUILD_TOP is set
parents 76e05c8c 9132ced4
Loading
Loading
Loading
Loading
+14 −18
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@ package android


import (
import (
	"fmt"
	"fmt"
	"slices"
	"sort"
	"sort"
	"strconv"
	"strconv"
	"strings"
	"strings"
@@ -108,7 +109,7 @@ func (i ApexInfo) AddJSONData(d *map[string]interface{}) {
// are configured to have the same alias variation named apex29. Whether platform APIs is allowed
// are configured to have the same alias variation named apex29. Whether platform APIs is allowed
// or not also matters; if two APEXes don't have the same allowance, they get different names and
// or not also matters; if two APEXes don't have the same allowance, they get different names and
// thus wouldn't be merged.
// thus wouldn't be merged.
func (i ApexInfo) mergedName(ctx PathContext) string {
func (i ApexInfo) mergedName() string {
	name := "apex" + strconv.Itoa(i.MinSdkVersion.FinalOrFutureInt())
	name := "apex" + strconv.Itoa(i.MinSdkVersion.FinalOrFutureInt())
	return name
	return name
}
}
@@ -543,17 +544,10 @@ func AvailableToSameApexes(mod1, mod2 ApexModule) bool {
	return true
	return true
}
}


type byApexName []ApexInfo

func (a byApexName) Len() int           { return len(a) }
func (a byApexName) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a byApexName) Less(i, j int) bool { return a[i].ApexVariationName < a[j].ApexVariationName }

// mergeApexVariations deduplicates apex variations that would build identically into a common
// mergeApexVariations deduplicates apex variations that would build identically into a common
// variation. It returns the reduced list of variations and a list of aliases from the original
// variation. It returns the reduced list of variations and a list of aliases from the original
// variation names to the new variation names.
// variation names to the new variation names.
func mergeApexVariations(ctx PathContext, apexInfos []ApexInfo) (merged []ApexInfo, aliases [][2]string) {
func mergeApexVariations(apexInfos []ApexInfo) (merged []ApexInfo, aliases [][2]string) {
	sort.Sort(byApexName(apexInfos))
	seen := make(map[string]int)
	seen := make(map[string]int)
	for _, apexInfo := range apexInfos {
	for _, apexInfo := range apexInfos {
		// If this is for a prebuilt apex then use the actual name of the apex variation to prevent this
		// If this is for a prebuilt apex then use the actual name of the apex variation to prevent this
@@ -567,7 +561,7 @@ func mergeApexVariations(ctx PathContext, apexInfos []ApexInfo) (merged []ApexIn
		// this one into it, otherwise create a new merged ApexInfo from this one and save it away so
		// this one into it, otherwise create a new merged ApexInfo from this one and save it away so
		// other ApexInfo instances can be merged into it.
		// other ApexInfo instances can be merged into it.
		variantName := apexInfo.ApexVariationName
		variantName := apexInfo.ApexVariationName
		mergedName := apexInfo.mergedName(ctx)
		mergedName := apexInfo.mergedName()
		if index, exists := seen[mergedName]; exists {
		if index, exists := seen[mergedName]; exists {
			// Variants having the same mergedName are deduped
			// Variants having the same mergedName are deduped
			merged[index].InApexVariants = append(merged[index].InApexVariants, variantName)
			merged[index].InApexVariants = append(merged[index].InApexVariants, variantName)
@@ -606,18 +600,20 @@ func CreateApexVariations(mctx BottomUpMutatorContext, module ApexModule) []Modu
	// TODO(jiyong): is this the right place?
	// TODO(jiyong): is this the right place?
	base.checkApexAvailableProperty(mctx)
	base.checkApexAvailableProperty(mctx)


	var apexInfos []ApexInfo
	apexInfos := base.apexInfos
	var aliases [][2]string
	if !mctx.Module().(ApexModule).UniqueApexVariations() && !base.ApexProperties.UniqueApexVariationsForDeps {
		apexInfos, aliases = mergeApexVariations(mctx, base.apexInfos)
	} else {
		apexInfos = base.apexInfos
	}
	// base.apexInfos is only needed to propagate the list of apexes from apexInfoMutator to
	// base.apexInfos is only needed to propagate the list of apexes from apexInfoMutator to
	// apexMutator. It is no longer accurate after mergeApexVariations, and won't be copied to
	// apexMutator. It is no longer accurate after mergeApexVariations, and won't be copied to
	// all but the first created variant. Clear it so it doesn't accidentally get used later.
	// all but the first created variant. Clear it so it doesn't accidentally get used later.
	base.apexInfos = nil
	base.apexInfos = nil
	sort.Sort(byApexName(apexInfos))

	slices.SortFunc(apexInfos, func(a, b ApexInfo) int {
		return strings.Compare(a.ApexVariationName, b.ApexVariationName)
	})

	var aliases [][2]string
	if !mctx.Module().(ApexModule).UniqueApexVariations() && !base.ApexProperties.UniqueApexVariationsForDeps {
		apexInfos, aliases = mergeApexVariations(apexInfos)
	}


	var inApex ApexMembership
	var inApex ApexMembership
	for _, a := range apexInfos {
	for _, a := range apexInfos {
+177 −32
Original line number Original line Diff line number Diff line
@@ -33,10 +33,22 @@ func Test_mergeApexVariations(t *testing.T) {
		{
		{
			name: "single",
			name: "single",
			in: []ApexInfo{
			in: []ApexInfo{
				{"foo", FutureApiLevel, false, false, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex, nil},
				{
					ApexVariationName: "foo",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"foo"},
					InApexModules:     []string{"foo"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantMerged: []ApexInfo{
			wantMerged: []ApexInfo{
				{"apex10000", FutureApiLevel, false, false, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex, nil},
				{
					ApexVariationName: "apex10000",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"foo"},
					InApexModules:     []string{"foo"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantAliases: [][2]string{
			wantAliases: [][2]string{
				{"foo", "apex10000"},
				{"foo", "apex10000"},
@@ -45,98 +57,231 @@ func Test_mergeApexVariations(t *testing.T) {
		{
		{
			name: "merge",
			name: "merge",
			in: []ApexInfo{
			in: []ApexInfo{
				{"foo", FutureApiLevel, false, false, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex, nil},
				{
				{"bar", FutureApiLevel, false, false, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex, nil},
					ApexVariationName: "foo",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"foo"},
					InApexModules:     []string{"foo"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
				{
					ApexVariationName: "bar",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"bar"},
					InApexModules:     []string{"bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantMerged: []ApexInfo{
			wantMerged: []ApexInfo{
				{"apex10000", FutureApiLevel, false, false, []string{"bar", "foo"}, []string{"bar", "foo"}, nil, false, nil}},
				{
					ApexVariationName: "apex10000",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"foo", "bar"},
					InApexModules:     []string{"foo", "bar"},
				}},
			wantAliases: [][2]string{
			wantAliases: [][2]string{
				{"bar", "apex10000"},
				{"foo", "apex10000"},
				{"foo", "apex10000"},
				{"bar", "apex10000"},
			},
			},
		},
		},
		{
		{
			name: "don't merge version",
			name: "don't merge version",
			in: []ApexInfo{
			in: []ApexInfo{
				{"foo", FutureApiLevel, false, false, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex, nil},
				{
				{"bar", uncheckedFinalApiLevel(30), false, false, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex, nil},
					ApexVariationName: "foo",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"foo"},
					InApexModules:     []string{"foo"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
				{
					ApexVariationName: "bar",
					MinSdkVersion:     uncheckedFinalApiLevel(30),
					InApexVariants:    []string{"bar"},
					InApexModules:     []string{"bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantMerged: []ApexInfo{
			wantMerged: []ApexInfo{
				{"apex30", uncheckedFinalApiLevel(30), false, false, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex, nil},
				{
				{"apex10000", FutureApiLevel, false, false, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex, nil},
					ApexVariationName: "apex10000",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"foo"},
					InApexModules:     []string{"foo"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
				{
					ApexVariationName: "apex30",
					MinSdkVersion:     uncheckedFinalApiLevel(30),
					InApexVariants:    []string{"bar"},
					InApexModules:     []string{"bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantAliases: [][2]string{
			wantAliases: [][2]string{
				{"bar", "apex30"},
				{"foo", "apex10000"},
				{"foo", "apex10000"},
				{"bar", "apex30"},
			},
			},
		},
		},
		{
		{
			name: "merge updatable",
			name: "merge updatable",
			in: []ApexInfo{
			in: []ApexInfo{
				{"foo", FutureApiLevel, false, false, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex, nil},
				{
				{"bar", FutureApiLevel, true, false, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex, nil},
					ApexVariationName: "foo",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"foo"},
					InApexModules:     []string{"foo"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
				{
					ApexVariationName: "bar",
					MinSdkVersion:     FutureApiLevel,
					Updatable:         true,
					InApexVariants:    []string{"bar"},
					InApexModules:     []string{"bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantMerged: []ApexInfo{
			wantMerged: []ApexInfo{
				{"apex10000", FutureApiLevel, true, false, []string{"bar", "foo"}, []string{"bar", "foo"}, nil, NotForPrebuiltApex, nil},
				{
					ApexVariationName: "apex10000",
					MinSdkVersion:     FutureApiLevel,
					Updatable:         true,
					InApexVariants:    []string{"foo", "bar"},
					InApexModules:     []string{"foo", "bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantAliases: [][2]string{
			wantAliases: [][2]string{
				{"bar", "apex10000"},
				{"foo", "apex10000"},
				{"foo", "apex10000"},
				{"bar", "apex10000"},
			},
			},
		},
		},
		{
		{
			name: "don't merge when for prebuilt_apex",
			name: "don't merge when for prebuilt_apex",
			in: []ApexInfo{
			in: []ApexInfo{
				{"foo", FutureApiLevel, false, false, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex, nil},
				{
				{"bar", FutureApiLevel, true, false, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex, nil},
					ApexVariationName: "foo",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"foo"},
					InApexModules:     []string{"foo"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
				{
					ApexVariationName: "bar",
					MinSdkVersion:     FutureApiLevel,
					Updatable:         true,
					InApexVariants:    []string{"bar"},
					InApexModules:     []string{"bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
				// This one should not be merged in with the others because it is for
				// This one should not be merged in with the others because it is for
				// a prebuilt_apex.
				// a prebuilt_apex.
				{"baz", FutureApiLevel, true, false, []string{"baz"}, []string{"baz"}, nil, ForPrebuiltApex, nil},
				{
					ApexVariationName: "baz",
					MinSdkVersion:     FutureApiLevel,
					Updatable:         true,
					InApexVariants:    []string{"baz"},
					InApexModules:     []string{"baz"},
					ForPrebuiltApex:   ForPrebuiltApex,
				},
			},
			},
			wantMerged: []ApexInfo{
			wantMerged: []ApexInfo{
				{"apex10000", FutureApiLevel, true, false, []string{"bar", "foo"}, []string{"bar", "foo"}, nil, NotForPrebuiltApex, nil},
				{
				{"baz", FutureApiLevel, true, false, []string{"baz"}, []string{"baz"}, nil, ForPrebuiltApex, nil},
					ApexVariationName: "apex10000",
					MinSdkVersion:     FutureApiLevel,
					Updatable:         true,
					InApexVariants:    []string{"foo", "bar"},
					InApexModules:     []string{"foo", "bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
				{
					ApexVariationName: "baz",
					MinSdkVersion:     FutureApiLevel,
					Updatable:         true,
					InApexVariants:    []string{"baz"},
					InApexModules:     []string{"baz"},
					ForPrebuiltApex:   ForPrebuiltApex,
				},
			},
			},
			wantAliases: [][2]string{
			wantAliases: [][2]string{
				{"bar", "apex10000"},
				{"foo", "apex10000"},
				{"foo", "apex10000"},
				{"bar", "apex10000"},
			},
			},
		},
		},
		{
		{
			name: "merge different UsePlatformApis but don't allow using platform api",
			name: "merge different UsePlatformApis but don't allow using platform api",
			in: []ApexInfo{
			in: []ApexInfo{
				{"foo", FutureApiLevel, false, false, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex, nil},
				{
				{"bar", FutureApiLevel, false, true, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex, nil},
					ApexVariationName: "foo",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"foo"},
					InApexModules:     []string{"foo"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
				{
					ApexVariationName: "bar",
					MinSdkVersion:     FutureApiLevel,
					UsePlatformApis:   true,
					InApexVariants:    []string{"bar"},
					InApexModules:     []string{"bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantMerged: []ApexInfo{
			wantMerged: []ApexInfo{
				{"apex10000", FutureApiLevel, false, false, []string{"bar", "foo"}, []string{"bar", "foo"}, nil, NotForPrebuiltApex, nil},
				{
					ApexVariationName: "apex10000",
					MinSdkVersion:     FutureApiLevel,
					InApexVariants:    []string{"foo", "bar"},
					InApexModules:     []string{"foo", "bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantAliases: [][2]string{
			wantAliases: [][2]string{
				{"bar", "apex10000"},
				{"foo", "apex10000"},
				{"foo", "apex10000"},
				{"bar", "apex10000"},
			},
			},
		},
		},
		{
		{
			name: "merge same UsePlatformApis and allow using platform api",
			name: "merge same UsePlatformApis and allow using platform api",
			in: []ApexInfo{
			in: []ApexInfo{
				{"foo", FutureApiLevel, false, true, []string{"foo"}, []string{"foo"}, nil, NotForPrebuiltApex, nil},
				{
				{"bar", FutureApiLevel, false, true, []string{"bar"}, []string{"bar"}, nil, NotForPrebuiltApex, nil},
					ApexVariationName: "foo",
					MinSdkVersion:     FutureApiLevel,
					UsePlatformApis:   true,
					InApexVariants:    []string{"foo"},
					InApexModules:     []string{"foo"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
				{
					ApexVariationName: "bar",
					MinSdkVersion:     FutureApiLevel,
					UsePlatformApis:   true,
					InApexVariants:    []string{"bar"},
					InApexModules:     []string{"bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantMerged: []ApexInfo{
			wantMerged: []ApexInfo{
				{"apex10000", FutureApiLevel, false, true, []string{"bar", "foo"}, []string{"bar", "foo"}, nil, NotForPrebuiltApex, nil},
				{
					ApexVariationName: "apex10000",
					MinSdkVersion:     FutureApiLevel,
					UsePlatformApis:   true,
					InApexVariants:    []string{"foo", "bar"},
					InApexModules:     []string{"foo", "bar"},
					ForPrebuiltApex:   NotForPrebuiltApex,
				},
			},
			},
			wantAliases: [][2]string{
			wantAliases: [][2]string{
				{"bar", "apex10000"},
				{"foo", "apex10000"},
				{"foo", "apex10000"},
				{"bar", "apex10000"},
			},
			},
		},
		},
	}
	}


	for _, tt := range tests {
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
		t.Run(tt.name, func(t *testing.T) {
			config := TestConfig(t.TempDir(), nil, "", nil)
			gotMerged, gotAliases := mergeApexVariations(tt.in)
			ctx := &configErrorWrapper{config: config}
			gotMerged, gotAliases := mergeApexVariations(ctx, tt.in)
			if !reflect.DeepEqual(gotMerged, tt.wantMerged) {
			if !reflect.DeepEqual(gotMerged, tt.wantMerged) {
				t.Errorf("mergeApexVariations() gotMerged = %v, want %v", gotMerged, tt.wantMerged)
				t.Errorf("mergeApexVariations() gotMerged = %v, want %v", gotMerged, tt.wantMerged)
			}
			}
+15 −0
Original line number Original line Diff line number Diff line
@@ -391,6 +391,7 @@ func (x *registerMutatorsContext) BottomUpBlueprint(name string, m blueprint.Bot


type IncomingTransitionContext interface {
type IncomingTransitionContext interface {
	ArchModuleContext
	ArchModuleContext
	ModuleProviderContext


	// Module returns the target of the dependency edge for which the transition
	// Module returns the target of the dependency edge for which the transition
	// is being computed
	// is being computed
@@ -404,6 +405,7 @@ type IncomingTransitionContext interface {


type OutgoingTransitionContext interface {
type OutgoingTransitionContext interface {
	ArchModuleContext
	ArchModuleContext
	ModuleProviderContext


	// Module returns the target of the dependency edge for which the transition
	// Module returns the target of the dependency edge for which the transition
	// is being computed
	// is being computed
@@ -505,6 +507,7 @@ type TransitionMutator interface {
type androidTransitionMutator struct {
type androidTransitionMutator struct {
	finalPhase bool
	finalPhase bool
	mutator    TransitionMutator
	mutator    TransitionMutator
	name       string
}
}


func (a *androidTransitionMutator) Split(ctx blueprint.BaseModuleContext) []string {
func (a *androidTransitionMutator) Split(ctx blueprint.BaseModuleContext) []string {
@@ -537,6 +540,10 @@ func (c *outgoingTransitionContextImpl) DeviceConfig() DeviceConfig {
	return DeviceConfig{c.bp.Config().(Config).deviceConfig}
	return DeviceConfig{c.bp.Config().(Config).deviceConfig}
}
}


func (c *outgoingTransitionContextImpl) provider(provider blueprint.AnyProviderKey) (any, bool) {
	return c.bp.Provider(provider)
}

func (a *androidTransitionMutator) OutgoingTransition(bpctx blueprint.OutgoingTransitionContext, sourceVariation string) string {
func (a *androidTransitionMutator) OutgoingTransition(bpctx blueprint.OutgoingTransitionContext, sourceVariation string) string {
	if m, ok := bpctx.Module().(Module); ok {
	if m, ok := bpctx.Module().(Module); ok {
		ctx := outgoingTransitionContextPool.Get().(*outgoingTransitionContextImpl)
		ctx := outgoingTransitionContextPool.Get().(*outgoingTransitionContextImpl)
@@ -568,6 +575,10 @@ func (c *incomingTransitionContextImpl) DeviceConfig() DeviceConfig {
	return DeviceConfig{c.bp.Config().(Config).deviceConfig}
	return DeviceConfig{c.bp.Config().(Config).deviceConfig}
}
}


func (c *incomingTransitionContextImpl) provider(provider blueprint.AnyProviderKey) (any, bool) {
	return c.bp.Provider(provider)
}

func (a *androidTransitionMutator) IncomingTransition(bpctx blueprint.IncomingTransitionContext, incomingVariation string) string {
func (a *androidTransitionMutator) IncomingTransition(bpctx blueprint.IncomingTransitionContext, incomingVariation string) string {
	if m, ok := bpctx.Module().(Module); ok {
	if m, ok := bpctx.Module().(Module); ok {
		ctx := incomingTransitionContextPool.Get().(*incomingTransitionContextImpl)
		ctx := incomingTransitionContextPool.Get().(*incomingTransitionContextImpl)
@@ -586,6 +597,9 @@ func (a *androidTransitionMutator) Mutate(ctx blueprint.BottomUpMutatorContext,
	if am, ok := ctx.Module().(Module); ok {
	if am, ok := ctx.Module().(Module); ok {
		mctx := bottomUpMutatorContextFactory(ctx, am, a.finalPhase)
		mctx := bottomUpMutatorContextFactory(ctx, am, a.finalPhase)
		defer bottomUpMutatorContextPool.Put(mctx)
		defer bottomUpMutatorContextPool.Put(mctx)
		base := am.base()
		base.commonProperties.DebugMutators = append(base.commonProperties.DebugMutators, a.name)
		base.commonProperties.DebugVariations = append(base.commonProperties.DebugVariations, variation)
		a.mutator.Mutate(mctx, variation)
		a.mutator.Mutate(mctx, variation)
	}
	}
}
}
@@ -594,6 +608,7 @@ func (x *registerMutatorsContext) Transition(name string, m TransitionMutator) {
	atm := &androidTransitionMutator{
	atm := &androidTransitionMutator{
		finalPhase: x.finalPhase,
		finalPhase: x.finalPhase,
		mutator:    m,
		mutator:    m,
		name:       name,
	}
	}
	mutator := &mutator{
	mutator := &mutator{
		name:              name,
		name:              name,
+7 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ package bpfix
import (
import (
	"bytes"
	"bytes"
	"fmt"
	"fmt"
	"os"
	"reflect"
	"reflect"
	"strings"
	"strings"
	"testing"
	"testing"
@@ -2215,3 +2216,9 @@ func TestRemoveResourceAndAssetsIfDefault(t *testing.T) {
		})
		})
	}
	}
}
}

func TestMain(m *testing.M) {
	// Skip checking Android.mk path with cleaning "ANDROID_BUILD_TOP"
	os.Setenv("ANDROID_BUILD_TOP", "")
	os.Exit(m.Run())
}
+3 −0
Original line number Original line Diff line number Diff line
@@ -54,6 +54,9 @@ cc_library_shared {
}
}


func TestEndToEnd(t *testing.T) {
func TestEndToEnd(t *testing.T) {
	// Skip checking Android.mk path with cleaning "ANDROID_BUILD_TOP"
	t.Setenv("ANDROID_BUILD_TOP", "")

	for i, test := range testCases {
	for i, test := range testCases {
		expected, err := bpfix.Reformat(test.expected)
		expected, err := bpfix.Reformat(test.expected)
		if err != nil {
		if err != nil {