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:
@@ -751,7 +751,7 @@ func TestBp2buildHostAndDevice(t *testing.T) {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(tc.Description, func(t *testing.T) {
|
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 {
|
for _, testCase := range testCases {
|
||||||
t.Run(testCase.Description, func(t *testing.T) {
|
t.Run(testCase.Description, func(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t, testCase)
|
RunBp2BuildTestCaseSimple(t, testCase)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1593,7 +1593,7 @@ filegroup {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(tc.Description, func(t *testing.T) {
|
t.Run(tc.Description, func(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t, tc)
|
RunBp2BuildTestCaseSimple(t, tc)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestPrebuiltLibraryStaticAndSharedSimple(t *testing.T) {
|
func TestPrebuiltLibraryStaticAndSharedSimple(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library static and shared simple",
|
Description: "prebuilt library static and shared simple",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library",
|
ModuleTypeUnderTest: "cc_prebuilt_library",
|
||||||
@@ -47,7 +47,7 @@ cc_prebuilt_library {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPrebuiltLibraryWithArchVariance(t *testing.T) {
|
func TestPrebuiltLibraryWithArchVariance(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library with arch variance",
|
Description: "prebuilt library with arch variance",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library",
|
ModuleTypeUnderTest: "cc_prebuilt_library",
|
||||||
@@ -85,7 +85,7 @@ cc_prebuilt_library {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPrebuiltLibraryAdditionalAttrs(t *testing.T) {
|
func TestPrebuiltLibraryAdditionalAttrs(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library additional attributes",
|
Description: "prebuilt library additional attributes",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library",
|
ModuleTypeUnderTest: "cc_prebuilt_library",
|
||||||
@@ -118,7 +118,7 @@ cc_prebuilt_library {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPrebuiltLibrarySharedStanzaFails(t *testing.T) {
|
func TestPrebuiltLibrarySharedStanzaFails(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library with shared stanza fails because multiple sources",
|
Description: "prebuilt library with shared stanza fails because multiple sources",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library",
|
ModuleTypeUnderTest: "cc_prebuilt_library",
|
||||||
@@ -141,7 +141,7 @@ cc_prebuilt_library {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPrebuiltLibraryStaticStanzaFails(t *testing.T) {
|
func TestPrebuiltLibraryStaticStanzaFails(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library with static stanza fails because multiple sources",
|
Description: "prebuilt library with static stanza fails because multiple sources",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library",
|
ModuleTypeUnderTest: "cc_prebuilt_library",
|
||||||
@@ -164,7 +164,7 @@ cc_prebuilt_library {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPrebuiltLibrarySharedAndStaticStanzas(t *testing.T) {
|
func TestPrebuiltLibrarySharedAndStaticStanzas(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library with both shared and static stanzas",
|
Description: "prebuilt library with both shared and static stanzas",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library",
|
ModuleTypeUnderTest: "cc_prebuilt_library",
|
||||||
@@ -197,7 +197,7 @@ cc_prebuilt_library {
|
|||||||
|
|
||||||
// TODO(b/228623543): When this bug is fixed, enable this test
|
// TODO(b/228623543): When this bug is fixed, enable this test
|
||||||
//func TestPrebuiltLibraryOnlyShared(t *testing.T) {
|
//func TestPrebuiltLibraryOnlyShared(t *testing.T) {
|
||||||
// runBp2BuildTestCaseSimple(t,
|
// RunBp2BuildTestCaseSimple(t,
|
||||||
// bp2buildTestCase{
|
// bp2buildTestCase{
|
||||||
// description: "prebuilt library shared only",
|
// description: "prebuilt library shared only",
|
||||||
// moduleTypeUnderTest: "cc_prebuilt_library",
|
// moduleTypeUnderTest: "cc_prebuilt_library",
|
||||||
@@ -224,7 +224,7 @@ cc_prebuilt_library {
|
|||||||
|
|
||||||
// TODO(b/228623543): When this bug is fixed, enable this test
|
// TODO(b/228623543): When this bug is fixed, enable this test
|
||||||
//func TestPrebuiltLibraryOnlyStatic(t *testing.T) {
|
//func TestPrebuiltLibraryOnlyStatic(t *testing.T) {
|
||||||
// runBp2BuildTestCaseSimple(t,
|
// RunBp2BuildTestCaseSimple(t,
|
||||||
// bp2buildTestCase{
|
// bp2buildTestCase{
|
||||||
// description: "prebuilt library static only",
|
// description: "prebuilt library static only",
|
||||||
// moduleTypeUnderTest: "cc_prebuilt_library",
|
// moduleTypeUnderTest: "cc_prebuilt_library",
|
||||||
|
@@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestSharedPrebuiltLibrary(t *testing.T) {
|
func TestSharedPrebuiltLibrary(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library shared simple",
|
Description: "prebuilt library shared simple",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library_shared",
|
ModuleTypeUnderTest: "cc_prebuilt_library_shared",
|
||||||
@@ -31,7 +31,7 @@ cc_prebuilt_library_shared {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSharedPrebuiltLibraryWithArchVariance(t *testing.T) {
|
func TestSharedPrebuiltLibraryWithArchVariance(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library shared with arch variance",
|
Description: "prebuilt library shared with arch variance",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library_shared",
|
ModuleTypeUnderTest: "cc_prebuilt_library_shared",
|
||||||
@@ -62,7 +62,7 @@ cc_prebuilt_library_shared {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSharedPrebuiltLibrarySharedStanzaFails(t *testing.T) {
|
func TestSharedPrebuiltLibrarySharedStanzaFails(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library shared with shared stanza fails because multiple sources",
|
Description: "prebuilt library shared with shared stanza fails because multiple sources",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library_shared",
|
ModuleTypeUnderTest: "cc_prebuilt_library_shared",
|
||||||
|
@@ -21,7 +21,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestStaticPrebuiltLibrary(t *testing.T) {
|
func TestStaticPrebuiltLibrary(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library static simple",
|
Description: "prebuilt library static simple",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library_static",
|
ModuleTypeUnderTest: "cc_prebuilt_library_static",
|
||||||
@@ -44,7 +44,7 @@ cc_prebuilt_library_static {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestStaticPrebuiltLibraryWithArchVariance(t *testing.T) {
|
func TestStaticPrebuiltLibraryWithArchVariance(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library static with arch variance",
|
Description: "prebuilt library static with arch variance",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library_static",
|
ModuleTypeUnderTest: "cc_prebuilt_library_static",
|
||||||
@@ -75,7 +75,7 @@ cc_prebuilt_library_static {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestStaticPrebuiltLibraryStaticStanzaFails(t *testing.T) {
|
func TestStaticPrebuiltLibraryStaticStanzaFails(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t,
|
RunBp2BuildTestCaseSimple(t,
|
||||||
Bp2buildTestCase{
|
Bp2buildTestCase{
|
||||||
Description: "prebuilt library with static stanza fails because multiple sources",
|
Description: "prebuilt library with static stanza fails because multiple sources",
|
||||||
ModuleTypeUnderTest: "cc_prebuilt_library_static",
|
ModuleTypeUnderTest: "cc_prebuilt_library_static",
|
||||||
|
@@ -25,7 +25,7 @@ func runLinkerConfigTestCase(t *testing.T, tc Bp2buildTestCase) {
|
|||||||
t.Helper()
|
t.Helper()
|
||||||
(&tc).ModuleTypeUnderTest = "linker_config"
|
(&tc).ModuleTypeUnderTest = "linker_config"
|
||||||
(&tc).ModuleTypeUnderTestFactory = linkerconfig.LinkerConfigFactory
|
(&tc).ModuleTypeUnderTestFactory = linkerconfig.LinkerConfigFactory
|
||||||
runBp2BuildTestCaseSimple(t, tc)
|
RunBp2BuildTestCaseSimple(t, tc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLinkerConfigConvertsSrc(t *testing.T) {
|
func TestLinkerConfigConvertsSrc(t *testing.T) {
|
||||||
|
@@ -62,7 +62,7 @@ func TestPythonBinaryHostSimple(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPythonBinaryHostPy2(t *testing.T) {
|
func TestPythonBinaryHostPy2(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t, Bp2buildTestCase{
|
RunBp2BuildTestCaseSimple(t, Bp2buildTestCase{
|
||||||
Description: "py2 python_binary_host",
|
Description: "py2 python_binary_host",
|
||||||
ModuleTypeUnderTest: "python_binary_host",
|
ModuleTypeUnderTest: "python_binary_host",
|
||||||
ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
|
ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
|
||||||
@@ -96,7 +96,7 @@ func TestPythonBinaryHostPy2(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPythonBinaryHostPy3(t *testing.T) {
|
func TestPythonBinaryHostPy3(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t, Bp2buildTestCase{
|
RunBp2BuildTestCaseSimple(t, Bp2buildTestCase{
|
||||||
Description: "py3 python_binary_host",
|
Description: "py3 python_binary_host",
|
||||||
ModuleTypeUnderTest: "python_binary_host",
|
ModuleTypeUnderTest: "python_binary_host",
|
||||||
ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
|
ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
|
||||||
@@ -130,7 +130,7 @@ func TestPythonBinaryHostPy3(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPythonBinaryHostArchVariance(t *testing.T) {
|
func TestPythonBinaryHostArchVariance(t *testing.T) {
|
||||||
runBp2BuildTestCaseSimple(t, Bp2buildTestCase{
|
RunBp2BuildTestCaseSimple(t, Bp2buildTestCase{
|
||||||
Description: "test arch variants",
|
Description: "test arch variants",
|
||||||
ModuleTypeUnderTest: "python_binary_host",
|
ModuleTypeUnderTest: "python_binary_host",
|
||||||
ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
|
ModuleTypeUnderTestFactory: python.PythonBinaryHostFactory,
|
||||||
|
@@ -66,7 +66,7 @@ func runPythonLibraryTestCase(t *testing.T, tc pythonLibBp2BuildTestCase) {
|
|||||||
testCase.ModuleTypeUnderTest = "python_library"
|
testCase.ModuleTypeUnderTest = "python_library"
|
||||||
testCase.ModuleTypeUnderTestFactory = python.PythonLibraryFactory
|
testCase.ModuleTypeUnderTestFactory = python.PythonLibraryFactory
|
||||||
|
|
||||||
runBp2BuildTestCaseSimple(t, testCase)
|
RunBp2BuildTestCaseSimple(t, testCase)
|
||||||
}
|
}
|
||||||
|
|
||||||
func runPythonLibraryHostTestCase(t *testing.T, tc pythonLibBp2BuildTestCase) {
|
func runPythonLibraryHostTestCase(t *testing.T, tc pythonLibBp2BuildTestCase) {
|
||||||
|
@@ -71,7 +71,7 @@ func errored(t *testing.T, tc Bp2buildTestCase, errs []error) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func runBp2BuildTestCaseSimple(t *testing.T, tc Bp2buildTestCase) {
|
func RunBp2BuildTestCaseSimple(t *testing.T, tc Bp2buildTestCase) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
|
RunBp2BuildTestCase(t, func(ctx android.RegistrationContext) {}, tc)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user