Commit graph

26 commits

Author SHA1 Message Date
Colin Cross
5c1d5fb21b Move test data installation to Soong
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
2023-11-30 13:38:49 -08:00
Makoto Onuki
1725b20d14 Support java_data in sh_test_host
Bug: 297225342
Test: with a custom test rule
Test: cd sh && go test ./...
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:de5d265a798ce0e12ad0a2d0a6675942df5cd10b)
Merged-In: Ia5a60fa6d917f2c2fde56df543625024ec11877a
Change-Id: Ia5a60fa6d917f2c2fde56df543625024ec11877a
2023-08-24 22:17:56 +00:00
Colin Cross
06c80eb851 Add builtins and minimal runtime as dependencies instead of flags
Use dependencies instead of libflags to link libclang_rt.builtins
and libclang_rt.ubsan_minimal.

Test: m checkbuild
Change-Id: I403cee0fb8cc21c347b42d8f8a3c20d6f43337a4
2022-02-10 11:50:31 -08:00
Sam Delmerico
b3342ce580 build device binary for java_test_host
This commit adds support for a java_host_test that requires a target
binary to run. If the binary has host and target variants and is added
as a dependency in the `data` attribute, then the host variant is used.
Instead, we need a way to force the use of the target variant.

Bug: 182919153
Test: add code from aosp/1647282/1 && atest AuthFsHostTest
Change-Id: I68a6259b41a5e6809e1b82eec3122ffdf5067f56
2022-01-26 19:57:27 +00:00
Colin Cross
c68db4b305 Remove InstallBypassMake and ToMakePath
InstallBypassMake and ToMakePath are obsolete, remove them.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
2021-12-15 15:22:53 -08:00
Colin Cross
0c66bc615b Replace android.BuildOs with Config.BuildOS
Replace the android.BuildOs constant with Config.BuildOS so that it
can vary based on the product config.

Bug: 190084016
Test: all Soong tests
Change-Id: Ia67f872d8b2ab788747a22e3a9659dc21c9775cd
2021-07-20 12:46:48 -07:00
Dan Shi
b40deac018 Add unit_test test option in sh_test_host
This change allows sh_test_host to be included
in host-unit-tests suite when test option `unit_test` is set to true.

Bug: 183209767
Test: m host-unit-tests
Change-Id: I5b441d5f49468cb681eb414dade8a1309c6e810a
2021-05-24 12:06:23 -07:00
Paul Duffin
89648f98fa Remove usages of FixtureFactory from misc packages
These packages have already been migrated to use per test build
directory so have no need for a FixtureFactory.

Bug: 183235980
Test: m nothing
Change-Id: I667d1d992caaf0f615de91f89efdae11c44986c2
2021-03-22 18:31:53 +00:00
Paul Duffin
32b06c2ae6 Migrate sh package to a per test build directory
Bug: 182885307
Test: m nothing
Change-Id: I8e379c555e48ab482c56a19630d83a3a54126fc5
2021-03-16 12:46:52 +00:00
Paul Duffin
56fb8ee920 Support test fixtures in sh package
Restructures the sh package test setup code to create FixturePreparer
instances for setting up a test fixture and converts some tests to
use it.

The goal with this change is not to switch all the sh tests over to
directly using the new model but instead to ensure that the majority of
the sh tests run with the new model, to allow existing tests to easily
switch to the new model when needed and to allow dependent packages to
be switched to the new model.

Bug: 181070625
Test: m nothing
Change-Id: Ib2c6ac2842d6fafde5663d3ee63c3f934913a00e
2021-03-09 23:07:22 +00:00
Lukacs T. Berki
7690c09953 cd to / before running soong_build .
This lets one avoid any decisions as to when to chdir there during its
execution and leads to better sandboxing because the pwd doesn't leak to
init() functions anymore.

Test: Manual.
Change-Id: I1560da8ed3a621249426f9e8908aa890c21e13ba
2021-03-03 09:14:22 +01:00
Colin Cross
aa2555387d Add ctx to AndroidMkExtraEntriesFunc
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.

Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2021-02-19 23:05:40 +00:00
Colin Cross
ae8600b507 Pass Config to NewTestContext instead of ctx.Register
Prepare for using Config when adding singletons by passing
Config to NewTestContext and NewContext instead of to ctx.Register.
This will enable a followup change to store SingletonMakeVarsProviders
registered on the Context in the Config, which is necessary to run
multiple tests in parallel without data races.

Test: all soong tests
Change-Id: Id229629a4e42ff4487d317241673837726c075fc
2020-11-12 10:07:49 -08:00
Colin Cross
405af07859 Revert "Make lots of tests run in parallel"
This reverts commit 323dc60712.

Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests

Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-09 18:34:24 -07:00
Colin Cross
323dc60712 Make lots of tests run in parallel
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.

Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
2020-10-06 15:12:22 -07:00
Jaewoong Jung
6e0eee522d Add data bin and lib properties to sh_test
This attempts to reland I7b64de4b06e9bba3fba3712b25dd9f9d112e1625
by fixing Mac-related test issues, yet again.

Test: sh_binary_test.go
Test: Modified ziptool-tests
Bug: 156980228
Change-Id: Id3952e136c1dabfcd34048b6c9f31d0125a623df
2020-08-18 09:25:34 -07:00
Jaewoong Jung
105699aee2 Revert "Add data bin and lib properties to sh_test"
This reverts commit a41a8877cb.

Reason for revert: Broke Darwin builds

Change-Id: I4371d735ffea51f7c349b4d223bc91c103163015
2020-08-18 15:34:45 +00:00
Jaewoong Jung
a41a8877cb Add data bin and lib properties to sh_test
This attempts to reland I7b64de4b06e9bba3fba3712b25dd9f9d112e1625
by fixing Mac-related test issues.

Test: sh_binary_test.go
Test: Modified ziptool-tests
Bug: 156980228
Change-Id: Icb7bfb183f6a1d429caefc05b0550aff292d7633
2020-08-17 10:01:41 -07:00
Jaewoong Jung
cc1bfd6aa0 Revert "Add data bin and lib properties to sh_test"
This reverts commit 91dbd520de.

Reason for revert: Fix CLs didn't completely fix the builds.

Test: sh_binary_test.go
Bug: 156980228
Bug: 164465992
Change-Id: I1ed214c2ea6cd460db909a103c4b3a9a895ad9f7
2020-08-14 18:11:23 -07:00
Jaewoong Jung
8eee3f6b58 Fix broken darwin build.
Offending change - I7b64de4b06e9bba3fba3712b25dd9f9d112e1625

This is in addition to Idebfdf1ed7d8e10ba867c8eaac01410d754c7131

Test: sh_binary_test.go
Bug: 156980228
Bug: 164465992
Change-Id: I8d01d0e82efe764cc6901bb3e2c2767c8b25d81f
2020-08-14 14:27:02 -07:00
Jaewoong Jung
181cfdf898 Fix broken darwin build.
Offending change - I7b64de4b06e9bba3fba3712b25dd9f9d112e1625

Test: sh_binary_test.go
Bug: 156980228
Fixes: 164465992
Change-Id: Idebfdf1ed7d8e10ba867c8eaac01410d754c7131
2020-08-14 18:44:23 +00:00
Jaewoong Jung
91dbd520de Add data bin and lib properties to sh_test
Test: sh_binary_test.go
Test: Modified ziptool-tests
Bug: 156980228
Change-Id: I7b64de4b06e9bba3fba3712b25dd9f9d112e1625
2020-08-13 15:36:44 -07:00
Jaewoong Jung
4aedc86c6c Add module name to sh_test install path.
This relands Ibb1d774709ea421e18d5350009c203f83c5b2d60 after fixing
a backward compatibility issue where some test configs rely on sh_tests
not having a module name in their paths when sub_dir is specified.

Bug: 156980228
Test: m ziptool-tests
Test: sh_binary_test.go
Change-Id: If0521a008e7170d94b601f3df9dd0c12d1c96d21
2020-06-18 17:15:48 -07:00
Michael Butler
0c55445b72 Revert "Add module name to sh_test install path."
This reverts commit 2d4f1a2f7e.

Reason for revert: Droidcop: Potential culprit for Bug 158778263 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Bug: 158778263
Change-Id: I5287b3c9331b08925dd22b32c84e4c3b6f71b58a
2020-06-11 21:17:30 +00:00
Jaewoong Jung
2d4f1a2f7e Add module name to sh_test install path.
Bug: 156980228
Test: m ziptool-tests
Test: sh_binary_test.go
Change-Id: Ibb1d774709ea421e18d5350009c203f83c5b2d60
2020-06-10 17:23:46 -07:00
Jaewoong Jung
4b79e98a6e Soong package structure refactoring
Give prebuilt_etc and sh_binary their own packages and split the
gigantic main Android.bp up to small, per-package ones.

Test: m nothing, TreeHugger
Bug: 156980228
Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
2020-06-01 13:44:48 -07:00
Renamed from android/sh_binary_test.go (Browse further)