Commit graph

2615 commits

Author SHA1 Message Date
Lukacs T. Berki
5f6cb1d6d3 Compile soong_build for debugging if needed.
That is, when SOONG_DELVE= is set.

Test: "m nothing; SOONG_DELVE=port m nothing; m nothing"
Change-Id: I16bd4e54e81b93202573935df134d413feea9bb2
2021-03-17 15:03:14 +01:00
Lukacs T. Berki
d1e3f1ff08 Embed minibp into soong_ui.
This requires linking Blueprint into soong_ui. It lets us avoid the
complicated dance of Ninja files and shell scripts: now the information
as to how soong_build is built is passed directly to Blueprint using a
struct that contains all the information the command line arguments used
to contain.

The ability to run Blueprint from the command line is kept (for now).

Some variables in bootstrap/command.go needed public accessor functions
because soong_build reads them. This will be disentangled by moving the
flag parsing to soong_build.

The presence of the flag definitions in Blueprint means that soong_ui
now also accepts them. This is not a problem in practice because they
are ignored and because soong_ui itself is hidden behind a few layers of
shell scripts.

Test: Presubmits + the new bootstrap_test.sh .
Change-Id: I6dca478f356f56a8aee1e457d71439272351390b
2021-03-17 08:35:52 +01:00
Lukács T. Berki
645610e791 Merge "Remove global variables from Blueprint." 2021-03-17 07:08:24 +00:00
Liz Kammer
a5f86249a4 Merge changes from topic "mixed-bp2build"
* changes:
  Support autoconverted modules in mixed builds
  Use handcrafted build targets in bp2build
2021-03-16 21:40:04 +00:00
Christopher Parsons
bc3f7e0276 Merge "Refactor and cleanup of cquery processing" 2021-03-16 21:12:01 +00:00
Liz Kammer
bdc609972c Support autoconverted modules in mixed builds
modules converted with bp2build_available are will also be available to
be used in mixed builds.

Test: build/bazel/scripts/milestone-2/demo.sh full
Test: go tests
Change-Id: I49f16ec3ba5bb11dfed8066af069c27eb04371fb
2021-03-16 15:11:49 -04:00
Chris Parsons
944e7d01aa Refactor and cleanup of cquery processing
Test: USE_BAZEL_ANALYSIS=1 m libc
Change-Id: Iaf9a92e84d39c132e2444a8aaafd79505a12b8ec
2021-03-16 14:39:16 -04: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
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
Lukacs T. Berki
89e9a16ebd Remove global variables from Blueprint.
The end goal of this exercise is to remove all mutable global state so
that multiple Blueprint instances can be run in the same process.

Test: Presubmit.
Change-Id: Idb34b0920f2c7d92efb9328ce8a78b7306f89571
2021-03-16 08:40:51 +01: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
Liz Kammer
ba3ea16f14 Use handcrafted build targets in bp2build
If both bp2build_available and label are specified, label will be
preferred.

Initially, we copy the entire BUILD.bazel file. Eventually we may move
this to use bazel query for a more accurate result.

Test: go test *
Test: build/bazel/scripts/milestone-2/demo.sh full
Test: GENERATE_BAZEL_FILES=true m nothing
      edit bionic/libc/tools/BUILD.bazel
      GENERATE_BAZEL_FILES=true m nothing and verify changes picked up
Bug: 180516554
Change-Id: I43025583300e6b10d2c18032cd4a76237b578d59
2021-03-15 13:09:25 -04:00
satayev
2338d6f6e4 Merge "Don't track modules that are only available to APEXes." 2021-03-15 12:47:00 +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
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
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
3d0ddff8ed Stop android 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: Ib51c7d4e5efdcbe0652df10b66140058a8bfa471
2021-03-12 14:26:04 +00:00
Paul Duffin
9dcf253197 Add new function Assert methods
Bug: 181070625
Test: m nothing
Change-Id: If7977493d4f7380e746df1b9b8b4cb13c39abeac
2021-03-12 14:25:33 +00:00
Paul Duffin
0550055007 Separate TestHelper from fixtures
Although they are intended to be used together they are separate pieces
of functionality so should be separate.

Bug: 181070625
Test: m nothing
Change-Id: I3b2ccf66748a3c53b63c112256a8eb20e0448179
2021-03-12 14:25:33 +00:00
Paul Duffin
3fdb1bd9a2 Remove unused TestResult methods
Left over from a previous incarnation of the fixture mechanism.

Bug: 181070625
Test: m nothing
Change-Id: Ifb3811b7b030613cbff93994f7d370d402b1e73d
2021-03-12 14:25:33 +00:00
Paul Duffin
412a209d87 Merge "Prevent mock filesystem files being overridden by accident" 2021-03-12 08:04:43 +00:00
Paul Duffin
d7bbeffe0e Merge changes I6b408d44,I7e57c978
* changes:
  Add preparer for test to use AndroidMk
  Convert cc/cc_test.go tests that use CreateTestContext to fixtures
2021-03-11 21:58:14 +00:00
Paul Duffin
6e9a4007b5 Prevent mock filesystem files being overridden by accident
Bug: 181070625
Test: m nothing
Change-Id: Ib12b5cbe9af980706620d7d7d85bcfe31f36b07f
2021-03-11 19:21:12 +00:00
Artur Satayev
533b98cde3 Don't track modules that are only available to APEXes.
Modules that are not available for platform are developed with
updatability in mind, and do not require manual approvals.

Bug: 181223240
Test: checkbuild
Change-Id: I10b91053b3ef5a9ff5400d9d7a68fae3144a671c
2021-03-11 18:13:18 +00:00
Paul Duffin
d1fc19be39 Merge "Add preparer for test to allow missing dependencies" 2021-03-11 17:24:15 +00:00
Paul Duffin
6872d651b6 Merge "Correct error in documentation of AssertDeepEquals" 2021-03-11 17:23:55 +00:00
Christopher Parsons
2bed9ffaf4 Merge "mixed builds for cc_static_library without deps" 2021-03-11 15:11:44 +00:00
Paul Duffin
6c9da044f8 Add preparer for test to use AndroidMk
Bug: 181070625
Test: m nothing
Change-Id: I6b408d44e82d3bac6661bf6b54020c5c4051900e
2021-03-11 15:04:43 +00:00
Paul Duffin
8c004c6c04 Merge "Add preparer for test with variables" 2021-03-11 14:35:57 +00:00
Paul Duffin
25259e93e1 Add preparer for test to allow missing dependencies
Bug: 181070625
Test: m nothing
Change-Id: I426fcb19d9bea8b9551dc5c3a803228a34768fc0
2021-03-11 14:34:10 +00:00
Paul Duffin
1ef166e411 Correct error in documentation of AssertDeepEquals
Bug: 181070625
Test: m nothing
Change-Id: Ie9bb46a7c29e800822d4bc67b23a457e17e5e29a
2021-03-11 14:34:10 +00:00
Paul Duffin
e7a055c6a3 Add preparer for test with variables
Bug: 181070625
Test: m nothing
Change-Id: I101826d88e67c63a58007f20f8e24d574dd7c99b
2021-03-11 14:16:49 +00:00
Paul Duffin
01c76ca278 Merge "Add AssertStringListContains to TestHelper" 2021-03-11 14:08:01 +00:00
Paul Duffin
4e1916011c Merge "Convert fuchsia tests to use test fixtures" 2021-03-11 14:07:01 +00:00
Lukacs T. Berki
21d5c7aaa9 Hard-wire the path to xcrun as /usr/bin/xcrun.
This lets us not leak $PATH to soong_build. It was only needed for
Darwin tests anyway.

Test: Will ask jingwen@ who has a Mac.
Change-Id: I4647e41275b323fe6283580f8f92718c6229f23e
2021-03-11 08:52:39 +01:00
Lukács T. Berki
dfa33be445 Merge "Fix writedocs." 2021-03-11 07:38:42 +00:00
Lukacs T. Berki
81a6983dc2 Fix writedocs.
This probably got broken by aosp/1609473 because soong_build is now
invoked in two different ways:

- By its absolute path during building out/soong/build.ninja
- By its path relative to the source root when generating documentation

Bug: 182347000
Test: Manual (the long incantation on b/182347000)
Change-Id: I0a3a97e4865ffde4a450a3f7baf3980b5a2016c8
2021-03-11 08:37:01 +01:00
Paul Duffin
93706aeef2 Add AssertStringListContains to TestHelper
Bug: 181070625
Test: m nothing
Change-Id: I5b36b748a2f0b7c189aa9e12cf0ad0f663c92a9a
2021-03-11 07:26:19 +00:00
Paul Duffin
ecdac8a6d6 Convert fuchsia tests to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Ic2b86f7c603ff1c4b48884cb58908db536d98f37
2021-03-11 07:26:11 +00:00
Lukács T. Berki
a55aefd57b Merge "Print a correct error message when a non-hermetic tool is not found." 2021-03-11 07:10:08 +00:00
Jaewoong Jung
6df5e0307d Merge "Lineage properties support module references." 2021-03-11 00:59:32 +00:00
Paul Duffin
67e848ab04 Merge changes Ib2c6ac28,I7c76ed6d,I00415f10,I4be2a16c,I6f269c9c, ...
* changes:
  Support test fixtures in sh package
  Support test fixtures in bpf package
  Support test fixtures in cc package
  Add temporary RunTestWithConfig method to simplify migration
  Support test fixtures in etc package
  Convert license tests to use test fixtures
2021-03-10 21:52:17 +00:00
Paul Duffin
3b2636fdf3 Merge "Remove duplicate sdk.TestHelper" 2021-03-10 19:59:56 +00:00
Chris Parsons
808d84c45d mixed builds for cc_static_library without deps
Test: Manual mixed builds testing of `libc` target with manually
migrated "libc_nopthread" and "libc_init_dynamic".

Change-Id: If7d67e95eca9899271b1eeb662c7c2e571f64afa
2021-03-10 13:24:59 -05:00
Paul Duffin
a3cb2b396f Remove duplicate sdk.TestHelper
As part of the work on the new fixture mechanism some of the TestHelper
functionality was moved into the android/fixture.go package. This moves
the rest and removes the now duplicated TestHelper from the sdk
package.

Also removed some unnecessary & operators.

Bug: 181070625
Test: m nothing
Change-Id: Ia09a5d05e4fab3a4e28cf44b2d947a33541e3925
2021-03-10 14:07:20 +00:00
Paul Duffin
282671d696 Merge "Rename SetErrorHandler to ExtendWithErrorHandler" 2021-03-10 11:51:29 +00:00
Lukacs T. Berki
8158356421 Print a correct error message when a non-hermetic tool is not found.
The old error message was wrong because this message is emitted
specifically when a non-hermetic tool is not found.

Test: Manual ("m nothing")
Change-Id: I857c1c2bb059aff894e8bd3dd0c09b030c82035d
2021-03-10 10:43:13 +01:00
Paul Duffin
533274a2d3 Merge "Allow customization of product variables in a test fixture" 2021-03-10 08:17:27 +00:00
Paul Duffin
6f3d6df708 Merge "Allow customization of the env configuration in a test fixture" 2021-03-10 08:17:14 +00:00