Loading android/fixture.go +7 −6 Original line number Diff line number Diff line Loading @@ -466,12 +466,13 @@ type FixturePreparer interface { // Run the test, checking any errors reported and returning a TestResult instance. // // Shorthand for Fixture(t, preparers...).RunTest() RunTest(t *testing.T, preparers ...FixturePreparer) *TestResult // Shorthand for Fixture(t).RunTest() RunTest(t *testing.T) *TestResult // Run the test with the supplied Android.bp file. // // Shorthand for RunTest(t, android.FixtureWithRootAndroidBp(bp)) // preparer.RunTestWithBp(t, bp) is shorthand for // android.GroupFixturePreparers(preparer, android.FixtureWithRootAndroidBp(bp)).RunTest(t) RunTestWithBp(t *testing.T, bp string) *TestResult // RunTestWithConfig is a temporary method added to help ease the migration of existing tests to Loading Loading @@ -750,15 +751,15 @@ func (b *baseFixturePreparer) ExtendWithErrorHandler(errorHandler FixtureErrorHa })) } func (b *baseFixturePreparer) RunTest(t *testing.T, preparers ...FixturePreparer) *TestResult { func (b *baseFixturePreparer) RunTest(t *testing.T) *TestResult { t.Helper() fixture := b.self.Fixture(t, preparers...) fixture := b.self.Fixture(t) return fixture.RunTest() } func (b *baseFixturePreparer) RunTestWithBp(t *testing.T, bp string) *TestResult { t.Helper() return b.RunTest(t, FixtureWithRootAndroidBp(bp)) return GroupFixturePreparers(b.self, FixtureWithRootAndroidBp(bp)).RunTest(t) } func (b *baseFixturePreparer) RunTestWithConfig(t *testing.T, config Config) *TestResult { Loading java/java_test.go +6 −1 Original line number Diff line number Diff line Loading @@ -845,7 +845,12 @@ func TestJavaSdkLibraryEnforce(t *testing.T) { if expectedErrorPattern != "" { errorHandler = android.FixtureExpectsAtLeastOneErrorMatchingPattern(expectedErrorPattern) } prepareForJavaTest.ExtendWithErrorHandler(errorHandler).RunTest(t, createPreparer(info)) android.GroupFixturePreparers( prepareForJavaTest, createPreparer(info), ). ExtendWithErrorHandler(errorHandler). RunTest(t) }) } Loading java/system_modules_test.go +5 −4 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ var addSourceSystemModules = android.FixtureAddTextFile("source/Android.bp", ` `) func TestJavaSystemModules(t *testing.T) { result := prepareForJavaTest.RunTest(t, addSourceSystemModules) result := android.GroupFixturePreparers(prepareForJavaTest, addSourceSystemModules).RunTest(t) // check the existence of the source module sourceSystemModules := result.ModuleForTests("system-modules", "android_common") Loading @@ -77,7 +77,7 @@ var addPrebuiltSystemModules = android.FixtureAddTextFile("prebuilts/Android.bp" `) func TestJavaSystemModulesImport(t *testing.T) { result := prepareForJavaTest.RunTest(t, addPrebuiltSystemModules) result := android.GroupFixturePreparers(prepareForJavaTest, addPrebuiltSystemModules).RunTest(t) // check the existence of the renamed prebuilt module prebuiltSystemModules := result.ModuleForTests("system-modules", "android_common") Loading @@ -89,10 +89,11 @@ func TestJavaSystemModulesImport(t *testing.T) { } func TestJavaSystemModulesMixSourceAndPrebuilt(t *testing.T) { result := prepareForJavaTest.RunTest(t, result := android.GroupFixturePreparers( prepareForJavaTest, addSourceSystemModules, addPrebuiltSystemModules, ) ).RunTest(t) // check the existence of the source module sourceSystemModules := result.ModuleForTests("system-modules", "android_common") Loading sdk/testing.go +4 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,10 @@ var PrepareForTestWithSdkBuildComponents = android.GroupFixturePreparers( func testSdkWithFs(t *testing.T, bp string, fs android.MockFS) *android.TestResult { t.Helper() return prepareForSdkTest.RunTest(t, fs.AddToFixture(), android.FixtureWithRootAndroidBp(bp)) return android.GroupFixturePreparers( prepareForSdkTest, fs.AddToFixture(), ).RunTestWithBp(t, bp) } func testSdkError(t *testing.T, pattern, bp string) { Loading Loading
android/fixture.go +7 −6 Original line number Diff line number Diff line Loading @@ -466,12 +466,13 @@ type FixturePreparer interface { // Run the test, checking any errors reported and returning a TestResult instance. // // Shorthand for Fixture(t, preparers...).RunTest() RunTest(t *testing.T, preparers ...FixturePreparer) *TestResult // Shorthand for Fixture(t).RunTest() RunTest(t *testing.T) *TestResult // Run the test with the supplied Android.bp file. // // Shorthand for RunTest(t, android.FixtureWithRootAndroidBp(bp)) // preparer.RunTestWithBp(t, bp) is shorthand for // android.GroupFixturePreparers(preparer, android.FixtureWithRootAndroidBp(bp)).RunTest(t) RunTestWithBp(t *testing.T, bp string) *TestResult // RunTestWithConfig is a temporary method added to help ease the migration of existing tests to Loading Loading @@ -750,15 +751,15 @@ func (b *baseFixturePreparer) ExtendWithErrorHandler(errorHandler FixtureErrorHa })) } func (b *baseFixturePreparer) RunTest(t *testing.T, preparers ...FixturePreparer) *TestResult { func (b *baseFixturePreparer) RunTest(t *testing.T) *TestResult { t.Helper() fixture := b.self.Fixture(t, preparers...) fixture := b.self.Fixture(t) return fixture.RunTest() } func (b *baseFixturePreparer) RunTestWithBp(t *testing.T, bp string) *TestResult { t.Helper() return b.RunTest(t, FixtureWithRootAndroidBp(bp)) return GroupFixturePreparers(b.self, FixtureWithRootAndroidBp(bp)).RunTest(t) } func (b *baseFixturePreparer) RunTestWithConfig(t *testing.T, config Config) *TestResult { Loading
java/java_test.go +6 −1 Original line number Diff line number Diff line Loading @@ -845,7 +845,12 @@ func TestJavaSdkLibraryEnforce(t *testing.T) { if expectedErrorPattern != "" { errorHandler = android.FixtureExpectsAtLeastOneErrorMatchingPattern(expectedErrorPattern) } prepareForJavaTest.ExtendWithErrorHandler(errorHandler).RunTest(t, createPreparer(info)) android.GroupFixturePreparers( prepareForJavaTest, createPreparer(info), ). ExtendWithErrorHandler(errorHandler). RunTest(t) }) } Loading
java/system_modules_test.go +5 −4 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ var addSourceSystemModules = android.FixtureAddTextFile("source/Android.bp", ` `) func TestJavaSystemModules(t *testing.T) { result := prepareForJavaTest.RunTest(t, addSourceSystemModules) result := android.GroupFixturePreparers(prepareForJavaTest, addSourceSystemModules).RunTest(t) // check the existence of the source module sourceSystemModules := result.ModuleForTests("system-modules", "android_common") Loading @@ -77,7 +77,7 @@ var addPrebuiltSystemModules = android.FixtureAddTextFile("prebuilts/Android.bp" `) func TestJavaSystemModulesImport(t *testing.T) { result := prepareForJavaTest.RunTest(t, addPrebuiltSystemModules) result := android.GroupFixturePreparers(prepareForJavaTest, addPrebuiltSystemModules).RunTest(t) // check the existence of the renamed prebuilt module prebuiltSystemModules := result.ModuleForTests("system-modules", "android_common") Loading @@ -89,10 +89,11 @@ func TestJavaSystemModulesImport(t *testing.T) { } func TestJavaSystemModulesMixSourceAndPrebuilt(t *testing.T) { result := prepareForJavaTest.RunTest(t, result := android.GroupFixturePreparers( prepareForJavaTest, addSourceSystemModules, addPrebuiltSystemModules, ) ).RunTest(t) // check the existence of the source module sourceSystemModules := result.ModuleForTests("system-modules", "android_common") Loading
sdk/testing.go +4 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,10 @@ var PrepareForTestWithSdkBuildComponents = android.GroupFixturePreparers( func testSdkWithFs(t *testing.T, bp string, fs android.MockFS) *android.TestResult { t.Helper() return prepareForSdkTest.RunTest(t, fs.AddToFixture(), android.FixtureWithRootAndroidBp(bp)) return android.GroupFixturePreparers( prepareForSdkTest, fs.AddToFixture(), ).RunTestWithBp(t, bp) } func testSdkError(t *testing.T, pattern, bp string) { Loading