Fix hole in python testing code that ignored a broken test
The test running code would only check errors if there were any reported. That ignored the "module with duplicate runfile path" test which was not reporting the expected error. This change corrects that mistake, and then fixes the test which had started to fail. It is possible that the failing test highlights a bug in the python code but if so that will need to be fixed in a follow up bug. Bug: 183046274 Test: m nothing Change-Id: I961b15a452725e7b15ba9d21b4a4a672ba3d004a
This commit is contained in:
parent
45a4971808
commit
c60dd805ad
1 changed files with 15 additions and 3 deletions
|
@ -207,14 +207,26 @@ var (
|
||||||
"lib1",
|
"lib1",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
python_binary_host {
|
||||||
|
name: "bin",
|
||||||
|
pkg_path: "e/",
|
||||||
|
srcs: [
|
||||||
|
"bin.py",
|
||||||
|
],
|
||||||
|
libs: [
|
||||||
|
"lib2",
|
||||||
|
],
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
),
|
),
|
||||||
"dir/c/file1.py": nil,
|
"dir/c/file1.py": nil,
|
||||||
"dir/file1.py": nil,
|
"dir/file1.py": nil,
|
||||||
|
"dir/bin.py": nil,
|
||||||
},
|
},
|
||||||
errors: []string{
|
errors: []string{
|
||||||
fmt.Sprintf(dupRunfileErrTemplate, "dir/Android.bp:9:6",
|
fmt.Sprintf(dupRunfileErrTemplate, "dir/Android.bp:20:6",
|
||||||
"lib2", "PY3", "a/b/c/file1.py", "lib2", "dir/file1.py",
|
"bin", "PY3", "a/b/c/file1.py", "bin", "dir/file1.py",
|
||||||
"lib1", "dir/c/file1.py"),
|
"lib1", "dir/c/file1.py"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -339,7 +351,7 @@ func TestPythonModule(t *testing.T) {
|
||||||
_, testErrs := ctx.ParseBlueprintsFiles(bpFile)
|
_, testErrs := ctx.ParseBlueprintsFiles(bpFile)
|
||||||
android.FailIfErrored(t, testErrs)
|
android.FailIfErrored(t, testErrs)
|
||||||
_, actErrs := ctx.PrepareBuildActions(config)
|
_, actErrs := ctx.PrepareBuildActions(config)
|
||||||
if len(actErrs) > 0 {
|
if len(actErrs) > 0 || len(d.errors) > 0 {
|
||||||
testErrs = append(testErrs, expectErrors(t, actErrs, d.errors)...)
|
testErrs = append(testErrs, expectErrors(t, actErrs, d.errors)...)
|
||||||
} else {
|
} else {
|
||||||
for _, e := range d.expectedBinaries {
|
for _, e := range d.expectedBinaries {
|
||||||
|
|
Loading…
Reference in a new issue