From 22ed68d0a99dc8ef99e4de3d40491c651a62da2b Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Fri, 12 Mar 2021 18:01:43 +0100 Subject: [PATCH] ci: Implement 'test' helper action This simply calls the underlying Makefile target, but allows additional arguments to be specified in a more convenient and discoverable way. Signed-off-by: Andrea Bolognani Reviewed-by: Erik Skultety --- ci/helper | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ci/helper b/ci/helper index 57ebe1f840..73a3f729da 100755 --- a/ci/helper +++ b/ci/helper @@ -82,6 +82,14 @@ class Parser: ) buildparser.set_defaults(func=Application.action_build) + # test action + testparser = subparsers.add_parser( + "test", + help="run a build in a container (including tests)", + parents=[containerparser, mesonparser], + ) + testparser.set_defaults(func=Application.action_test) + # shell action shellparser = subparsers.add_parser( "shell", @@ -125,7 +133,7 @@ class Application: target, ] - if self.args.action in ["build", "shell"]: + if self.args.action in ["build", "test", "shell"]: args.extend([ f"CI_ENGINE={self.args.engine}", f"CI_USER_LOGIN={self.args.login}", @@ -133,7 +141,7 @@ class Application: f"CI_IMAGE_TAG={self.args.image_tag}", ]) - if self.args.action == "build": + if self.args.action in ["build", "test"]: args.extend([ f"CI_MESON_ARGS={self.args.meson_args}", f"CI_NINJA_ARGS={self.args.ninja_args}", @@ -221,6 +229,9 @@ class Application: def action_build(self): self.make_run(f"ci-build@{self.args.target}") + def action_test(self): + self.make_run(f"ci-test@{self.args.target}") + def action_shell(self): self.make_run(f"ci-shell@{self.args.target}")