Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8d9a337 authored by Paul Duffin's avatar Paul Duffin Committed by Gerrit Code Review
Browse files

Merge "Add test fixture support"

parents 7e52be84 35816123
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ bootstrap_go_package {
        "deptag.go",
        "expand.go",
        "filegroup.go",
        "fixture.go",
        "hooks.go",
        "image.go",
        "license.go",
@@ -87,6 +88,7 @@ bootstrap_go_package {
        "depset_test.go",
        "deptag_test.go",
        "expand_test.go",
        "fixture_test.go",
        "license_kind_test.go",
        "license_test.go",
        "licenses_test.go",
+2 −0
Original line number Diff line number Diff line
@@ -44,3 +44,5 @@ func TestMain(m *testing.M) {

	os.Exit(run())
}

var emptyTestFixtureFactory = NewFixtureFactory(&buildDir)
+7 −4
Original line number Diff line number Diff line
@@ -305,10 +305,7 @@ func TestArchConfigFuchsia(buildDir string, env map[string]string, bp string, fs
	return testConfig
}

// TestArchConfig returns a Config object suitable for using for tests that
// need to run the arch mutator.
func TestArchConfig(buildDir string, env map[string]string, bp string, fs map[string][]byte) Config {
	testConfig := TestConfig(buildDir, env, bp, fs)
func modifyTestConfigToSupportArchMutator(testConfig Config) {
	config := testConfig.config

	config.Targets = map[OsType][]Target{
@@ -334,7 +331,13 @@ func TestArchConfig(buildDir string, env map[string]string, bp string, fs map[st
	config.TestProductVariables.DeviceArchVariant = proptools.StringPtr("armv8-a")
	config.TestProductVariables.DeviceSecondaryArch = proptools.StringPtr("arm")
	config.TestProductVariables.DeviceSecondaryArchVariant = proptools.StringPtr("armv7-a-neon")
}

// TestArchConfig returns a Config object suitable for using for tests that
// need to run the arch mutator.
func TestArchConfig(buildDir string, env map[string]string, bp string, fs map[string][]byte) Config {
	testConfig := TestConfig(buildDir, env, bp, fs)
	modifyTestConfigToSupportArchMutator(testConfig)
	return testConfig
}

+4 −0
Original line number Diff line number Diff line
@@ -24,6 +24,10 @@ func init() {
	RegisterBp2BuildMutator("filegroup", FilegroupBp2Build)
}

var PrepareForTestWithFilegroup = FixtureRegisterWithContext(func(ctx RegistrationContext) {
	ctx.RegisterModuleType("filegroup", FileGroupFactory)
})

// https://docs.bazel.build/versions/master/be/general.html#filegroup
type bazelFilegroupAttributes struct {
	Srcs bazel.LabelList

android/fixture.go

0 → 100644
+604 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading