platform_build_soong/cc/Android.bp
Ronald Braunstein a115e2615b Add "test-only" flag for cc modules
As part of aosp/3022586 where we added the idea of "test-only" modules
and top_level_test_targets, this CL implements that for cc_ modules.

We let users set "test-only" on cc_library, but not on other modules
where the module kind is implicitly test-only, like cc_test.
Here the implementation, not the user decides it is test-only.

% gqui from  "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.top_level_target = true group by teams.kind'                    aosp_shiba[6:15:47]/0
+--------------+----------+
|  teams.kind  | count(*) |
+--------------+----------+
| art_cc_test  |       56 |
| cc_benchmark |       68 |
| cc_fuzz      |      515 |
| cc_test      |     3518 |
| cc_test_host |        6 |
+--------------+----------+

 % gqui from  "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.test_only = true group by teams.kind'                           aosp_shiba[6:16:26]/0
+--------------------------+----------+
|        teams.kind        | count(*) |
+--------------------------+----------+
| art_cc_test              |       56 |
| art_cc_test_library      |       13 |
| cc_benchmark             |       68 |
| cc_fuzz                  |      515 |
| cc_test                  |     3518 |
| cc_test_host             |        6 |
| cc_test_library          |      484 |
+--------------------------+----------+

Bug: b/327280661

Test: m nothing --no-skip-soong-tests
Test: go test ./cc
Test: m all_teams
Change-Id: I344436c424a9dfbdcf27e10f42f5cebc3d2b1261
2024-04-12 02:15:05 +00:00

114 lines
2.4 KiB
Text

package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
bootstrap_go_package {
name: "soong-cc",
pkgPath: "android/soong/cc",
deps: [
"blueprint",
"blueprint-pathtools",
"soong",
"soong-aconfig",
"soong-aidl-library",
"soong-android",
"soong-cc-config",
"soong-etc",
"soong-fuzz",
"soong-genrule",
"soong-multitree",
"soong-testing",
"soong-tradefed",
],
srcs: [
"afdo.go",
"fdo_profile.go",
"androidmk.go",
"api_level.go",
"builder.go",
"cc.go",
"ccdeps.go",
"check.go",
"coverage.go",
"gen.go",
"generated_cc_library.go",
"image.go",
"linkable.go",
"lto.go",
"makevars.go",
"orderfile.go",
"prebuilt.go",
"proto.go",
"rs.go",
"sanitize.go",
"sabi.go",
"sdk.go",
"snapshot_prebuilt.go",
"stl.go",
"strip.go",
"tidy.go",
"util.go",
"vndk.go",
"vndk_prebuilt.go",
"cmakelists.go",
"compdb.go",
"compiler.go",
"installer.go",
"linker.go",
"binary.go",
"binary_sdk_member.go",
"fuzz.go",
"image_sdk_traits.go",
"library.go",
"library_headers.go",
"library_sdk_member.go",
"library_stub.go",
"native_bridge_sdk_trait.go",
"object.go",
"test.go",
"ndk_abi.go",
"ndk_headers.go",
"ndk_library.go",
"ndk_prebuilt.go",
"ndk_sysroot.go",
"llndk_library.go",
"kernel_headers.go",
"genrule.go",
"vendor_public_library.go",
"testing.go",
"stub_library.go",
],
testSrcs: [
"afdo_test.go",
"binary_test.go",
"cc_test.go",
"cc_test_only_property_test.go",
"compiler_test.go",
"gen_test.go",
"genrule_test.go",
"library_headers_test.go",
"library_stub_test.go",
"library_test.go",
"lto_test.go",
"ndk_test.go",
"object_test.go",
"orderfile_test.go",
"prebuilt_test.go",
"proto_test.go",
"sanitize_test.go",
"sdk_test.go",
"test_data_test.go",
"tidy_test.go",
"vendor_public_library_test.go",
],
pluginFor: ["soong_build"],
}