Loading bp2build/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ bootstrap_go_package { "cc_prebuilt_library_conversion_test.go", "cc_prebuilt_library_shared_test.go", "cc_prebuilt_library_static_test.go", "cc_yasm_conversion_test.go", "conversion_test.go", "filegroup_conversion_test.go", "genrule_conversion_test.go", Loading bp2build/cc_yasm_conversion_test.go +30 −30 Original line number Diff line number Diff line Loading @@ -20,9 +20,9 @@ import ( "android/soong/cc" ) func runYasmTestCase(t *testing.T, tc bp2buildTestCase) { func runYasmTestCase(t *testing.T, tc Bp2buildTestCase) { t.Helper() runBp2BuildTestCase(t, registerYasmModuleTypes, tc) RunBp2BuildTestCase(t, registerYasmModuleTypes, tc) } func registerYasmModuleTypes(ctx android.RegistrationContext) { Loading @@ -34,20 +34,20 @@ func registerYasmModuleTypes(ctx android.RegistrationContext) { } func TestYasmSimple(t *testing.T) { runYasmTestCase(t, bp2buildTestCase{ description: "Simple yasm test", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, filesystem: map[string]string{ runYasmTestCase(t, Bp2buildTestCase{ Description: "Simple yasm test", ModuleTypeUnderTest: "cc_library", ModuleTypeUnderTestFactory: cc.LibraryFactory, Filesystem: map[string]string{ "main.cpp": "", "myfile.asm": "", }, blueprint: ` Blueprint: ` cc_library { name: "foo", srcs: ["main.cpp", "myfile.asm"], }`, expectedBazelTargets: append([]string{ ExpectedBazelTargets: append([]string{ makeBazelTarget("yasm", "foo_yasm", map[string]string{ "include_dirs": `["."]`, "srcs": `["myfile.asm"]`, Loading @@ -63,24 +63,24 @@ cc_library { } func TestYasmWithIncludeDirs(t *testing.T) { runYasmTestCase(t, bp2buildTestCase{ description: "Simple yasm test", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, filesystem: map[string]string{ runYasmTestCase(t, Bp2buildTestCase{ Description: "Simple yasm test", ModuleTypeUnderTest: "cc_library", ModuleTypeUnderTestFactory: cc.LibraryFactory, Filesystem: map[string]string{ "main.cpp": "", "myfile.asm": "", "include1/foo/myinclude.inc": "", "include2/foo/myinclude2.inc": "", }, blueprint: ` Blueprint: ` cc_library { name: "foo", local_include_dirs: ["include1/foo"], export_include_dirs: ["include2/foo"], srcs: ["main.cpp", "myfile.asm"], }`, expectedBazelTargets: append([]string{ ExpectedBazelTargets: append([]string{ makeBazelTarget("yasm", "foo_yasm", map[string]string{ "include_dirs": `[ "include1/foo", Loading @@ -104,15 +104,15 @@ cc_library { } func TestYasmConditionalBasedOnArch(t *testing.T) { runYasmTestCase(t, bp2buildTestCase{ description: "Simple yasm test", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, filesystem: map[string]string{ runYasmTestCase(t, Bp2buildTestCase{ Description: "Simple yasm test", ModuleTypeUnderTest: "cc_library", ModuleTypeUnderTestFactory: cc.LibraryFactory, Filesystem: map[string]string{ "main.cpp": "", "myfile.asm": "", }, blueprint: ` Blueprint: ` cc_library { name: "foo", srcs: ["main.cpp"], Loading @@ -122,7 +122,7 @@ cc_library { }, }, }`, expectedBazelTargets: append([]string{ ExpectedBazelTargets: append([]string{ makeBazelTarget("yasm", "foo_yasm", map[string]string{ "include_dirs": `["."]`, "srcs": `select({ Loading @@ -141,16 +141,16 @@ cc_library { } func TestYasmPartiallyConditional(t *testing.T) { runYasmTestCase(t, bp2buildTestCase{ description: "Simple yasm test", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, filesystem: map[string]string{ runYasmTestCase(t, Bp2buildTestCase{ Description: "Simple yasm test", ModuleTypeUnderTest: "cc_library", ModuleTypeUnderTestFactory: cc.LibraryFactory, Filesystem: map[string]string{ "main.cpp": "", "myfile.asm": "", "mysecondfile.asm": "", }, blueprint: ` Blueprint: ` cc_library { name: "foo", srcs: ["main.cpp", "myfile.asm"], Loading @@ -160,7 +160,7 @@ cc_library { }, }, }`, expectedBazelTargets: append([]string{ ExpectedBazelTargets: append([]string{ makeBazelTarget("yasm", "foo_yasm", map[string]string{ "include_dirs": `["."]`, "srcs": `["myfile.asm"] + select({ Loading Loading
bp2build/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ bootstrap_go_package { "cc_prebuilt_library_conversion_test.go", "cc_prebuilt_library_shared_test.go", "cc_prebuilt_library_static_test.go", "cc_yasm_conversion_test.go", "conversion_test.go", "filegroup_conversion_test.go", "genrule_conversion_test.go", Loading
bp2build/cc_yasm_conversion_test.go +30 −30 Original line number Diff line number Diff line Loading @@ -20,9 +20,9 @@ import ( "android/soong/cc" ) func runYasmTestCase(t *testing.T, tc bp2buildTestCase) { func runYasmTestCase(t *testing.T, tc Bp2buildTestCase) { t.Helper() runBp2BuildTestCase(t, registerYasmModuleTypes, tc) RunBp2BuildTestCase(t, registerYasmModuleTypes, tc) } func registerYasmModuleTypes(ctx android.RegistrationContext) { Loading @@ -34,20 +34,20 @@ func registerYasmModuleTypes(ctx android.RegistrationContext) { } func TestYasmSimple(t *testing.T) { runYasmTestCase(t, bp2buildTestCase{ description: "Simple yasm test", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, filesystem: map[string]string{ runYasmTestCase(t, Bp2buildTestCase{ Description: "Simple yasm test", ModuleTypeUnderTest: "cc_library", ModuleTypeUnderTestFactory: cc.LibraryFactory, Filesystem: map[string]string{ "main.cpp": "", "myfile.asm": "", }, blueprint: ` Blueprint: ` cc_library { name: "foo", srcs: ["main.cpp", "myfile.asm"], }`, expectedBazelTargets: append([]string{ ExpectedBazelTargets: append([]string{ makeBazelTarget("yasm", "foo_yasm", map[string]string{ "include_dirs": `["."]`, "srcs": `["myfile.asm"]`, Loading @@ -63,24 +63,24 @@ cc_library { } func TestYasmWithIncludeDirs(t *testing.T) { runYasmTestCase(t, bp2buildTestCase{ description: "Simple yasm test", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, filesystem: map[string]string{ runYasmTestCase(t, Bp2buildTestCase{ Description: "Simple yasm test", ModuleTypeUnderTest: "cc_library", ModuleTypeUnderTestFactory: cc.LibraryFactory, Filesystem: map[string]string{ "main.cpp": "", "myfile.asm": "", "include1/foo/myinclude.inc": "", "include2/foo/myinclude2.inc": "", }, blueprint: ` Blueprint: ` cc_library { name: "foo", local_include_dirs: ["include1/foo"], export_include_dirs: ["include2/foo"], srcs: ["main.cpp", "myfile.asm"], }`, expectedBazelTargets: append([]string{ ExpectedBazelTargets: append([]string{ makeBazelTarget("yasm", "foo_yasm", map[string]string{ "include_dirs": `[ "include1/foo", Loading @@ -104,15 +104,15 @@ cc_library { } func TestYasmConditionalBasedOnArch(t *testing.T) { runYasmTestCase(t, bp2buildTestCase{ description: "Simple yasm test", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, filesystem: map[string]string{ runYasmTestCase(t, Bp2buildTestCase{ Description: "Simple yasm test", ModuleTypeUnderTest: "cc_library", ModuleTypeUnderTestFactory: cc.LibraryFactory, Filesystem: map[string]string{ "main.cpp": "", "myfile.asm": "", }, blueprint: ` Blueprint: ` cc_library { name: "foo", srcs: ["main.cpp"], Loading @@ -122,7 +122,7 @@ cc_library { }, }, }`, expectedBazelTargets: append([]string{ ExpectedBazelTargets: append([]string{ makeBazelTarget("yasm", "foo_yasm", map[string]string{ "include_dirs": `["."]`, "srcs": `select({ Loading @@ -141,16 +141,16 @@ cc_library { } func TestYasmPartiallyConditional(t *testing.T) { runYasmTestCase(t, bp2buildTestCase{ description: "Simple yasm test", moduleTypeUnderTest: "cc_library", moduleTypeUnderTestFactory: cc.LibraryFactory, filesystem: map[string]string{ runYasmTestCase(t, Bp2buildTestCase{ Description: "Simple yasm test", ModuleTypeUnderTest: "cc_library", ModuleTypeUnderTestFactory: cc.LibraryFactory, Filesystem: map[string]string{ "main.cpp": "", "myfile.asm": "", "mysecondfile.asm": "", }, blueprint: ` Blueprint: ` cc_library { name: "foo", srcs: ["main.cpp", "myfile.asm"], Loading @@ -160,7 +160,7 @@ cc_library { }, }, }`, expectedBazelTargets: append([]string{ ExpectedBazelTargets: append([]string{ makeBazelTarget("yasm", "foo_yasm", map[string]string{ "include_dirs": `["."]`, "srcs": `["myfile.asm"] + select({ Loading