Have python_*{,_host} handle arch-variants
Bug: 196081778 Test: TestPython*{,Host}ArchVariance Test: go test Test: mixed_{libc,droid}.sh Change-Id: I89304e58f5bacd61534732bade4ad6bb5f2671c0
This commit is contained in:
parent
1b5262bd69
commit
19d399d4c5
@@ -116,3 +116,37 @@ func TestPythonBinaryHostPy3(t *testing.T) {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func TestPythonBinaryHostArchVariance(t *testing.T) {
|
||||
runBp2BuildTestCaseSimple(t, bp2buildTestCase{
|
||||
description: "test arch variants",
|
||||
moduleTypeUnderTest: "python_binary_host",
|
||||
moduleTypeUnderTestFactory: python.PythonBinaryHostFactory,
|
||||
moduleTypeUnderTestBp2BuildMutator: python.PythonBinaryBp2Build,
|
||||
filesystem: map[string]string{
|
||||
"dir/arm.py": "",
|
||||
"dir/x86.py": "",
|
||||
},
|
||||
blueprint: `python_binary_host {
|
||||
name: "foo-arm",
|
||||
arch: {
|
||||
arm: {
|
||||
srcs: ["arm.py"],
|
||||
},
|
||||
x86: {
|
||||
srcs: ["x86.py"],
|
||||
},
|
||||
},
|
||||
}`,
|
||||
expectedBazelTargets: []string{
|
||||
`py_binary(
|
||||
name = "foo-arm",
|
||||
srcs = select({
|
||||
"//build/bazel/platforms/arch:arm": ["arm.py"],
|
||||
"//build/bazel/platforms/arch:x86": ["x86.py"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)`,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user