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

Commit 6e119745 authored by Jingwen Chen's avatar Jingwen Chen
Browse files

Revert "Do not convert non-unit tests."

This reverts commit 80b54d25.

Reason for revert: caused hello_world_test to not be converted, but it's a test that builds/passes

Bug: 300117121

Change-Id: I805cfb336b7f58a5a1e295cade16be4c471e2ed5
parent cbe61221
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -631,23 +631,3 @@ cc_test {
		},
	})
}

func TestCcTest_UnitTestFalse(t *testing.T) {
	runCcTestTestCase(t, ccTestBp2buildTestCase{
		description: "cc test with test_options.tags converted to tags",
		blueprint: `
cc_test {
    name: "mytest",
    host_supported: true,
    srcs: ["test.cpp"],
    test_options: { unit_test: false },
}
` + simpleModule("cc_library_static", "libgtest_main") +
			simpleModule("cc_library_static", "libgtest"),
		stubbedBuildDefinitions: []string{
			"libgtest_main",
			"libgtest",
		},
		targets: []testBazelTarget{},
	})
}
+0 −8
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import (
	"android/soong/bazel"
	"android/soong/bazel/cquery"
	"android/soong/tradefed"
	"android/soong/ui/metrics/bp2build_metrics_proto"
)

// TestLinkerProperties properties to be registered via the linker
@@ -719,13 +718,6 @@ func testBinaryBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
				combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_libs))
				data.SetSelectValue(axis, config, combinedData)
				tags.SetSelectValue(axis, config, p.Test_options.Tags)

				// TODO: b/300117121 - handle bp2build conversion of non-unit tests
				// default to true to only handle non-nil falses
				if !BoolDefault(p.Test_options.Unit_test, true) {
					ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "Host unit_test = false")
					return
				}
			}
		}
	}