Commit Graph

413 Commits

Author SHA1 Message Date
Sasha Smundak da25b691d3 Eliminate ENABLE_DEFAULT_TEST_LOCATION as it is always true
Bug: 117224272
Test: treehugger
Change-Id: Idd47ead31fcd89dbf728f140dc3353e5013ba352
2019-03-25 13:26:03 -07:00
Vic Yang 1b83413b5a Add module-target-built-files function
This is similar to module-built-files, except that it only returns
files built for the target, not the host.

Bug: 119423884
Test: Build with the no-vendor-variant VNDK change that uses this
      function.

Change-Id: I2a3d99003b05999eae01c0b90bb62b5263d65592
2019-03-20 10:22:21 -07:00
nelsonli fe04351f6f Build: Ensuring test runtime dependencies are installed.
After migrating the primary install location of test modules into a
    generic testcase folder. All test modules will install to
    out/target/product/<product>/testcase/<module_name>/ if they don't
    specify their LOCAL_MODULE_PATH.
    But the dependent test module should also be copied to testcase
    folder even its LOCAL_MODULE_PATH be set.

BUG: 128815093
Test: 1. vi cts/tests/signature/api-check/Android.mk
        add LOCAL_MODULE_PATH for cts-hiddenapi_flags-csv
      2. m CtsHiddenApiBlacklistDebugClassTestCases
         Then, hiddenapi_flags.csv should also be copied to testcase
	 folder.

Change-Id: Iff872447348e74b2728e0913d04e46ccbaa4e972
2019-03-19 08:12:20 +00:00
Nelson Li 1f8357fe7d Revert "Revert "Build System: Solve dependency problem for test""
This reverts commit 6fe7f194b9.

Reason for revert: Fixed all build break.

Change-Id: I0a4842df1225399752515a4cd7a7c14173a5bf7b
2019-03-14 01:05:36 +00:00
Nelson Li 6fe7f194b9 Revert "Build System: Solve dependency problem for test"
This reverts commit 224e103308.

Reason for revert: Build Breakage in git_pi-dev-plus-aosp/docs @5366136
make -j110 docs showcommands dist DIST_DIR=/buildbot/dist_dirs/git_pi-dev-plus-aosp-linux-docs/5366136 checkbuild
FAILED:
 Dependencies in out found with no rule to create them:
 out/target/product/generic/data/app/CtsVerifierTester/CtsVerifierTester.apk
 out/target/product/generic/data/app/TradeFedTestApp/TradeFedTestApp.apk
 out/target/product/generic/data/app/TradeFedUiTestApp/TradeFedUiTestApp.apk
 15:53:46 stopping
and
make -j50 showcommands dist TARGET_PRODUCT=cf_x86_phone DIST_DIR=/buildbot/dist_dirs/git_master-linux-ndk_translation_all/5366149 ndk_translation_all
FAILED: ninja: 'out/target/product/vsoc_x86/data/nativetest/arm/arm_insn_tests_arm_static/arm_insn_tests_arm_static', needed by 'out/target/product/vsoc_x86/obj/PACKAGING/ndk_translation_tests_intermediates/arm_insn_tests_arm_static_result.xml', missing and no known rule to make it
15:55:38 ninja failed with: exit status 1
make: *** [run_soong_ui] Error 1
Return Code: 2

Change-Id: Idf95ef2e06526a0a31690420c923207db627605f
2019-03-11 16:48:29 +00:00
nelsonli 224e103308 Build System: Solve dependency problem for test
1. A test can add a runtime dependent test module by just setting
   LOCAL_REQUIRED_MODULES or LOCAL_TARGET_REQUIRED_MODULES. Then the dependent test
   module will be copied to testcase folder.
2. Do not install to $(TARGET_OUT_DATA) for testcase

BUG: 117224272

Test: 1. (a) vi cts/tests/tests/text/Android.mk
         (b) add LOCAL_REQUIRED_MODULES := CtsPrintTestCases
         (c) m -j CtsTextTestCases
         (d) Then, CtsPrintTestCases should also be built to testcase folder like below.
             ./target/product/generic_arm64/testcases/CtsPrintTestCases

Change-Id: I24ea3783486c54a05cfa9d3d0375b977afc230f8
2019-03-07 14:08:35 +08:00
Dan Willemsen 78e94a46c9 Default to erroring when eng/debug tags are used
Some devices opt out of the warning with `BUILD_BROKEN_ENG_DEBUG_TAGS :=
true` still, but the rest have no more warnings left.

Test: build_test in treehugger
Change-Id: I1534a0db006d72c7921a20ab793586ef1c7bdb21
Merged-In: I1534a0db006d72c7921a20ab793586ef1c7bdb21
2019-02-08 13:03:23 -08:00
Dan Willemsen a734907705 Merge "Deprecate LOCAL_MODULE_TAGS := eng/debug" 2019-01-31 18:32:16 +00:00
Colin Cross 0162cc8bea Add LOCAL_ADDITIONAL_CHECKED_MODULE
Adding an intermediate file to LOCAL_ADDITIONAL_CHECKED_MODULE will
cause the file to be built for m <module name>, mma, or m checkbuild.

Test: m checkbuild
Change-Id: I2b7c3c8f01960ce2f9176c8a2108f759fd8fc704
2019-01-29 15:04:39 -08:00
Dan Willemsen 9569ddd478 Deprecate LOCAL_MODULE_TAGS := eng/debug
Uses a new BUILD_BROKEN_ENG_DEBUG_TAGS variable that defaults to true
until we mark all of the broken targets, then we'll switch it to false.

These are fairly trivial to fix, so I don't expect to keep this flag
around for long.

Test: build_test on aosp and internal master; check logs
Change-Id: I6176fec265e78aecff965b7cf1636f831f68a140
2019-01-22 20:08:12 -08:00
Jeongik Cha 83c50324ca Define non-system module as variable
Define non_system_module in base_rules.mk when the module is product, vendor,
product_services or proprietary module.

Bug: 74699609

Test: m -j
Change-Id: Iebdd3ec8c643be3d9877b7a96cbdd83465fa3878
2019-01-18 18:24:30 +09:00
dimitry 3142e2949d Enable overrides for shared libraries
Bug: http://b/114470065
Test: make
Change-Id: I084c98ca2630ad3f56504ca0f7f08cff14483872
2018-11-12 10:51:11 +01:00
Dan Willemsen 2066a5cc27 Exempt Soong from LOCAL_TEST_DATA checks
Soong is already checking for reasonable paths, and it supports
generated test data as well, which this does not.

Test: OUT_DIR=$PWD/out m nothing
Change-Id: I62dd09b74f0f3347930fd51c213e2f66c7dfeb2d
2018-11-01 19:37:03 -07:00
patricktu b23d8e6502 aidegen: Collect all java sources from makefile system.
Bug: 117129969
Test: make -j64 out/target/product/generic_x86_64/module-info.json
Change-Id: I4bc6cab8e56a1ed6485ad2f5f22fe9b8149b25d0
2018-10-05 14:55:36 +08:00
Dan Willemsen 8cf6b65445 Remove *_OUT_INTERMEDIATE_LIBRARIES
Always use the exact libraries like Soong does instead.

Test: m
Change-Id: Ifd48020073dd045247f76f84627c497e94562286
2018-09-15 10:52:13 -07:00
Brandon Lee 5568c19ae1 aidegen: add extra info to collect in module-info.
- add "dependencies" and "srcs" to collect in module-info.mk.
- add "Srcs" in core/base_rules.mk

Bug: 112523202

Test: make out/target/product/generic_x86_64/module-info.json and
      generate out/target/product/generic_x86_64/module-info.json

Change-Id: I0669377b2e5e6b4ee225f1930bda208eff092dea
2018-09-12 17:39:32 +08:00
Colin Cross 8fb525db71 Add soong_cc_prebuilt.mk
Add soong_cc_prebuilt.mk for Soong modules to use so they can avoid
going through all of prebuilt_internal.mk, dynamic_binary.mk and
binary.mk.  Also moves stripping support into Soong.

Relands I8b37dda2b449b6b5d48d5b983f43de452f494a1e with fixes for
builds with GENERATE_BREAKPAD_SYMBOLS=true

Bug: 113936524
Test: m checkbuild
Change-Id: Id41cd76ccb1b5bb6ac43b41ae3e8f1ce46d7ad7e
2018-09-10 14:46:52 -07:00
Colin Cross 635733b816 Revert "Add soong_cc_prebuilt.mk"
This reverts commit 1bb943b97c.

Reason for revert: broke mac builds
Bug: 113936524

Change-Id: I5b3d8eb1314eb322a5f9c578623ac89e2ad25706
2018-09-10 21:35:55 +00:00
Colin Cross 1bb943b97c Add soong_cc_prebuilt.mk
Add soong_cc_prebuilt.mk for Soong modules to use so they can avoid
going through all of prebuilt_internal.mk, dynamic_binary.mk and
binary.mk.  Also moves stripping support into Soong.

Bug: 113936524
Test: m checkbuild
Change-Id: I8b37dda2b449b6b5d48d5b983f43de452f494a1e
2018-09-10 11:04:05 -07:00
Treehugger Robot acdaa8fbac Merge "Do not call sort when setting ALL_DEPS.MODULES." 2018-08-29 18:28:41 +00:00
yangbill c9347b3167 Atest: add LOCAL_TEST_CONFIG to module_info.json
Bug: 112335032

Test: 1. Add LOCAL_TEST_CONFIG := ahat-tests.xml in
         art/tools/ahat/Android.mk for ahat-tests
      2. add ahat-tests.xml in local
      3. atest -m hello_world_test
      4. check module_info.json
         local_full_test_config": ["art/tools/ahat/ahat-tests.xml"]

Change-Id: Ice2a0c85979fa6b872c92aea5ff4a340342408ad
2018-08-24 09:29:11 +08:00
Sasha Smundak 1c31492ce0 Do not call sort when setting ALL_DEPS.MODULES.
This particular invocation of 'sort' is expensive (it may amount to 30%
of the total ckati execution time for the clean build).

Test: verify that the result of running 'm nothing' is unchanged,
verify that the result of running 'm -j deps-license
PROJ_PATH=packages/app/% DEP_PATH=external/%' is unchanged.

Change-Id: If1cfddd4dee24559a26ecceebdf03cf49cc5a367
2018-08-17 12:41:24 -07:00
Dario Freni f31bc450d2 Add a way to override LOCAL_PRODUCT_MODULE.
This CL introduces the product variable
PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION, which can contain a
list of module names to be "unmarked" from being LOCAL_PRODUCT_MODULE.

If a module name is included in this variable and if that module is
declared as LOCAL_PRODUCT_MODULE, the setting will be overriden and the
module will be installed in /system. This is useful to control this
behavior on a device-specific level.

Test: m; and checked resulting output.
Bug: 110072687
Change-Id: Iaab663a7ed757c1dd4f16169b0ac3d71650014d2
2018-08-16 18:39:12 +01:00
Colin Cross e3a4df80c8 Allow Soong to autogenerate test configs
Move the configuration for autogenerating test configs into Soong,
and add LOCAL_FULL_TEST_CONFIG so that Soong can specify the full
path to a generated test config.

Also add a java junit test config template.

Bug: 70770641
Test: m checkbuild
Test: atest CtsUiRenderingTestCases
Test: atest junit-params-test
Change-Id: I2e64bc33c949ab7b342be518f94a81a186fe9c07
2018-08-14 15:39:32 -07:00
Morris Lin a77d5a2dd6 module-info.mk: Output actual module_name.
Add actual module_name information to module-info.json, and atest can
get the actual module name instead of module_name with suffix.

Bug: 77288544

Test: make -j8
      m out/target/product/generic_x86_64/module-info.json

Change-Id: I1e2dfced10db7ef5d31d26dfeb6a6c50a073a519
2018-08-07 22:17:43 +08:00
nelsonli 9009311630 Build System: Add variable for copying test config
If LOCAL_TEST_CONFIG is set, it will be the default test config
and ignore the local AndroidTest.xml.

BUG: 110982517
Test: vi art/tools/ahat/Android.mk
      set LOCAL_TEST_CONFIG := ahat_test.xml
      add ahat_test.xml in local
      m -j ahat;
      Then, out/host/linux-x86/testcases/ahat/ahat.config
      and ahat_test.xml should be the same.

Change-Id: I2f4ef735fca7d523bb637a18075512bdebf9826f
2018-08-05 01:35:06 +08:00
yangbill 86f441d899 ATest: Sync auto_test_config for multilib modules
auto_test_config will only be set once for the same
$(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)
ATest should also treat the multilib variant modules as testable.

Fix auto_generated config may have chance to be set as 2nd_arch name

BUG: 111397357
BUG: 110820867
BUG: 80298359

Test: . build/envseup.sh
      lunch aosp_x86_64-eng
      make -j out/target/product/generic_x86_64/module-info.json
      (check module-info.json for hello_world_test)
      make -j hello_world_test
      cat out/target/product/generic_x86_64/testcases/hello_world_test/hello_world_test.config

Change-Id: I69895b6373476c0053f2c6e657770d606ccfbcd1
2018-07-26 14:00:55 +08:00
Dan Willemsen 7a1da0e43e Mark more targets as PHONY
So that we can start restricting non-phony targets to $OUT_DIR and
$DIST_DIR.

Test: add --writable=out/, see fewer warnings
Change-Id: I411fe4af732b1bce35d4a4c1e2a47b5f8a15e6b8
2018-07-24 01:21:12 -07:00
Dario Freni 5f681e1dd7 Add support for /product-services partition
This CL is largely an adaptation of Change-Id
I774e6a38003734421591e51bed103802ff84f432

It adds the following variables:

- BOARD_AVB_PRODUCT_SERVICES_KEY_PATH
- BOARD_AVB_PRODUCT_SERVICES_ALGORITHM
- BOARD_AVB_PRODUCT_SERVICES_ROLLBACK_INDEX_LOCATION
- BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE
- BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT
- BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT
- BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE
- BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN
- BOARD_PREBUILT_PRODUCT_SERVICESIMAGE
- BOARD_USES_PRODUCT_SERVICESIMAGE
- LOCAL_PRODUCT_SERVICES_MODULE
- PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH
- PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION
- PRODUCT_PRODUCT_SERVICES_PROPERTIES
- TARGET_COPY_OUT_PRODUCT_SERVICES
- TARGET_OUT_PRODUCT_SERVICES
- TARGET_OUT_PRODUCT_SERVICES_*

Bug: 80741439
Test: Successfully built product-services.img with one module in it, and flashed
on device. Also successfully built image with /system/product-services directory
and no /product-services partition.
Change-Id: I5d229f6ac729ea6df9ff1f14cee2e28972cd9b4d
2018-07-19 11:15:11 +01:00
Treehugger Robot d3ef2822cc Merge "Revert "Revert "Build System: Validate AndroidTest.xml Configs""" 2018-06-26 00:24:50 +00:00
Nelson Li a2a8b9ba11 Revert "Revert "Build System: Validate AndroidTest.xml Configs""
This reverts commit 054f210fd5.

Reason for revert: Revert it again since BUG of 109736180 already be fixed.
                   Local verified for different build targets of
                   walleye_coverage-userdebug, marlin_coverage-userdebug
                   and make sure they can build pass.
BUG: 109736180
Test: lunch walleye_coverage-userdebug; make adbd_test

BUG: 73082610
Test: cd packages/apps/DocumentsUI/tests/; mma
      Modify AndroidTest.xml to a not well-formed xml; mma
      Then, it should build fail.
      atest -v DocumentsUITests

Change-Id: Iadfcb28a4e3f685a66697de21f57ca5bdb8b7c9e
2018-06-25 06:03:41 +00:00
Tom Cherry fc97764dd5 Reland: Verify init scripts for correctness during build
Relanding with change to not run on the darwin build since host init
verifier is not possible there.

Bug: 36970783
Bug: 110477913
Test: builds pass without failures
Test: builds fail with failures in init files used via LOCAL_INIT_RC,
      PRODUCT_COPY_FILES, or TARGET_PREBUILT

Change-Id: Iae93705a9320159ed97328e615eaa3bc150e6442
2018-06-21 11:16:25 -07:00
Yifan Hong 560890b29f Merge "Revert "Verify init scripts for correctness during build"" 2018-06-20 22:56:39 +00:00
Tom Cherry d15e50022f Revert "Verify init scripts for correctness during build"
This reverts commit 03303f97be.

Reason for revert: Mac build

Change-Id: Iadd76491307534fde81d3d917876c603a0658fb9
2018-06-20 22:45:14 +00:00
Tom Cherry 8075746865 Merge "Verify init scripts for correctness during build" 2018-06-20 17:06:11 +00:00
Dan Willemsen 14e1026372 Fix PHONY uses found by --warn_real_to_phony
Switch a use of `ndk` to the timestamp file that `ndk` depends on
itself.

Mark more module-specific rules as PHONY.

Test: diff build-aosp_arm.ninja (stripping _kati_always_build_)
Test: Turn on --warn_real_to_phony for Kati, see fewer warnings
Change-Id: I101ced4067780e38d18820f5d916596429087e49
2018-06-19 09:26:58 -07:00
Tom Cherry 03303f97be Verify init scripts for correctness during build
Bug: 36970783
Test: builds pass without failures
Test: builds fail with failures in init files used via LOCAL_INIT_RC,
      PRODUCT_COPY_FILES, or TARGET_PREBUILT

Change-Id: Ia98793776b365733ca8f0174dc228326a6edf041
2018-06-14 14:21:06 -07:00
Dan Willemsen bbe6a022a3 Restrict characters in module names
See the Changes.md documentation for more information.

Test: build_test on downstream branches
Change-Id: I1524b1dbfd44a7feac3b9a212f37986f870bd837
2018-06-12 13:48:49 -07:00
Nelson Li 054f210fd5 Revert "Build System: Validate AndroidTest.xml Configs"
This reverts commit 479da2f3bb.

Reason for revert: <revert for b/109736180 #8>

Bug: 109736180
Test: lunch walleye_coverage-userdebug; make adbd_test
Change-Id: I090893e20a2dab0651551361ebf65c26b95a25f2
2018-06-06 18:29:05 +00:00
Nelson Li 479da2f3bb Build System: Validate AndroidTest.xml Configs
make <test> should fail if the test has a poorly configured
atest configuration

BUG: 73082610
Test: cd packages/apps/Bluetooth/tests/unit; mma
      Modify AndroidTest.xml to a not well-formed xml; mma
      Then, it should build fail.
      atest -v BluetoothInstrumentationTests

Change-Id: I774b4eb81a1b9e9ae31de949aea995d2f258e9a1
2018-05-08 00:26:40 +00:00
Logan Chien 5f7e4f6bbf Merge "Add .vendor to LOCAL_REQUIRED_MODULES for vendor" 2018-04-25 23:46:28 +00:00
Treehugger Robot 2338a70f90 Merge "build/make: auto generate Test config file for Google Benchmark Test" 2018-04-20 21:16:00 +00:00
Logan Chien d71fbfc1a7 Add .vendor to LOCAL_REQUIRED_MODULES for vendor
This commit adds ".vendor" suffix to the modules specified in
LOCAL_REQUIRED_MODULES when BOARD_VNDK_VERSION is not empty and it is
building the vendor variant.

Test: Create a vendor module with LOCAL_REQUIRED_MODULES to a
vendor_available shared library.
Change-Id: If448f682572157d0687cda3a72f9bab0f34d7f0d
2018-04-20 18:01:25 +08:00
Nelson Li eec9529de8 build/make: auto generate Test config file for Google Benchmark Test
BUG: 74844131
Test: cd bionic/; mm (auto generating the test config in out/)
      atest bionic-benchmarks (full testing in atest)
Change-Id: I0497eed876640893d0b82d4cde384d3608cf4875
2018-04-19 09:16:54 +00:00
Dan Shi 639c6ccf7a Allow tests to be disabled for presubmit check
A test can be disabled in two ways:
1. Add the test name to ALL_DISABLED_PRESUBMIT_TESTS variable.
   Integration tests (tests inside TradeFed) can only be disabled in
   this way.
2. In module config, set LOCAL_PRESUBMIT_DISABLED to true. This works
   for tests with build target.

This change allows tests to be skipped in presubmit check to be saved in
a list that's included in test-mappings.zip build artifact.

Bug: 74971025
Test: m dist -j test-mapping
Change-Id: I6e3016b017ce1ade024dc4ded72a10c778b88e7f
2018-04-17 12:07:31 -07:00
Steven Moreland 3629aa77da Support manifest fragments.
LOCAL_VINTF_FRAGMENTS/vintf_fragments are
used to specify what manifest fragments should be installed
by a target.

Test: fragments get installed to the right location
Test: broken fragment gets detected
Test: boot device and verify service is working and manifest is updated
Test: verify OTA package contains fragments
Bug: 66917623
Change-Id: I21abe65a31b8c3d255c8ccd80e102ff3acb23105
2018-04-05 11:26:35 -07:00
Simran Basi d63a8153da build/make: Add default suite for all native tests/benchmarks
Not all native tests have the "tests" tag so adjust the logic to be:
NATIVE_TESTS||NATIVE_BENCHMARKS||(APPS&&tags==tests)

Bug: 74339384
Test: Rebuilt module-info.json, verified native tests now have
      their suite set to null-suite and have auto_test_config=True
      Double checked a frameworks App unittest as well.

Change-Id: Idea00adcebfc1a78b0c6d8ade40feddb1e90ed83
2018-03-07 12:36:55 -08:00
Dan Shi b6655e0e1a Merge "build: Default test modules to null-suite" 2018-02-17 00:39:27 +00:00
Simran Basi a132154c18 build: Default test modules to null-suite
The LOCAL_COMPATIBILITY_SUITE tag is used to package tests and
auto-generate test configs for use in the test infrastructure
and locally by atest.

Rather than update hundreds of makefiles across the tree, this
change adds significant atest support to many unittests.

Bug: 73000943, 72969679, 71510529
Test: `atest NotificationStressTests` works as expected.
Change-Id: I1b0a779b8366aee4b4df98181267f72fcb68916a
2018-02-07 11:57:22 -08:00
Simran Basi 893098b06c LOCAL_HOST_REQUIRED_MODULES support
Allows target modules to directly request host modules they
require to be built and installed as well.

Bug: 72761631
Test: Added LOCAL_HOST_REQUIRED_MODULES to a target apk test and
      the host module was built.

Change-Id: I5aca11b3ba8b54676f068d337f1c9ba0e0b01997
2018-02-06 14:18:45 -08:00