Commit Graph

34282 Commits

Author SHA1 Message Date
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
Lev Proleev f6b5f8217c Merge "Add libruy_static to allowed_deps" 2021-03-12 14:00:45 +00:00
Cindy Zhou 34d300ba76 Merge "Enable cfi for 32bit arch" 2021-03-12 12:41:39 +00:00
Paul Duffin a8c443618a Merge "Convert testDexpreoptBoot to use test fixtures" 2021-03-12 11:40:03 +00:00
Jooyung Han d0b3574072 Merge "Fix bootimg.cmdline to use ShellEscapeIncludingSpaces" 2021-03-12 09:10:22 +00:00
Paul Duffin 451aeef583 Convert testDexpreoptBoot to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Iaca15c87c68383630aed015e0e17adad3c37c4b1
2021-03-12 09:02:13 +00:00
Paul Duffin ebddef39dd Fix build failure in boot_image_sdk_test.go
Test: m nothing
Change-Id: I1f386fe4119ac9c3efc8d046142d02862af5fd99
2021-03-12 08:20:27 +00:00
Paul Duffin 32a8aadfaa Merge "Add prebuilt_boot_image and add boot_images to sdk" 2021-03-12 08:06:45 +00:00
Paul Duffin 412a209d87 Merge "Prevent mock filesystem files being overridden by accident" 2021-03-12 08:04:43 +00:00
Paul Duffin c10ee77ea6 Merge changes Ifc96992e,Ic76523ba
* changes:
  Support test fixtures in sdk package
  Add apexFixtureFactory to apex package
2021-03-12 08:01:31 +00:00
Paul Duffin c7cdd1513c Merge "Improve name of getModuleHeaderJarsAsNormalizedPaths" 2021-03-12 07:59:39 +00:00
Jooyung Han 32cddd0ba5 Fix bootimg.cmdline to use ShellEscapeIncludingSpaces
bootimg.cmdline should be passed to mkbootimg's --cmdline flag as a
single argument. Because cmdline can have spaces we should escape it
with ShellEscapeIncludingSpaces rather than blindly putting double
qoutes with ShellEscape, which also puts single quotes when necessary.

Bug: 182092664
Test: m nothing && see build.ninja (microdroid's build commands)
Test: boot microdroid on VIM3L
Change-Id: I5d766bb0a816d829569c9ebfddf97c4f846f78f8
2021-03-12 14:38:46 +09:00
Jiyong Park cb60b31f21 Merge "bootimg and logical_partition are OutputFileProducer" 2021-03-12 03:00:19 +00:00
Treehugger Robot d13e31a8cc Merge changes I0ad54aa7,I1d6d20ec
* changes:
  Propagate LANG environment variable to lint in RBE
  Default lint RBE to local exec strategy
2021-03-12 01:11:49 +00:00
Paul Duffin f11bced30b Merge "Convert cc/prebuilt_test.go to use fixtures" 2021-03-11 21:58:39 +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 b6a5064630 Merge "Add text fixture preparers for rust package" 2021-03-11 21:53:07 +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
Paul Duffin fe9a9e3f7d Add missing // to clarify comment
Bug: 181070625
Test: m nothing
Change-Id: Ia22a1be7a05b3a9efd34f2bf70216eb046396be0
2021-03-11 17:41:01 +00:00
Paul Duffin 4a2a29ce6a Support test fixtures in sdk package
Bug: 181070625
Test: m nothing
Change-Id: Ifc96992e54c1b1d89a82b88ab27e555ae267a51e
2021-03-11 17:25:29 +00:00
Paul Duffin db4888966a Add text fixture preparers for rust package
Needed to decouple the integration of test fixtures into apex from the
support of test fixtures in rust tests.

Bug: 181070625
Test: m nothing
Change-Id: I26bdfde58dd75713ece89e631edabf041d40596a
2021-03-11 17:25:29 +00:00
Paul Duffin 37aad60507 Add apexFixtureFactory to apex package
Unlike the similar changes in other packages this change separates the
addition of the fixture factory and the conversion of the test...
methods to use them as there are a few tests that need converting to
use test fixtures first.

Bug: 181070625
Test: m nothing
Change-Id: Ic76523ba89fc1967631aeb682935935b5af116df
2021-03-11 17:25:29 +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
Paul Duffin 982c550855 Merge "Switch CheckSnapshot from a testSdkResult method to a function" 2021-03-11 17:18:10 +00:00
Paul Duffin 4cd3d05a0c Merge "Make testSdkResult compatible with android.TestResult" 2021-03-11 17:17:29 +00:00
Paul Duffin 4e99ef761a Improve name of getModuleHeaderJarsAsNormalizedPaths
Bug: 182402568
Test: m nothing
Change-Id: I93bfe10f0ac62bf018cfee6738fa080d9404b1cb
2021-03-11 15:53:25 +00:00
Paul Duffin fc9c218e83 Merge "Ensure java_system_modules_import uses prebuilts" 2021-03-11 15:50:58 +00:00
Paul Duffin a2fcd19aef Merge "Improve system modules tests" 2021-03-11 15:50:34 +00:00
Christopher Parsons 2bed9ffaf4 Merge "mixed builds for cc_static_library without deps" 2021-03-11 15:11:44 +00:00
Paul Duffin 6f688d03c8 Merge "Convert system modules tests to use fixtures" 2021-03-11 15:11:20 +00:00
Paul Duffin 8075291a94 Merge "Separate system modules tests into their own file" 2021-03-11 15:10:54 +00:00
Paul Duffin f18ff339a9 Merge "prebuilt_apis should create a java_system_modules_import" 2021-03-11 15:09:47 +00:00
Jaewoong Jung 48b8df14be Merge "Populate baseline_file values." 2021-03-11 15:04:52 +00:00
Paul Duffin 6a1160e749 Convert cc/prebuilt_test.go to use fixtures
Bug: 181070625
Test: m nothing
Change-Id: I6048812962382e2adaf79d941a24e5c0ffdd9b25
2021-03-11 15:04:43 +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 7d8a8ad0d1 Convert cc/cc_test.go tests that use CreateTestContext to fixtures
Bug: 181070625
Test: m nothing
Change-Id: I7e57c978fa07ee8c0f35d567753751bd7b128b1e
2021-03-11 15:04:39 +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
Paul Duffin 981b94b460 Switch CheckSnapshot from a testSdkResult method to a function
This will allow the testSdkResult to be replaced with the TestResult
when switching sdk package to use test fixtures.

Bug: 181070625
Test: m nothing
Change-Id: Ieca63f4c189f5e804102aeb4073289ea03143b6e
2021-03-11 13:39:24 +00:00
Paul Duffin 8306f25679 Make testSdkResult compatible with android.TestResult
This change makes it easier to switch the sdk package over to using the
new fixture mechanism by removing inconsistencies between the
testSdkResult and TestResult structures.

Bug: 181070625
Test: m nothing
Change-Id: Ic4c06e08ea5060fd09123f2ca65580e18b4d2ef6
2021-03-11 13:38:56 +00:00
Paul Duffin 4f0a75abde Ensure java_system_modules_import uses prebuilts
Make sure that java_system_modules_import always depends on the
prebuilt by adding dependencies in the ComponentDepsMutator() method
which is called before prebuilts without a corresponding source are
renamed from prebuilt_<x> to <x>. That requires the prebuilt_ prefix
to be provided but it ensures that the dependencies are safe.

Similar logic also makes sure java_system_modules always depends on
the source module and not on a renamed prebuilt module.

Bug: 182402568
Test: m nothing
Change-Id: I30db95978f5d9b205951011edf40585ee36c0c4c
2021-03-11 09:40:02 +00:00
Paul Duffin c52bea9555 Improve system modules tests
The previous approach of looking for substrings in the command that
matched the base name of the jar could not differentiate between
whether the jar was a prebuilt or a source as they both have the same
base name.

The tests also did not cover the case when there was both prebuilts
and source modules.

This change:
1. Checks that the inputs to the command come from the appropriate
   module.
2. Adds a mixed test.
3. Deduped the source and prebuilt module definitions.

The new test reveals the buggy behavior which will be fixed in a follow
up change.

Bug: 182402568
Test: m nothing
Change-Id: I384ecca097cbe3560e7589c23fb99c176a42fd9b
2021-03-11 09:39:18 +00:00
Paul Duffin f23e346f6c Convert system modules tests to use fixtures
Bug: 182402568
Test: m nothing
Change-Id: I0535e60a692925b141e465d8e1ec92be21d54c88
2021-03-11 08:32:01 +00:00