Export RunBp2BuildTestCaseSimple() in testing.go

This is to support the migration of conversion tests to be next
to the files they're testing

Bug: 242070498
Test: m bp2build
Change-Id: I66243d420743273e7ebad70886cfe690740182c4
This commit is contained in:
Trevor Radcliffe 2022-09-01 18:57:01 +00:00
parent 6faa161557
commit 1b4b2d9209
8 changed files with 23 additions and 23 deletions

View file

@ -751,7 +751,7 @@ func TestBp2buildHostAndDevice(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.Description, func(t *testing.T) {
runBp2BuildTestCaseSimple(t, tc)
RunBp2BuildTestCaseSimple(t, tc)
})
}
}
@ -1494,7 +1494,7 @@ func TestGlobExcludeSrcs(t *testing.T) {
for _, testCase := range testCases {
t.Run(testCase.Description, func(t *testing.T) {
runBp2BuildTestCaseSimple(t, testCase)
RunBp2BuildTestCaseSimple(t, testCase)
})
}
}
@ -1593,7 +1593,7 @@ filegroup {
for _, tc := range testCases {
t.Run(tc.Description, func(t *testing.T) {
runBp2BuildTestCaseSimple(t, tc)
RunBp2BuildTestCaseSimple(t, tc)
})
}
}

View file

@ -21,7 +21,7 @@ import (
)
func TestPrebuiltLibraryStaticAndSharedSimple(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library static and shared simple",
ModuleTypeUnderTest: "cc_prebuilt_library",
@ -47,7 +47,7 @@ cc_prebuilt_library {
}
func TestPrebuiltLibraryWithArchVariance(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library with arch variance",
ModuleTypeUnderTest: "cc_prebuilt_library",
@ -85,7 +85,7 @@ cc_prebuilt_library {
}
func TestPrebuiltLibraryAdditionalAttrs(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library additional attributes",
ModuleTypeUnderTest: "cc_prebuilt_library",
@ -118,7 +118,7 @@ cc_prebuilt_library {
}
func TestPrebuiltLibrarySharedStanzaFails(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library with shared stanza fails because multiple sources",
ModuleTypeUnderTest: "cc_prebuilt_library",
@ -141,7 +141,7 @@ cc_prebuilt_library {
}
func TestPrebuiltLibraryStaticStanzaFails(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library with static stanza fails because multiple sources",
ModuleTypeUnderTest: "cc_prebuilt_library",
@ -164,7 +164,7 @@ cc_prebuilt_library {
}
func TestPrebuiltLibrarySharedAndStaticStanzas(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library with both shared and static stanzas",
ModuleTypeUnderTest: "cc_prebuilt_library",
@ -197,7 +197,7 @@ cc_prebuilt_library {
// TODO(b/228623543): When this bug is fixed, enable this test
//func TestPrebuiltLibraryOnlyShared(t *testing.T) {
// runBp2BuildTestCaseSimple(t,
// RunBp2BuildTestCaseSimple(t,
// bp2buildTestCase{
// description: "prebuilt library shared only",
// moduleTypeUnderTest: "cc_prebuilt_library",
@ -224,7 +224,7 @@ cc_prebuilt_library {
// TODO(b/228623543): When this bug is fixed, enable this test
//func TestPrebuiltLibraryOnlyStatic(t *testing.T) {
// runBp2BuildTestCaseSimple(t,
// RunBp2BuildTestCaseSimple(t,
// bp2buildTestCase{
// description: "prebuilt library static only",
// moduleTypeUnderTest: "cc_prebuilt_library",

View file

@ -8,7 +8,7 @@ import (
)
func TestSharedPrebuiltLibrary(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library shared simple",
ModuleTypeUnderTest: "cc_prebuilt_library_shared",
@ -31,7 +31,7 @@ cc_prebuilt_library_shared {
}
func TestSharedPrebuiltLibraryWithArchVariance(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library shared with arch variance",
ModuleTypeUnderTest: "cc_prebuilt_library_shared",
@ -62,7 +62,7 @@ cc_prebuilt_library_shared {
}
func TestSharedPrebuiltLibrarySharedStanzaFails(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library shared with shared stanza fails because multiple sources",
ModuleTypeUnderTest: "cc_prebuilt_library_shared",

View file

@ -21,7 +21,7 @@ import (
)
func TestStaticPrebuiltLibrary(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library static simple",
ModuleTypeUnderTest: "cc_prebuilt_library_static",
@ -44,7 +44,7 @@ cc_prebuilt_library_static {
}
func TestStaticPrebuiltLibraryWithArchVariance(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library static with arch variance",
ModuleTypeUnderTest: "cc_prebuilt_library_static",
@ -75,7 +75,7 @@ cc_prebuilt_library_static {
}
func TestStaticPrebuiltLibraryStaticStanzaFails(t *testing.T) {
runBp2BuildTestCaseSimple(t,
RunBp2BuildTestCaseSimple(t,
Bp2buildTestCase{
Description: "prebuilt library with static stanza fails because multiple sources",
ModuleTypeUnderTest: "cc_prebuilt_library_static",

View file

@ -25,7 +25,7 @@ func runLinkerConfigTestCase(t *testing.T, tc Bp2buildTestCase) {
t.Helper()
(&tc).ModuleTypeUnderTest = "linker_config"
(&tc).ModuleTypeUnderTestFactory = linkerconfig.LinkerConfigFactory
runBp2BuildTestCaseSimple(t, tc)
RunBp2BuildTestCaseSimple(t, tc)
}
func TestLinkerConfigConvertsSrc(t *testing.T) {

View file

@ -62,7 +62,7 @@ func TestPythonBinaryHostSimple(t *testing.T) {
}
func TestPythonBinaryHostPy2(t *testing.T) {
runBp2BuildTestCaseSimple(t, Bp2buildTestCase{
RunBp2BuildTestCaseSimple(t, Bp2buildTestCase{
Description: "py2 python_binary_host",
ModuleTypeUnderTest: "python_binary_host",
ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
@ -96,7 +96,7 @@ func TestPythonBinaryHostPy2(t *testing.T) {
}
func TestPythonBinaryHostPy3(t *testing.T) {
runBp2BuildTestCaseSimple(t, Bp2buildTestCase{
RunBp2BuildTestCaseSimple(t, Bp2buildTestCase{
Description: "py3 python_binary_host",
ModuleTypeUnderTest: "python_binary_host",
ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
@ -130,7 +130,7 @@ func TestPythonBinaryHostPy3(t *testing.T) {
}
func TestPythonBinaryHostArchVariance(t *testing.T) {
runBp2BuildTestCaseSimple(t, Bp2buildTestCase{
RunBp2BuildTestCaseSimple(t, Bp2buildTestCase{
Description: "test arch variants",
ModuleTypeUnderTest: "python_binary_host",
ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,

View file

@ -66,7 +66,7 @@ func runPythonLibraryTestCase(t *testing.T, tc pythonLibBp2BuildTestCase) {
testCase.ModuleTypeUnderTest = "python_library"
testCase.ModuleTypeUnderTestFactory = python.PythonLibraryFactory
runBp2BuildTestCaseSimple(t, testCase)
RunBp2BuildTestCaseSimple(t, testCase)
}
func runPythonLibraryHostTestCase(t *testing.T, tc pythonLibBp2BuildTestCase) {

View file

@ -71,7 +71,7 @@ func errored(t *testing.T, tc Bp2buildTestCase, errs []error) bool {
return false
}
func runBp2BuildTestCaseSimple(t *testing.T, tc Bp2buildTestCase) {
func RunBp2BuildTestCaseSimple(t *testing.T, tc Bp2buildTestCase) {
t.Helper()
RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
}