Skip to content

Commit

Permalink
ensure return codes from called scripts are respected
Browse files Browse the repository at this point in the history
  • Loading branch information
rkm committed Mar 4, 2022
1 parent 38df36a commit d1d5241
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 3 additions & 1 deletion bin/ctp/buildTestPackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def main() -> int:
dist_tag_dir.mkdir(parents=True, exist_ok=True)

if args.install_libs:
L.main()
rc = L.main()
if rc:
return rc

mvn = "mvn" if os.name == "posix" else "mvn.cmd"
cmd = (
Expand Down
4 changes: 3 additions & 1 deletion bin/smi-py/testPackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def main() -> int:
)
C.run(cmd)

T.main(("-p", str(python_exe)))
rc = T.main(("-p", str(python_exe)))
if rc:
return rc

cmd = (
python_exe,
Expand Down
9 changes: 6 additions & 3 deletions bin/smi/buildTestPackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ def main() -> int:
# TODO(rkm 2022-02-26) Add --no-build here
cfg_args = ("-c", args.configuration)
test_cmd = ("--test", args.test[0]) if args.test else ()
DT.main((
rc = DT.main((
*cfg_args,
"--no-coverage" if args.no_coverage else "",
*test_cmd
))
DP.main((*cfg_args, args.tag))
if rc:
return rc

return 0
rc = DP.main((*cfg_args, args.tag))

return rc


if __name__ == "__main__":
Expand Down
8 changes: 6 additions & 2 deletions bin/smi/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
)
args, _ = parser.parse_known_args(argv)

downloadTessdata.main([])
rc = downloadTessdata.main([])
if rc:
return rc

if not args.no_build:
DB.main(("--configuration", args.configuration))
rc = DB.main(("--configuration", args.configuration))
if rc:
return rc

with open(C.PROJ_ROOT / "global.json") as f:
global_json = json.load(f)
Expand Down

0 comments on commit d1d5241

Please sign in to comment.