Commit graph

16 commits

Author SHA1 Message Date
Colin Cross
8ff105860d Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.

Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
2023-12-08 13:51:05 -08:00
Zi Wang
aa981edcf0 Incorporate bpf into mixed builds
Bug: 240163393
Test: TestBpfWithBazel in bpf_test.go
Change-Id: I1d24a9c0d1d6911987c730bf1b5b7e02d6e73a5e
2022-10-07 18:30:45 +00:00
Ken Chen
5372a24375 Disallow '_' in bpf source name
Current design:
1. The bpf compiled object name is derived from the source name
   (e.g. foo.c -> foo.o).
2. Full bpf program/map name are concatenated by object name + '_' +
   program/map name in run-time. (e.g. obj name: x.o; program name: y_z;
   full bpf program name will be x_y_z)

Issue:
x.o with map y_z and x_y.o with map z can cause naming collision in
run-time, since both result in x_y_z. This commit prevents it from
happening with a build-time check.

Bug: 236706995
Test: m
Change-Id: Ic03bfcf07a5748ed63246b71d5ae8de0405e658a
2022-07-07 20:02:28 +08:00
Paul Duffin
89648f98fa Remove usages of FixtureFactory from misc packages
These packages have already been migrated to use per test build
directory so have no need for a FixtureFactory.

Bug: 183235980
Test: m nothing
Change-Id: I667d1d992caaf0f615de91f89efdae11c44986c2
2021-03-22 18:31:53 +00:00
Paul Duffin
854d661572 Migrate bpf package to a per test build directory
Bug: 182885307
Test: m nothing
Change-Id: I0ee9575af056057ca37831a3afebba2be1e54d27
2021-03-17 16:10:55 +00:00
Paul Duffin
12c7eb8cb1 Support test fixtures in bpf package
Restructures the bpf package test setup code to create FixturePreparer
instances for setting up a test fixture and converts the test to use
it.

Bug: 181070625
Test: m nothing
Change-Id: I7c76ed6dc292ca92d76ef95c4167f7ca2d68e1af
2021-03-09 23:07:17 +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
markchien
2f59ec98d1 Include bpf program in APEXes
bpf program is put to an APEX via 'bpfs' property. It is
placed under etc/bpf directory in it.

Fix: 167530625
Test: m
Change-Id: Ia36b486f0cffb619ecc4f7a318cde881abc5baf4
2020-09-02 22:18:25 +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
815daf95b2 Add bpf_test.go to build and fix tests
bpf_test.go was not listed in testSrcs, which meant it was not run
during the build, but ran and failed with go test android/soong/...

Don't redeclare the cc module types and mutators, use exported
functions from cc/testing.go instead, which contain a new
dependency needed by cc modules.

This reapplies I4542640e8ff08e71565ed50617dbe67d86b29b69 after
fixes for mac tests.

Test: m
Test: go test android/soong/...
Change-Id: I3dc3fdedbd7063df4a2e0cadf2a4e0711b1823ad
2019-05-17 08:43:36 -07:00
Colin Cross
d3d3ad1686 Revert "Add bpf_test.go to build and fix the tests"
This reverts commit 192e3aa6a8.

Reason for revert: broke mac tests

Change-Id: I3f4c679e11d9361dbc2daaf6c89282259b225d61
2019-05-14 22:46:24 +00:00
Colin Cross
192e3aa6a8 Add bpf_test.go to build and fix the tests
bpf_test.go was not listed in testSrcs, which meant it was not run
during the build, but ran and failed with go test android/soong/...

Test: m
Test: go test android/soong/...
Change-Id: I4542640e8ff08e71565ed50617dbe67d86b29b69
2019-05-14 18:40:19 +00:00
Jaewoong Jung
5f3fb4bad1 Make bpf implement SourceFileProducer.
This allows other modules depend on bpf object outputs via the data
property.

Bug: 120246361
Test: bpf_test.go
Change-Id: I2ba9b9fea4d60f896d16f34053eb04513eae30ea
2018-12-17 07:18:39 -08:00