Do not convert non-unit tests.
Test: CI Change-Id: Iab9c134718351187859f34a26bd3a2aa66e009d5
This commit is contained in:
parent
1c4048e08d
commit
80b54d2502
2 changed files with 28 additions and 0 deletions
|
@ -631,3 +631,23 @@ 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{},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import (
|
||||||
"android/soong/bazel"
|
"android/soong/bazel"
|
||||||
"android/soong/bazel/cquery"
|
"android/soong/bazel/cquery"
|
||||||
"android/soong/tradefed"
|
"android/soong/tradefed"
|
||||||
|
"android/soong/ui/metrics/bp2build_metrics_proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestLinkerProperties properties to be registered via the linker
|
// TestLinkerProperties properties to be registered via the linker
|
||||||
|
@ -718,6 +719,13 @@ func testBinaryBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
|
||||||
combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_libs))
|
combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_libs))
|
||||||
data.SetSelectValue(axis, config, combinedData)
|
data.SetSelectValue(axis, config, combinedData)
|
||||||
tags.SetSelectValue(axis, config, p.Test_options.Tags)
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue