Commit graph

27 commits

Author SHA1 Message Date
Colin Cross
5dc62c9456 Add sanitizer tests for musl
Add tests that verify sanitizer behaviors for musl.

Test: sanitize_test.go
Change-Id: I1f0a51cc103ac14d1738cb223e216ee0e32d8550
2023-03-22 12:58:38 -07:00
Zi Wang
0f82844b75 Add variant_prepend test for cc_library
The comments in aosp/2336916 are also addressed here

Test: TH and TestCcLibraryVariantPrependPropOrder
Change-Id: If1472658fcd4b5544dec2e2691049a180520c84e
2022-12-28 11:18:11 -08:00
Colin Cross
f05b0d35d2 Add riscv64-linux-android support
Add barebones riscv64-linux-android support.  This should be enough
to add riscv64-specific entries to Android.bp files, but can't
actually compile anything until there are riscv64 toolchains.

Test: arch_test.go
Change-Id: I0dcc7e797d9352dd38243be908a7f19004ff3db1
2022-10-03 08:43:13 -07:00
Colin Cross
c0f0eb86db Make FirstTarget treat HostCross separately from Host
Use Target.Os and Target.HostCross as the key in FirstTarget so that
it returns a separate target for host and host cross architectures.
This is useful when host and host cross are both linux_musl, but
host cross is an independenct architecture like arm64.

Also filter the targets returned by ctx.MultiTargets() to match
the HostCross value of ctx.Target() to prevent the newly created
HostCross variants from colliding with Host variants in JNI or
test data attached to Java targets using a common arch.

This relands If75790001afe9d0f9d4d8166f207847851812297 with the
addition of the ctx.MultiTargets() filtering.

Bug: 236052820
Test: TestArchMutator
Change-Id: Ia6fe1185915d174d0ad6b401c227e0e57bee5c24
2022-08-22 14:36:13 -07:00
Liz Kammer
ff966b137e Remove unused bp2build logic from arch.go
Test: go test soong tests
Change-Id: I8a99e3d22b835f6e0d0b16543c738315c6abc4ce
2022-08-01 16:07:45 -04:00
Colin Cross
e91ea2a94a Remove linux_glibc musl hack
Stop using linux_glibc properties when musl is enabled.

Bug: 223257095
Test: m USE_HOST_MUSL host-native -k
Change-Id: I63cd485ef64c617bd81f3e598395da21bd71ccbb
2022-03-29 22:42:11 -07:00
Colin Cross
a98d36de64 Add host_linux target properties
Add host_linux to the target properties, which will apply to linux_glibc,
linux_bionic or linux_musl.  This will eventually undo the hack that
makes the linux_glibc properties apply to linux_musl.

Bug: 223257095
Test: TestArchProperties
Change-Id: Iccf51ed13c363ce1da04333a277fa49c33d45b9a
2022-03-07 14:56:33 -08:00
Liz Kammer
e8303bd0ae Export variant/features via soong_injection
Test: build/bazel/ci/bp2build.sh
Change-Id: If70043dc9d020d5f4a243ba4b192b99c9c7e8563
2022-02-28 14:17:15 -05:00
Colin Cross
528d67e523 Reland "Split the x86 host toolchain into glibc and musl variants"
Split the x86 host toolchain into glibc and musl variants

Create new musl toolchains that are based on the existing glibc
toolchains, and add the necessary flags for musl compiles.

This relands Ifc02f9e5afa61ff758be98b0c962f3a4b53d0546 with changes
for I46672e3a096b6ea94ff4c10e1c31e8fd010a163c.

Bug: 190084016
Change-Id: Iaa9f7a50ff601155ecd73acc5701a2c226be66dc
Test: TestArchMutator
2021-07-23 22:25:36 +00:00
Colin Cross
5d6904e1cf Revert "Split the x86 host toolchain into glibc and musl variants"
This reverts commit 4fb4ef2242.

Reason for revert: crossed with aosp/1775072

Change-Id: Ied922850b810d82627ba4f9ee42f672cfe286c91
2021-07-23 22:20:29 +00:00
Colin Cross
4fb4ef2242 Split the x86 host toolchain into glibc and musl variants
Create new musl toolchains that are based on the existing glibc
toolchains, and add the necessary flags for musl compiles.

Bug: 190084016
Test: TestArchMutator
Change-Id: Ifc02f9e5afa61ff758be98b0c962f3a4b53d0546
2021-07-23 08:57:17 -07:00
Colin Cross
4e87990cf2 Reland "Add TestArchProperties"
Add a test that verifies appropriate arch properties are squashed
into each variant.

This relands I4a5044f3b2b3ca0a51dc457dec7157411ebad7e3 with a fix for the darwin test.

Test: TestArchProperties
Change-Id: I7e71eb839856c7121c60713c480df09f30f3cd7c
2021-07-23 00:21:00 +00:00
Colin Cross
239de0ac22 Revert "Add TestArchProperties"
This reverts commit 34c32fabea.

Reason for revert: broke mac build

Change-Id: Ibe9d854f65e5ae109ba690e878946e212016434f
2021-07-23 00:17:54 +00:00
Colin Cross
34c32fabea Add TestArchProperties
Add a test that verifies appropriate arch properties are squashed
into each variant.

Test: TestArchProperties
Change-Id: I4a5044f3b2b3ca0a51dc457dec7157411ebad7e3
2021-07-20 16:46:30 -07:00
Liz Kammer
4562a3b218 Add bp2build arch-specific paths mutator
Adds deps for properties tagged `android:"path"` within arch, multilib,
and target properties.

Test: build/bazel/ci/bp2build.sh
Test: m nothing
Bug: 185217298
Change-Id: I0230da399d2c4e984b837f69523fa09eadba3ff1
2021-04-21 18:21:50 -04:00
Paul Duffin
30ac3e7ca7 Remove uses of FixtureFactory from android package
Bug: 183235980
Test: m nothing
Change-Id: I72898ada020ee1a73fd534c61afb5c22fa00c1e5
2021-03-22 18:31:53 +00:00
Paul Duffin
738a6d5bc4 Convert android/arch_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: I4c9c133a1560731869fa5e8fdd81ecc4f54f4821
2021-03-17 16:18:10 +00:00
Colin Cross
ae8600b507 Pass Config to NewTestContext instead of ctx.Register
Prepare for using Config when adding singletons by passing
Config to NewTestContext and NewContext instead of to ctx.Register.
This will enable a followup change to store SingletonMakeVarsProviders
registered on the Context in the Config, which is necessary to run
multiple tests in parallel without data races.

Test: all soong tests
Change-Id: Id229629a4e42ff4487d317241673837726c075fc
2020-11-12 10:07:49 -08:00
Colin Cross
405af07859 Revert "Make lots of tests run in parallel"
This reverts commit 323dc60712.

Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests

Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-09 18:34:24 -07:00
Colin Cross
323dc60712 Make lots of tests run in parallel
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.

Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
2020-10-06 15:12:22 -07:00
Victor Khimenko
c26fcf4947 Make it possible to specify separate rules for native_bridge case
This change make it possible to specify separate rules for native-bridge
case and non-native-bridge case.

Bug: http://b/153609531

Test: build 4arch product

Change-Id: I60145bbb9c94318f14af3cabd9f5960fc9ee62de
2020-06-09 13:31:37 +02:00
Colin Cross
b4fecbfef4 Do a better job removing tags from arch structs
Remove more android struct tags from runtime created arch structs
to reduce the size of their names, which hit the 64kB limit in
runtime.StructOf if they are too long.

Bug: 146234651
Test: m checkbuild
Change-Id: I6362765275b93c8932eb0b1abbcb4be47031d9b1
2020-01-22 18:30:56 -08:00
Colin Cross
98be1bb00f Move filesystem into Config
The filesystem object was available through ModuleContext.Fs(), but
gives too much access to the filesystem without enforicing correct
dependencies.  In order to support sandboxing the soong_build
process move the filesystem into the Config.  The next change will
make it private.

Bug: 146437378
Test: all Soong tests
Change-Id: I5d3ae9108f120fd335b21efd612aefa078378813
2019-12-18 08:19:10 -08:00
Colin Cross
4b49b768a2 Make TestContext.RegisterModuleType take an android.ModuleFactory
Avoid having to pass ModuleFactoryAdaptor to every call to
RegisterModuleType in a test by wrapping RegisterModuleType.

Test: all soong tests
Change-Id: If8847d16487de0479cc3020b728256922b3cadba
2019-11-25 10:59:44 -08:00
Colin Cross
158eeb7701 Add arch mutator test
Add a test for the arch mutator in preparation for splitting it
into two mutators.

Test: m checkbuild
Change-Id: Ifd0a146a085901d33db50e783bdfad31edd7b7a6
2019-10-16 15:27:23 -07:00
Colin Cross
7444910e93 Move arch properties to proptools.FilterPropertyStruct
Test: m checkbuild
Change-Id: I85c5e6c86aea4ccf5bcddc2e5d468d66e0b38671
2019-09-26 15:03:07 -07:00
Colin Cross
cb9880786d Optimize filterArchStruct when nothing is filtered
Runtime-created struct types have limit on the name of the type,
which is the full text of the fields in the struct.  Avoid creating
runtime struct types when filtering produces an identical struct.
Also add tests and godoc for filterArchStruct.

Test: arch_test.go
Change-Id: If7eb27ea9e72073d5252e93f2110b08889ed76b1
2019-01-25 21:26:53 +00:00