cc_test modules can use data_libs to put shared libraries alongside
the test. Add $ORIGIN to rpath so they can load them as DT_NEEDED
libraries or with dlopen.
Test: treehugger
Change-Id: I4227d16ff80e70dfecb481a2de6dd15af66348bc
UseVndk is a function to check if the module can use VNDK libraries, but
this function was also used to check if the module is installed in the
treblelized partition (vendor or product). As of VNDK deprecation,
UseVndk funtion will return false even when the module is installed in
vendor / product partition, so we need a separated function to check
this. This change introduces a new function 'InVendorOrProduct' which
replaces UseVndk based on its usage.
Bug: 316829758
Test: m nothing --no-skip-soong-tests passed
Change-Id: Ic61fcd16c4554c355f6005894a4519b044b27fe5
LOCAL_STATIC_LIBRARIES, LOCAL_WHOLE_STATIC_LIBRARIES,
and LOCAL_HEADER_LIBRARIES are only exported to Make
so that it can generate module-info.json. Export
ModuleInfoJSONProvider from cc modules so that Soong can
generate the module-info.json entries, and remove the
properties from the generated Android.mk. This will prevent
Kati reanalysis when making some Android.bp changes.
Bug: 309006256
Test: Compare module-info.json
Test: Compare Kati's build.ninja
Change-Id: I6660f6802b9cea46eed553cac12f09a373eeb019
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.
Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
To generate module-info.json in Soong for b/309006256 Soong needs to
know the test data paths. Moving test data installation into Soong will
also help later for test suite packaging.
Add ModuleContext.InstallTestData that installs the files listed in a
[]DataPath alongside the test. The files will also be passed to Make
to allow it to continue packaging them into the test suites for now.
Update the module types that are producing LOCAL_TEST_DATA entries
in their Android.mk files to go through InstallTestData instead.
Bug: 311428265
Test: atest --host toybox-gtests --test-timeout=120000
Change-Id: Ia8b964f86e584ea464667fd86a48d754d118bead
This Cl sets testModule field to True in cc.NewTest(). This will cover "cc_test", "cc_test_host" and "art_cc_test".
Change-Id: I4a8db86835b195db34fd9f86560e7bf9321fbd7d
Provider added for the following test modules in this change: art_cc_test, cc_benchmark, cc_fuzz, cc_test, cc_test_host, rust_test,and rust_test_host.
Bug: 296873595
Test: Manual test
Change-Id: I815680529bcbecacb3a2bdb8f3746053afdee48c
This reverts commit 80b54d2502.
Reason for revert: caused hello_world_test to not be converted, but it's a test that builds/passes
Bug: 300117121
Change-Id: I805cfb336b7f58a5a1e295cade16be4c471e2ed5
This is the bulk of the "allowlist v2" feature. It will disable bp2build
generation for modules which have transitive dependencies without a
bazel build definition.
This CL includes this mutator, but doesn't register it as a bp2build
mutator (outside of a few unit tests). This allows us to easily iterate
on completion of this feature and ensure there are no launch blockers
before we finalize the change in AOSP.
Bug: 285631638
Test: Unit tests
Change-Id: Ifb0a079c409ca19b02cafa3fab2efa0d3deebc50
This no-op refactoring facilitates some upcoming functional changes for
"bp2build allowlist v2". The work requires that the bp2build conversion
mutator be changed from a TopDown mutator to a BottomUp mutator.
Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext
makes it easier to make this functional change without touching tens of
files and multiple projects.
Bug: 285631638
Test: m bp2build
Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
There are three types of tests, deviceless tests, device-driven tests
and host-driven device tests. But currently we don't have information
to get the type of a test and can't generate test targets on desired
types.
Test: b test //platform_testing/tests/example/native:hello_world_test
Test: b test //packages/modules/adb:adbd_test
Bug: 296312548
Change-Id: I3f022ef769636d508e055477623a4d1a6a1d9044
cc_test bazel macro will default `gtest` to True (similar to Soong). So
we can skip explicitly setting this in the generated BUILD files. The
benefit will be that it will make the generated files less verbose,
without loss of information.
This will be implemented by changing its datatype to *bool from bool.
Test: go test ./bp2build
Test: TH
Change-Id: I284e10f1d58c8e7893b170209827f7d5084ca95e
This property implicitly adds `libgtest_isolated_main` to the static
libs of the test. bp2build will make this and `liblog` explicit in BUILD
files
Since the deps are made explicit in BUILD files, `isolated` becomes a
no-op for cc_test. Remove this property from cc_test.
Test: unit tests
Bug: 244432609
Change-Id: I189a7b6b62d9064f4b2abad49ac4975468046498
Soong defaults to false, while bp2build defaults to true. This CL fixes
bp2build's default to false to match Soong.
To prevent future differences, bp2build now uses the `isolated()`
function used by Soong. The type of the context object has been changed
to EarlyModuleContext so that the ctx object does not depend on
mutations that might not run in bp2build.
Test: TH
Bug: 244432609
Change-Id: I15346107896312961e8d12270cf2f9a2a48827e1
To support `b test //path/to:my_test` command line, the actual
executable in the cc_test macro now has the __tf_internal suffix in its
name, so that the top level test suite target can be named without any suffixes.
See other CLs in this topic for more info.
Test: presubmits
Fixes: 292159775
Change-Id: I2d0bfc4276717ae881f6f3eb6aefa88bb47f25da
This is currently implicitly added by the cc_test macro. This can cause
duplicate issues if users write a BUILD file as
```
cc_test (
name = "mytest",
deps = ["libgtest"],
)
```
Making this dep explicit in BUILD files prevents this issue.
The property `gtest` will not be removed as part of this CL. cc_test
macro will use this property to add some gtest specific copts
Test: unit tests
Bug: 249374572
Change-Id: Ife931e26367fd4aab302bedc709cf907e2c01245
Previously in mixed builds, only the tidy files for the boundary module
were built, whereas all of its transitive dependencies' tidy files were
not being built. Instead we should export the list of transitive tidy
files for a module so that we can run clang-tidy for the boundary module
as well as its dependencies.
Bug: 195029134
Test: WITH_TIDY=1 DISABLE_ARTIFACT_PATH_REQUIREMENTS=true mss tidy-packages-modules-NeuralNetworks --bazel-mode-dev
Change-Id: I463646d2ae1fc4aa075a54c264e1c34571c3fd5c
Rust and cc binaries currently use $ORIGIN/lib64:$ORIGIN/../lib64 as the
rpath, and cc tests add $ORIGIN/../../lib64:$ORIGIN/../../../$ORIGIN:$ORIGIN.
This causes problems when a binary is included as test data in
out/host/linux-x86/testcases/<test dir>/<CPU>/<test>, as the
binaries can't find the libraries in out/host/linux-x86/lib64.
Use the same rpath for test and binaries, and for cc and rust.
Bug: 264604160
Test: m USE_HOST_MUSL=true out/host/linux-x86/testcases/acpi_tables_test_src_lib/x86_64/acpi_tables_test_src_lib && out/host/linux-x86/testcases/acpi_tables_test_src_lib/x86_64/acpi_tables_test_src_lib
Test: m USE_HOST_MUSL=true out/host/linux-x86/testcases/gen_sdk_test/x86_64/gen_sdk_test && out/host/linux-x86/testcases/gen_sdk_test/x86_64/toybox
Change-Id: I10fe5dc0de01d1f3c6aea8dbabbf60edab5989c3
Some tests need to add custom tradefed options, but still want to
keep most of the soong autogenerated tradefed xml file.
Expose a test_options: { tradefed_options: [...] } property that
will allow tests to add more options to the autogenerated xml file.
Fixes: 184895128
Test: go test, and verified that the ninja files did not change for aosp_arm64
Change-Id: I50d4ad139322e9e207202f1e1a50f5bbb424aa6f
This reverts commit 8ec823cba1.
Reason for revert: DroidMonitor: Potential culprit for Bug b/262965953 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Change-Id: I236cc36981d8b30527ca286632727f8ca267e969
The BUILD file will now have the needed attributes to run the tradefed
test rules.
Test: b test //packages/modules/adb:adbd_test --platforms=//build/bazel/platforms:android_target
Change-Id: I5cb84ccdde27a7fadbef479269df594344a29187
This will allow the test_suites_{arm64, x86_64} CI targets on
git_master-bazel to build adbd_test with bazel in `m`.
This is currently implemented similar to the cc_binary handler to
hydrate the output path field.
The tradefed config is still currently handled by Soong in
testBinary#install, which is called from both ProcessBazelQueryResponse
and GenerateAndroidBuildActions. We'll move the tradefed config path to
a mixed builds handler when it's ready on the cc_test bazel rule side.
Tested with `atest` with cuttlefish. Since `atest` doesn't have a way to pass
--bazel-mode-staging to its internal call to Soong, so I manually tested
this by adding adbt_test to the prod allowlist, and confirmed that the
installed adbd_test is the same binary as the one in bazel-out.
Test: $ showcommands adbd_test | grep bazel-out | tail -n1
```
/bin/bash -c "rm -f
out/target/product/vsoc_x86_64/data/nativetest64/adbd_test/adbd_test &&
cp -f -d
out/bazel/output/execroot/__main__/bazel-out/android_x86_64_silvermont-opt-ST-59d4124ca041/bin/packages/modules/adb/adbd_test
out/target/product/vsoc_x86_64/data/nativetest64/adbd_test/adbd_test"
```
Test: Add adbd_test to prod allowlist and run 'lunch aosp_cf_x86_64_phone-userdebug; atest adbd_test', all tests pass.
Bug: 258426425
Bug: 261692372
Change-Id: I6be329f39d607af8daa1dc772b23e8dd0247418c
Some tests need to add custom tradefed options, but still want to
keep most of the soong autogenerated tradefed xml file.
Expose a test_options: { tradefed_options: [...] } property that
will allow tests to add more options to the autogenerated xml file.
Fixes: 184895128
Test: go test, and verified that the ninja files did not change for aosp_arm64
Change-Id: I75f7eb002c8325ce7cdc76e12e76e16195320620
zeek@ has been tagging unit tests that cannot run on RBE with
"no-remote". While we don't yet have RBE support with standalone `b
test` yet, we can make sure to propagate the tags now.
Bug: 236973602
Test: new unit test
Change-Id: I6d0648f184626bb01c657068804f99ffb82907a3
Multiple modules (e.g. java, cc, python, rust) define the `test_options`
field. Extract the common properties in test_options to share across
different test rules.
Bug: 240928948
Test: `refreshmod` and diff with original module-info.json
Change-Id: I404a7a157b4ccaa53d800ee2217559ff695bd825
This change sets everything up to do this, but does not actually
enable it. jdesprez will follow up by making a one line change
that actually turns the default to true when he does test
debugging/verification.
Bug: 178498003
Test: build. Relying on @jdesprez for the rest of the verification
Change-Id: I3b1b6b57279dd4f9f7fc559e2d3ad76911b045e8
Some cc_test_library modules will need to be installed for
compatibility test. This CL adds the capacity to use the
test_suites property to enable this behavior.
Fixes: 226402757
Test: Wrote unit tests, confirmed installation to proper dirs,
and verified conversion that necessitated this change
Change-Id: I7313d4927d28aacad9e444962fd2a7efc6c3bc1f
Each conversion required defining a separate mutator, which will each
operate on _all_ modules and requires each to repeat checks whether the
mutator should operator. Instead, we introduce a single mutator and
modules can define a ConvertWithBp2build to implement bp2build
conversion for that module.
Test: bp2build.sh
Bug: 183079158
Change-Id: I99d4b51f441c2903879092c5b56313d606d4338d
Allows defining data binaries and libraries that should be installed
alongside a rust_test module, similar to cc_test.
This refactors cc_test as well so it can define rust_ffi_shared and
rust_binary modules as data.
Bug: 171710847
Test: New Soong tests pass.
Test: Example module installs data appropriately.
Change-Id: I0b56098fb475ec54f9b7a761220d260fe68cbee1
data_bins is similar to data_libs but copies helper binaries alongside
the test.
Bug: 200872604
Test: atest CtsBionicTestCases
Change-Id: I4f9df5f82816cfd30a0a19808fda220cf77c50a7
There are cases where two modules try to install the same test data
into CTS, which results in collisions when CTS puts the data for all
tests in the same directory. Add a flag that allows enabling a
per-testcase directory for an individual test for all test suites.
Bug: 193168159
Test: cts-tradefed run commandAndExit CtsBionicTestCases
Change-Id: If034723e8fe937ca71d3e2d39b7d46702e41bc8c
Revert submission 1826231-native-test-path
Reason for revert: b/199996863
Bug: 199996863
Reverted Changes:
Ic106011a7:update build rules to use /data/local/tests/unrest...
Id727355ec:update build rules to use /data/local/tests/unrest...
Change-Id: Id53334a6169e58964ef86e78de738f29b32dd491
... for native tests. This new location has the appropriate
settings for debuggerd to generate valid backtraces in case
of test binary crash.
Bug: 167308193
Bug: 199904562
Test: compile
Change-Id: Ic106011a79f0aec86896b305616cf5590ab2eb2d
test_options in cc_test can have vsr_min_shipping_api_level to define
the minimum shipping api level that checks vendor api level in
addition to the device shipping api level. It can be used for the
tests that have dependency on the vendor api level.
vsr stands for the vendor software requirements.
Bug: 181284704
Test: manual test
Change-Id: I7f2cecd2818d35d86f7c08cb220e0c9db71fe0a8