Refactor bp2build tests for allowlist v2

Allowlist v2 will change bp2build by automatically disabling rdeps of
unconvertible modules. Many bp2build tests create bp2build stub modules
without an implementation,
This CL changes setup of such tests to also contain a BUILD file with
"stub implementations" of equivalent targets, to keep these test targets
convertible.

To verify this change in-place, this CL removes `bp2build_available:
false` from these dependencies.

This is a test-only change for bp2build tests.

Bug: 285631638
Test: m bp2build
Change-Id: I489480cbc4158a416b7abf57c35a6e2bc2ad6173
This commit is contained in:
Chris Parsons
2023-09-19 01:12:48 +00:00
parent 95ad0a9226
commit cd209035aa
23 changed files with 465 additions and 439 deletions

View File

@@ -15,8 +15,9 @@
package bp2build
import (
"android/soong/python"
"testing"
"android/soong/python"
)
func TestPythonTestHostSimple(t *testing.T) {
@@ -31,6 +32,7 @@ func TestPythonTestHostSimple(t *testing.T) {
"b/e.py": "",
"files/data.txt": "",
},
StubbedBuildDefinitions: []string{"bar"},
Blueprint: `python_test_host {
name: "foo",
main: "a.py",
@@ -43,7 +45,6 @@ func TestPythonTestHostSimple(t *testing.T) {
python_library_host {
name: "bar",
srcs: ["b/e.py"],
bazel_module: { bp2build_available: false },
}`,
ExpectedBazelTargets: []string{
MakeBazelTarget("py_test", "foo", AttrNameToString{