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

Commit ebdc20f5 authored by Jingwen Chen's avatar Jingwen Chen
Browse files

Use CommonAttributes.Data for cc_test.data.

data is a common attr like name, so avoid redefining it in testBinaryAttrs.

Test: presubmits
Change-Id: Ia694b94620dfad6b8411e5a1b6c530843983ca01
parent 6faa1615
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -643,7 +643,6 @@ type testBinaryAttributes struct {

	Gtest    bool
	Isolated bool
	Data     bazel.LabelListAttribute
}

// testBinaryBp2build is the bp2build converter for cc_test modules. A cc_test's
@@ -659,6 +658,8 @@ func testBinaryBp2build(ctx android.TopDownMutatorContext, m *Module) {
	var testBinaryAttrs testBinaryAttributes
	testBinaryAttrs.binaryAttributes = binaryBp2buildAttrs(ctx, m)

	var data bazel.LabelListAttribute

	testBinaryProps := m.GetArchVariantProperties(ctx, &TestBinaryProperties{})
	for axis, configToProps := range testBinaryProps {
		for config, props := range configToProps {
@@ -668,7 +669,7 @@ func testBinaryBp2build(ctx android.TopDownMutatorContext, m *Module) {
				combinedData.Append(android.BazelLabelForModuleSrc(ctx, p.Data))
				combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_bins))
				combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_libs))
				testBinaryAttrs.Data.SetSelectValue(axis, config, combinedData)
				data.SetSelectValue(axis, config, combinedData)
			}
		}
	}
@@ -686,6 +687,9 @@ func testBinaryBp2build(ctx android.TopDownMutatorContext, m *Module) {
			Rule_class:        "cc_test",
			Bzl_load_location: "//build/bazel/rules/cc:cc_test.bzl",
		},
		android.CommonAttributes{Name: m.Name()},
		android.CommonAttributes{
			Name: m.Name(),
			Data: data,
		},
		&testBinaryAttrs)
}