summaryrefslogtreecommitdiff
path: root/bp2build/conversion_test.go
diff options
context:
space:
mode:
author Jingwen Chen <jingwen@google.com> 2021-06-17 05:43:19 +0000
committer Jingwen Chen <jingwen@google.com> 2021-06-21 06:12:34 +0000
commitc63677b3c98d48b59a03075317bce4551d63aa5f (patch)
tree9dae01e3eb0665060c20faef39ed26a81b7d70fc /bp2build/conversion_test.go
parentc4dc9b4f08226ff66830fcd8ec644ab82b66ca02 (diff)
Direct Bazel builds from m.
This CL adds support to bp2build/Soong to dump a BUILD file under out/soong/soong_injection/targets containing alias targets to their real targets for every converted Soong module, regardless of whether they are handcrafted or generated. Test: TH Change-Id: Ic1816fda5d019c395301618134fac68b3057d752
Diffstat (limited to 'bp2build/conversion_test.go')
-rw-r--r--bp2build/conversion_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/bp2build/conversion_test.go b/bp2build/conversion_test.go
index 0931ff7fc..56ea589bb 100644
--- a/bp2build/conversion_test.go
+++ b/bp2build/conversion_test.go
@@ -80,17 +80,21 @@ func TestCreateBazelFiles_QueryView_AddsTopLevelFiles(t *testing.T) {
}
func TestCreateBazelFiles_Bp2Build_CreatesDefaultFiles(t *testing.T) {
- files := CreateSoongInjectionFiles()
+ files := CreateSoongInjectionFiles(CodegenCompatLayer{})
expectedFilePaths := []bazelFilepath{
{
dir: "cc_toolchain",
- basename: "BUILD",
+ basename: GeneratedBuildFileName,
},
{
dir: "cc_toolchain",
basename: "constants.bzl",
},
+ {
+ dir: "module_name_to_label",
+ basename: GeneratedBuildFileName,
+ },
}
if len(files) != len(expectedFilePaths) {
@@ -104,7 +108,7 @@ func TestCreateBazelFiles_Bp2Build_CreatesDefaultFiles(t *testing.T) {
t.Errorf("Did not find expected file %s/%s", actualFile.Dir, actualFile.Basename)
}
- if expectedFile.basename != "BUILD" && actualFile.Contents == "" {
+ if expectedFile.basename != GeneratedBuildFileName && actualFile.Contents == "" {
t.Errorf("Contents of %s unexpected empty.", actualFile)
}
}