summaryrefslogtreecommitdiff
path: root/sh/sh_binary_test.go
AgeCommit message (Collapse)Author
2025-02-12Don't panic in ModuleForTests and friends Colin Cross
Panicking in ModuleForTests and similar test helper functions was a mistake. Go's test runner stops running tests as soon as any test panics, which means debugging multiple tests panicking requires rerunning all the tests after fixing each panic to find the next one. Pass the *testing.T into ModuleForTests and friends so that it can call t.Fatalf instead. Test: all soong tests pass Change-Id: I5d0f2424eaf04fb795079e6d1e4b9469d8c7033c
2024-11-07test_module_config for sh_test Ronald Braunstein
[retry reverted 45dca5c8cc538392edbde4ee1077fc86509b2e38 after rebase] Implemented test_module_config for sh_tests. There are some shell tests that have 130 cc_binaries and they get duplicated in the vts .zip. test_module_config allows deduping for lowmem and hwasan use cases freeing a 1 G in the zip. Moved some of the knowledge about constructing the make rules back to the provider. I haven't tried this for cc_test or rust_test, but I think it will be similar to sh_test if we ever need it. There is currently only one usecase for using test_module_config with sh_test (and none for cc_ or rust_) Also added "extra_test_configs" to sh_test Sample bp file. test_module_config { name: "vts_ltp_tmc", base: "vts_ltp_test_x86_64", test_suites: [ "general-tests", "vts" ], options: [ {name: "is-low-mem", value: "false"}, {name: "is-hwasan", value: "true"}, ], } Test: go test ./ Test: m vts_ltp_test_x86_64_hwasan Test: atest vts_ltp_test_x86_64_hwasan Test: m vts # inspect the zip for symlinks Test: CtsAppTestCases_android_server_am Test: atest -c -v vts_ltp_test_x86_64:vts_ltp_test_x86_64_hwa Change-Id: I208797f97e3448bcff7434630adfd7476fc275f9
2024-11-07Revert "test_module_config for sh_test" Liana Kazanova
This reverts commit 45dca5c8cc538392edbde4ee1077fc86509b2e38. Reason for revert: DroidMonitor: Potential culprit for http://b/377964351 - 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: Idd5e4b0d04b3c04dc1cfc4541615fc5f42a85c3e
2024-11-06test_module_config for sh_test Ronald Braunstein
Implemented test_module_config for sh_tests. There are some shell tests that have 130 cc_binaries and they get duplicated in the vts .zip. test_module_config allows deduping for lowmem and hwasan use cases freeing a 1 G in the zip. Moved some of the knowledge about constructing the make rules back to the provider. I haven't tried this for cc_test or rust_test, but I think it will be similar to sh_test if we ever need it. There is currently only one usecase for using test_module_config with sh_test (and none for cc_ or rust_) Also added "extra_test_configs" to sh_test Sample bp file. test_module_config { name: "vts_ltp_tmc", base: "vts_ltp_test_x86_64", test_suites: [ "general-tests", "vts" ], options: [ {name: "is-low-mem", value: "false"}, {name: "is-hwasan", value: "true"}, ], } Test: go test ./ Test: m vts_ltp_test_x86_64_hwasan Test: atest vts_ltp_test_x86_64_hwasan Test: m vts # inspect the zip for symlinks Test: CtsAppTestCases_android_server_am Test: atest -c -v vts_ltp_test_x86_64:vts_ltp_test_x86_64_hwa Change-Id: I5a36d798fd21180d653d09e54f40449a0ebcbd29
2024-10-29Add defaults for sh_ rules. Ronald Braunstein
I was helping someone who wanted to use the same set of dependencies in multiple sh_test rules and we realized that there are no defaults on sh_test, sh_binary, etc. (see vts_ltp_test*) Bug: 277261121 # Related to this bug Change-Id: I81084771432e22e3de230511bdaba1b79a171406 Test: go test ./
2023-11-30Move test data installation to Soong Colin Cross
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-08-24Support java_data in sh_test_host Makoto Onuki
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
2022-02-10Add builtins and minimal runtime as dependencies instead of flags Colin Cross
Use dependencies instead of libflags to link libclang_rt.builtins and libclang_rt.ubsan_minimal. Test: m checkbuild Change-Id: I403cee0fb8cc21c347b42d8f8a3c20d6f43337a4
2022-01-26build device binary for java_test_host Sam Delmerico
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
2021-12-15Remove InstallBypassMake and ToMakePath Colin Cross
InstallBypassMake and ToMakePath are obsolete, remove them. Bug: 204136549 Test: m checkbuild Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
2021-07-20Replace android.BuildOs with Config.BuildOS Colin Cross
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-05-24Add unit_test test option in sh_test_host Dan Shi
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-03-22Remove usages of FixtureFactory from misc packages Paul Duffin
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-16Migrate sh package to a per test build directory Paul Duffin
Bug: 182885307 Test: m nothing Change-Id: I8e379c555e48ab482c56a19630d83a3a54126fc5
2021-03-09Support test fixtures in sh package Paul Duffin
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-03cd to / before running soong_build . Lukacs T. Berki
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-02-19Add ctx to AndroidMkExtraEntriesFunc Colin Cross
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to access providers. Test: m checkbuild Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2020-11-12Pass Config to NewTestContext instead of ctx.Register Colin Cross
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-10-09Revert "Make lots of tests run in parallel" Colin Cross
This reverts commit 323dc60712491c71ccdc5363c42df61f0a192487. Reason for revert: Possible cause of test instability Bug: 170513220 Test: soong tests Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-06Make lots of tests run in parallel Colin Cross
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-08-18Add data bin and lib properties to sh_test Jaewoong Jung
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-18Revert "Add data bin and lib properties to sh_test" Jaewoong Jung
This reverts commit a41a8877cb0cae27f0a0e4f9b511a7641adfc1b9. Reason for revert: Broke Darwin builds Change-Id: I4371d735ffea51f7c349b4d223bc91c103163015
2020-08-17Add data bin and lib properties to sh_test Jaewoong Jung
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-14Revert "Add data bin and lib properties to sh_test" Jaewoong Jung
This reverts commit 91dbd520dec7abcca8983792df4369401e7aa963. 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-14Fix broken darwin build. Jaewoong Jung
Offending change - I7b64de4b06e9bba3fba3712b25dd9f9d112e1625 This is in addition to Idebfdf1ed7d8e10ba867c8eaac01410d754c7131 Test: sh_binary_test.go Bug: 156980228 Bug: 164465992 Change-Id: I8d01d0e82efe764cc6901bb3e2c2767c8b25d81f
2020-08-14Fix broken darwin build. Jaewoong Jung
Offending change - I7b64de4b06e9bba3fba3712b25dd9f9d112e1625 Test: sh_binary_test.go Bug: 156980228 Fixes: 164465992 Change-Id: Idebfdf1ed7d8e10ba867c8eaac01410d754c7131
2020-08-13Add data bin and lib properties to sh_test Jaewoong Jung
Test: sh_binary_test.go Test: Modified ziptool-tests Bug: 156980228 Change-Id: I7b64de4b06e9bba3fba3712b25dd9f9d112e1625
2020-06-18Add module name to sh_test install path. Jaewoong Jung
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-11Revert "Add module name to sh_test install path." Michael Butler
This reverts commit 2d4f1a2f7e96e760216e39f36503fee2a8a97d95. 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-10Add module name to sh_test install path. Jaewoong Jung
Bug: 156980228 Test: m ziptool-tests Test: sh_binary_test.go Change-Id: Ibb1d774709ea421e18d5350009c203f83c5b2d60
2020-06-01Soong package structure refactoring Jaewoong Jung
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