Commit graph

34344 commits

Author SHA1 Message Date
Pirama Arumuga Nainar
c7d23478e1 Switch to clang r416183 12.0.4.
Bug: http://b/181927912

Test: go/android-llvm-testing-dashboard tag: test_clang_r416183
      go/android-llvm-windows-testing
      go/ab/P20855845 sdk_phone_armv7-sdk_mac build on Forrest
      Forrest run L21700000838126631 for CtsNNAPITestCases

Change-Id: If677b57616348ae52704494f40c7b1ed470bb5f4
2021-03-19 01:14:20 +00:00
Paul Duffin
248f386558 Merge "Fix hiddenapi tests to work without javaMockFS()" 2021-03-16 15:34:36 +00:00
Paul Duffin
af0379ca9c Merge "Convert hiddenapi tests to use test fixtures" 2021-03-16 15:34:17 +00:00
Paul Duffin
ebca5e6a68 Merge "Fix TestJavaSdkLibrary... tests to work without javaMockFS()" 2021-03-16 15:34:08 +00:00
Paul Duffin
fb3fc0cf40 Merge "Convert JavaSdkLibrary... tests in java package to test fixtures" 2021-03-16 15:33:58 +00:00
Justin DeMartino
dd1decf7f6 Merge "Allow extending of the list of directories to be scanned for VSDK" 2021-03-16 15:12:17 +00:00
Paul Duffin
a36d0dc2b7 Merge "Migrate sh package to a per test build directory" 2021-03-16 15:08:41 +00:00
Paul Duffin
768f10ac78 Merge changes I0f516efd,I668f083b,Ifa70acad
* changes:
  Migrate etc package to a per test build directory
  Migrate genrule package to a per test build directory
  Use test specific build dir when needed
2021-03-16 15:08:29 +00:00
Paul Duffin
6dcd2bfaa5 Merge "Add (String)Path(s)RelativeToTop and assert functions" 2021-03-16 15:07:58 +00:00
Paul Duffin
dc92abb705 Fix hiddenapi tests to work without javaMockFS()
Bug: 182638834
Test: m nothing
Change-Id: I32e0173f3c2e97b6d6d831c6cfa51cc500f8d2b1
2021-03-16 14:25:21 +00:00
Paul Duffin
175947f654 Convert hiddenapi tests to use test fixtures
These tests rely on files provided by javaMockFS() so have been
converted to test fixtures to allow them to remove that dependency
which will allow javaMockFS() to be removed.

Bug: 182638834
Test: m nothing
Change-Id: Ifd4069a74fcf67e555f998ddbc4de3fde26b2aae
2021-03-16 14:25:21 +00:00
Paul Duffin
163043d615 Fix TestJavaSdkLibrary... tests to work without javaMockFS()
Bug: 182638834
Test: m nothing
Change-Id: I140b88b3fdf2c532d266a196fee84675c518d859
2021-03-16 14:25:21 +00:00
Paul Duffin
22b77cd538 Convert JavaSdkLibrary... tests in java package to test fixtures
These tests rely on files provided by javaMockFS() so need to are being
converted to test fixtures to allow them to remove that dependency
which will allow javaMockFS() to be removed.

Bug: 182638834
Test: m nothing
Change-Id: If736b95d134fe73c0a0ccd438ec31e93568fb929
2021-03-16 14:25:21 +00:00
Ulyana Trafimovich
2002bfa817 Merge "Reimplement verify_uses_libraries.sh in manifest_check.py." 2021-03-16 13:37:03 +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
5f9f771dab Migrate etc package to a per test build directory
Bug: 182885307
Test: m nothing
Change-Id: I0f516efdf3344ba4c5d70c2fcc8d322f56e12a86
2021-03-16 12:46:52 +00:00
Paul Duffin
e66946b43e Migrate genrule package to a per test build directory
Bug: 182885307
Test: m nothing
Change-Id: I668f083ba914569198eaa90642821340321d6b4c
2021-03-16 12:46:52 +00:00
Paul Duffin
dff5ff064e Use test specific build dir when needed
If a FixtureFactory was created with a nil buildDirSupplier then this
change will cause it to create a test specific directory instead. This
will allow packages whose tests have been fully converted to the test
fixture model to remove the need for the package level buildDir
variable.

Bug: 182885307
Test: m nothing
Change-Id: Ifa70acadbd90356fadbe39675bac3214d925aa2f
2021-03-16 12:35:04 +00:00
Paul Duffin
567465da8c Add (String)Path(s)RelativeToTop and assert functions
The existing NormalizePathForTesting function does not handle make
install paths very well, as it returns a relative path with a leading
"../" which is very confusing. It also does not clearly differentiate
between the different paths.

These functions return paths that are basically what are seen in a
normal developer build, i.e.
* <source path>
* out/soong/<soong output path>
* out/<make output path>

That makes tests that use them easier to understand.

Follow up changes will clean up the existing usages of the
Normalize... functions.

Bug: 182885307
Test: m nothing
Change-Id: I17ddc996bef5bbbf4a62da8334ea6ce29e306109
2021-03-16 12:23:56 +00:00
Paul Duffin
4defbf4d39 Switch platform_compat_config to use common arch
Bug: 182816033
Test: m nothing
Change-Id: If8886edd9278d67fe2b6288a6bd8b152f2314401
2021-03-15 23:19:39 +00:00
Paul Duffin
1bc21dc7e6 Disallow platform_compat_config modules in apex prebuilts property
Bug: 182816033
Test: m nothing
Change-Id: I50dcc358e8ae143e21b1fbf1a12835bf1342606f
2021-03-15 23:19:39 +00:00
Paul Duffin
3abc174cfd Add new compat_configs property to the apex
Bug: 182816033
Test: m nothing
Change-Id: I485d7b178c0ed17e336a6ac2a13e8313426f374b
2021-03-15 23:19:36 +00:00
Justin DeMartino
383bfb392f Allow extending of the list of directories to be scanned for VSDK
Bug: 180925851
Bug: 181564692
Test: m nothing, manually
Change-Id: Ifff95db4c9ec362322fecca08f7fd1a7b60755c0
2021-03-15 23:14:47 +00:00
Paul Duffin
a369c7b50d Convert TestCompatConfig test to use test fixtures
As this test is the only test in the apex package to use the
platform_compat_config module type it does not make sense to include
that in all the tests so instead this converts the test to use fixtures
so it can easily customize it with the additional module type.

Bug: 181070625
Test: m nothing
Change-Id: I56fda772ee336db6cfb677143aa28b1a18911bff
2021-03-15 19:56:38 +00:00
Paul Duffin
4eb4b41cef Provide preparer for using platform_compat_config modules
Bug: 181070625
Test: m nothing
Change-Id: I92ec022fae0951a21c2e885d3ded7c98daacfcfc
2021-03-15 19:56:38 +00:00
Paul Duffin
05f72de083 Convert TestJavaSdkLibraryEnforce to test fixtures
Bug: 182638834
Test: m nothing
Change-Id: I99efe76008f9ca0996177f47923274ca594a6858
2021-03-15 17:17:43 +00:00
Paul Duffin
aa6caa7fa8 Create sub tests for each test in TestJavaSdkLibraryEnforce
Bug: 182638834
Test: m nothing
Change-Id: I509b071ee4e470da45159b2174aae7acf1b0eb1a
2021-03-15 17:17:43 +00:00
Paul Duffin
2ff6d1b6d2 Provide support for preparing tests with prebuilt_apis
Adds general support for generating a set of prebuilt apis for a set of
releases and modules. Plus some wrappers for common use cases.

This temporarily will delete any existing conflicting files and replace
them so that it can be used in tests without first removing
javaMockFS(). The future update that removes javaMockFS() will also
remove that workaround.

Bug: 182638834
Test: m nothing
Change-Id: If4e2118f2384b9866cf3f85a5afec1e2e4f9ac95
2021-03-15 17:17:40 +00:00
Paul Duffin
ba2afa93d2 Merge "Extract PrepareForTestWithJavaSdkLibraryFiles from javaMockFS()" 2021-03-15 17:14:03 +00:00
Paul Duffin
56372081ed Merge "Convert testJavaError to test fixtures" 2021-03-15 17:13:55 +00:00
Paul Duffin
6f6f1eb83c Merge "Clean up testApp and testAppConfig" 2021-03-15 17:13:45 +00:00
Jiyong Park
ca5e611e0a Merge "bootimg supports v4 header" 2021-03-15 14:39:07 +00:00
Treehugger Robot
07d73efa2d Merge "Add a way to remove duplicates from Bazel label lists, to e.g. avoid duplicate deps." 2021-03-15 14:12:39 +00:00
Ulya Trafimovich
0aba252e15 Reimplement verify_uses_libraries.sh in manifest_check.py.
Previously there were two different scripts that did similar things:
1) build/soong/scripts/manifest_check.py
2) build/make/core/verify_uses_libraries.sh

Both scripts extracted <uses-library> tags and `targetSdkVersion` from
the manifests of Java modules, but 1) worked for XML manifests, and 2)
worked for APKs. This CL reimplements the functionality from 2) in 1),
so that one script can handle both XML manifests and APKs.

Bug: 132357300

Test: lunch cf_x86_64_phone-userdebug && m && launch_cvd \
      adb wait-for-device && adb root && adb logcat \
      | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
      # empty grep output, no errors

Change-Id: Id1b66e4f3f30f307dba70cb111c7571762cb546a
2021-03-15 13:50:49 +00:00
satayev
2338d6f6e4 Merge "Don't track modules that are only available to APEXes." 2021-03-15 12:47:00 +00:00
Thiébaud Weksteen
e5eb33b634 Merge "Export OUT_DIR variable to rust-project.json" 2021-03-15 12:16:48 +00:00
Rupert Shuttleworth
2e4219be73 Add a way to remove duplicates from Bazel label lists, to e.g. avoid duplicate deps.
Test: Added unit tests, and also resolves bp2build error.
Change-Id: I6e01d9e233ec21dbb244e5682cbeebbc3a1ac0c4
2021-03-15 11:51:31 +00:00
Paul Duffin
ef0449b0f3 Merge "Convert ...InstallHwasan.. tests to use fixtures" 2021-03-15 11:09:22 +00:00
Nicolas Geoffray
fb856f6add Merge "Treat core_platform as stable unless module uses legacy" 2021-03-15 08:42:43 +00:00
Thiébaud Weksteen
ee6a89ba44 Export OUT_DIR variable to rust-project.json
This variable is required by rust-analyzer to correctly process crates
that uses the include!(concat!(env!("OUT_DIR"), ...)) pattern.

Adds an initialize method to baseCompiler to save the computed path for
this directory. It is not possible to use the BeginMutator as the
BaseModuleContext does not contain enough information to use
PathForModuleOut.

Bug: 175004835
Test: SOONG_GEN_RUST_PROJECT=1 m nothing; inspect rust-project.json
Change-Id: If47b3832d3cca5712ae87773c174a61f5ee27bf8
2021-03-15 08:13:20 +00:00
Remi NGUYEN VAN
aa52d66cd5 Merge "Add service-connectivity-pre-jarjar to legacy core platform list" 2021-03-15 01:32:47 +00:00
Paul Duffin
bf028b533d Extract PrepareForTestWithJavaSdkLibraryFiles from javaMockFS()
Needed for tests in both java and sdk packages.

Bug: 182638834
Test: m nothing
Change-Id: Ia8c5e7db47d8b63bf8dcf2965b3af60a4d35a9e5
2021-03-14 01:08:26 +00:00
Paul Duffin
6bac49c560 Convert testJavaError to test fixtures
Bug: 182638834
Test: m nothing
Change-Id: If6de91cd60fea36c945f2b0d51a04e26c838e4af
2021-03-14 01:08:26 +00:00
Paul Duffin
0ed42d3c9d Clean up testApp and testAppConfig
Previously, testAppConfig added some extra files to the mock filesystem
before passing them to testConfig. However, those files are only needed
for TestApp so this converts TestApp to use test fixtures and populates
the mock filesystem with the extra files.

Without those extra files testApp and testAppConfig are equivalent to
testJava and testConfig respectively.

Bug: 181070625
Test: m nothing
Change-Id: I1d8a51223adde5b656948725bc4bc91040533625
2021-03-13 16:06:36 +00:00
Paul Duffin
d7aea1dbe5 Remove TestHelper
Bug: 181070625
Test: m nothing
Change-Id: Idc39c8621424e25c1b4310c72ed2943d34a66bbc
2021-03-13 16:02:30 +00:00
Paul Duffin
012b6679d3 Switch to Assert... functions in dexpreopt_bootjars_test.go
Bug: 181070625
Test: m nothing
Change-Id: I74a0be8fab257966aecffa914fcc7c1e6f750eb2
2021-03-13 16:02:30 +00:00
Paul Duffin
c81854a642 Stop error handler relying on testing.T being embedded in TestResult
This change is in preparation for removing testing.T from TestResult.

Bug: 181070625
Test: m nothing
Change-Id: Iac627cc3c9f922ec4a41ce657442e4139fe7defb
2021-03-13 16:00:51 +00:00
Paul Duffin
36474d322b Stop sdk package depending on testing.T being embedded in TestResult
This change is in preparation for removing testing.T from TestResult.

Bug: 181070625
Test: m nothing
Change-Id: I67535aff0d894e6e3d8456b75540f340af853355
2021-03-13 15:59:33 +00:00
Paul Duffin
e84b1338c5 Migrate from result methods to function Asserts
Bug: 181070625
Test: m nothing
Change-Id: Iadb85270290acb52c55f2ad70c9f145f1c34b611
2021-03-12 22:24:51 +00:00
Paul Duffin
bf6dcccfc4 Merge "Stop android package depending on testing.T being embedded in TestResult" 2021-03-12 21:45:39 +00:00