Commit graph

34536 commits

Author SHA1 Message Date
Paul Duffin
ff2aa69a86 Deprecate FixtureFactory in favor of FixturePreparer
Prior to this FixtureFactory was basically a FixturePreparer with the
additional support for buildDirSupplier. This makes that a reality by
moving the functionality of FixtureFactory into FixturePreparer and
making FixtureFactory extend that with buildDirSupplier.

This also deprecates the Extend() method in favour of simply using the
GroupFixturePreparers() method.

Once all usages of buildDir have been removed so the buildDirSupplier
is no longer required then FixtureFactory will be removed altogether.
In the meantime follow up changes will migrate those tests that do not
require a buildDirSupplier to just use FixturePreparers in preparation
for the eventual removal of FixtureFactory.

Bug: 183235980
Test: m nothing
Change-Id: Ibb4e5bfec2f76ee34dd7de6aed6bbbfe27d337b8
2021-03-22 18:31:53 +00:00
Paul Duffin
4ca6752b21 Replace FixturePreparer.visit() with list()
The visit() method was dropped in favor of a list() method as the
latter makes it easier to treat fixtureFactory, simpleFixturePreparer
and compositeFixturePreparer as simple collections of already flattened
and deduped *simpleFixturePreparers. That will be used in a follow up
change.

Bug: 183235980
Test: m nothing
Change-Id: Ia41ae9bd4f9c39c85865ba698e0da6be00519caf
2021-03-22 18:31:53 +00:00
Paul Duffin
cff464f794 Remove errorHandler from FixtureFactory
The ExtendWithErrorHandler method simply wraps the FixtureErrorHandler
in a FixturePreparer that will set the error handler in the fixture.

Bug: 183235980
Test: m nothing

Change-Id: Icf9a5f62cb532efc120300c2f906cd3397aa6763
2021-03-22 18:31:53 +00:00
Paul Duffin
592518290f Allow access to preparers that produced a TestResult
The Preparer() method allows for another test to be run using the same
preparers as were used to create the TestResult. That is useful when
testing functionality like the sdk snapshot mechanism that generates an
Android.bp and a set of files that are intended to be reconsumed by
Soong. This method allows the test to process that output to ensure
that it is valid. A follow up change will migrate the CheckSnapshot()
method to use this as part of the migration of the sdk package to the
test fixture model.

Previously, the dedupAndFlattenPreparers() would not construct a list
containing all the preparers passed to it as it was trying to avoid
constructing such a list unless necessary. However, as every usage of
this method now needs to construct such a list that functionality has
been added to it.

Bug: 181070625
Test: m nothing
Change-Id: Iab34e2c861bdfd05c44e982224f70c5abc19e468
2021-03-22 18:31:53 +00:00
Paul Duffin
6bef6fee3c Merge "Ensure that DepIsInSameApex is not called for ExcludeFromApexContentsTag" 2021-03-22 18:30:10 +00:00
Pirama Arumuga Nainar
679d5308ec Merge "Switch to clang r416183 12.0.4." 2021-03-22 16:26:13 +00:00
satayev
2b077baa5e Merge changes from topic "move_allowed_deps_txt"
* changes:
  Treat allowed_deps.txt source file as optional.
  Move allowed_deps.txt to packages/modules/common.
2021-03-22 10:48:45 +00:00
Paul Duffin
3d5f6a1034 Merge "Prevent invalid paths being added to mock file system" 2021-03-22 08:58:54 +00:00
Paul Duffin
c737facd2b Merge "Replace AssertPanic with AssertPanicMessageContains" 2021-03-22 08:58:28 +00:00
Paul Duffin
4c3e8e2d67 Ensure that DepIsInSameApex is not called for ExcludeFromApexContentsTag
The ExcludeFromApexContentsTag marker interface was added to avoid
every implementation of DepIsInSameApex() from having to deal with the
special tags, like PrebuiltDepTag. Unfortunately, when adding that
not all calls to DepIsInSameApex() were protected which meant that the
BootImageModule, which panics if it doesn't recognize a tag, was
causing failures. This change documents the need and improves the
consistency.

A follow up change will add a test for this.

Bug: 182992071
Test: m nothing
Change-Id: If0bf9a7447ebf7a0bb0c88e91951a7220d4af45c
2021-03-22 08:43:55 +00:00
Paul Duffin
50e49818a3 Merge "Cleanup the now unused testCustomizer" 2021-03-22 08:06:40 +00:00
Paul Duffin
b535616a84 Merge "Convert test specific customizers to FixturePreparers" 2021-03-22 08:06:26 +00:00
Paul Duffin
7ba0448314 Merge "Convert shared customizer functions to return FixturePreparers" 2021-03-22 08:05:56 +00:00
Paul Duffin
241f547365 Merge "Allow test handlers to be either FixturePreparer or testCustomizer" 2021-03-22 08:05:36 +00:00
Paul Duffin
043427b276 Merge "Convert apex/boot_image_test.go to use test fixtures" 2021-03-22 08:05:21 +00:00
Paul Duffin
32b0e07228 Merge "Switch testApex and related methods to use test fixtures" 2021-03-22 08:04:55 +00:00
Treehugger Robot
5e737ad1d5 Merge "Allow customization of all fixture state at once" 2021-03-21 23:48:43 +00:00
Paul Duffin
3bcdfe8bbb Merge "Add prepareForSdkTestWithJava" 2021-03-21 11:07:03 +00:00
Paul Duffin
d5deba1126 Merge "Java build components require android build components" 2021-03-21 11:06:33 +00:00
Paul Duffin
d14cbc1e69 Add prepareForSdkTestWithJava
Bug: 182638834
Test: m nothing
Change-Id: I86cb08a640c7e39c1eaaf54926699f32a32ccc9b
2021-03-21 11:01:13 +00:00
Paul Duffin
ce5a4547bb Java build components require android build components
Java build components invariably require android build components such
as the arch mutator (to create the common variant) so include them
together.

Bug: 181070625
Test: m nothing
Change-Id: I435b09a34c48c67b890368b37b8da27e8de97c9a
2021-03-21 10:20:25 +00:00
Treehugger Robot
f2be52c4dc Merge "Revert "[strip.sh] Move remaining GNU binutils usage to llvm binutils"" 2021-03-20 19:25:23 +00:00
Jaewoong Jung
2406d689bf Merge "Take Module implementations out of java/java.go." 2021-03-20 15:29:32 +00:00
David Srbecky
33dfba1d9c Revert "[strip.sh] Move remaining GNU binutils usage to llvm binutils"
This reverts commit ad50ce8349.

Bug: 183237575
Reason for revert: Breaks stack unwinding

Change-Id: I256dc77525687fb3e670355587b1eac72158b274
2021-03-20 14:46:15 +00:00
Treehugger Robot
8cc04e59e1 Merge "manifest_check.py: translate library names using dexpreopt configs." 2021-03-20 12:12:52 +00:00
Paul Duffin
80f4cea1ad Prevent invalid paths being added to mock file system
Bug: 182885307
Test: m nothing
Change-Id: Ie9f60fd02e2a2bc44811dbcadf0eada4e52c9749
2021-03-20 12:11:20 +00:00
Paul Duffin
9f4b3bbb7c Replace AssertPanic with AssertPanicMessageContains
Bug: 182885307
Test: m nothing
Change-Id: Idffa314285c90080796cc3df391de9c314eaa422
2021-03-20 12:08:51 +00:00
Paul Duffin
40b6257dc1 Cleanup the now unused testCustomizer
Bug: 181070625
Test: m nothing
Change-Id: I825e0da53b7fd82f4ef33d7183351c1f2ed8ee23
2021-03-20 11:42:48 +00:00
Paul Duffin
0a49fdca0b Convert test specific customizers to FixturePreparers
Bug: 181070625
Test: m nothing
Change-Id: I1c4b7303a1153b040b7266e95b06d172554dc52a
2021-03-20 11:39:23 +00:00
Paul Duffin
810f33d9ee Convert shared customizer functions to return FixturePreparers
Bug: 181070625
Test: m nothing
Change-Id: I8d09f91a3db23eb36cd73a13e418df98949ec72d
2021-03-20 11:33:03 +00:00
Paul Duffin
2be9dcd3aa Allow test handlers to be either FixturePreparer or testCustomizer
This allows the testCustomizers to be switched to FixturePreparers
incrementally rather than in one go.

Bug: 181070625
Test: m nothing
Change-Id: Idd9d2e28abf9b17fc46b5566ab8d3affa330287e
2021-03-20 10:25:45 +00:00
Paul Duffin
34d433ad7e Convert apex/boot_image_test.go to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: I940353e32233317d9e932b2d61908125e4c33766
2021-03-20 10:25:45 +00:00
Paul Duffin
e05480ac47 Switch testApex and related methods to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Icdd9c3d807d5497ef85946a877c6cd4b4af045bc
2021-03-20 10:25:45 +00:00
Paul Duffin
ae542a58af Allow customization of all fixture state at once
Adds FixtureCustomPreparer.

Bug: 181070625
Test: m nothing
Change-Id: I310e16661a0f032f778481d9b69da2e0e9a084cf
2021-03-20 10:25:45 +00:00
Jaewoong Jung
263426431a Take Module implementations out of java/java.go.
Test: TreeHugger
Change-Id: I5c39915ad2cadf5981c201a2b412916524d4c3e2
2021-03-19 15:46:38 -07:00
Julien Desprez
0387862185 Merge "Migrate manifest_*_test out of test mapping" 2021-03-19 21:47:24 +00:00
Paul Duffin
479605bed7 Merge changes I6b868bac,If75f4718
* changes:
  Migrate android package to a per test build directory
  Convert android/path_properties_test.go to test fixtures
2021-03-19 17:28:38 +00:00
Colin Cross
d2db7953a0 Merge changes Iab4e09d9,Icf2f24dd,I15be5ef1,Ic0db9619
* changes:
  Run lint actions in sbox
  Support sbox-in-RBE
  Move android package on top of remotexec
  Support sandboxing inputs in RuleBuilder
2021-03-19 17:25:14 +00:00
Julien Desprez
2dc86b2956 Migrate manifest_*_test out of test mapping
Unit tests do not require an explicit TEST_MAPPING config

Change-Id: Ieccebc78a26b9555803a2278e2962d0b388a6957
Test: presubmit
Bug: 183209529
2021-03-19 17:16:16 +00:00
Yi Kong
00d54280d0 Merge "[strip.sh] Move remaining GNU binutils usage to llvm binutils" 2021-03-19 15:32:49 +00:00
Paul Duffin
54a5e9a467 Merge "Remove javaMockFS()" 2021-03-19 14:18:46 +00:00
Paul Duffin
89fbdb2387 Merge "Fix TestTurbine to work without javaMockFS()" 2021-03-19 11:11:42 +00:00
Paul Duffin
64df56def9 Merge "Fix testDexpreoptBoot to work without javaMockFS()" 2021-03-19 11:09:21 +00:00
Paul Duffin
750f8f3515 Merge "Fix TestClasspath to work without javaMockFS()" 2021-03-19 11:08:35 +00:00
Paul Duffin
903a8a08ab Merge "Convert TestClasspath to test fixtures" 2021-03-19 11:08:17 +00:00
Jingwen Chen
b1672af5d2 Merge "bp2build: cc_library_headers converter should only include that module type" 2021-03-19 09:18:15 +00:00
Yi Kong
ad50ce8349 [strip.sh] Move remaining GNU binutils usage to llvm binutils
With clang r377782, llvm binutils implements all the necessary
funtionaility for strip.sh. We can finally get rid of all the fallback
GNU binutils usage.

Test: m
Bug: 141010852
Bug: 135627985
Change-Id: I110f6028dab7f599decf59a5cb1b927b35e11857
2021-03-19 12:28:44 +08:00
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
Inseob Kim
fc8e9c7f00 Merge "Add sepolicy related variables" 2021-03-19 00:07:58 +00:00
Justin Yun
b1d5479783 Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" 2021-03-18 23:33:43 +00:00