[v2,03/12] scripts: Add option to directly specify avocado tags

Message ID 20230303144727.481716-4-amikan@ilbers.de
State Accepted, archived
Headers show
Series Next avocado improvements​ | expand

Commit Message

Anton Mikanovich March 3, 2023, 2:47 p.m. UTC
From: Uladzimir Bely <ubely@ilbers.de>

Add to "ci_build.sh" option to specify avocado tags directly by passing
"--tags=<tags>" option.

For compatibility reasons, treat "-f" as "--tags=fast", if user
did not specify "--tags" option directly.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 scripts/ci_build.sh | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

Patch

diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index e37114b..7382862 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -49,7 +49,7 @@  show_help() {
     echo "    -b, --base BASE_DIR      set path to base directory. If not set,"
     echo "                             the tests will be started in current path."
     echo "    -d, --debug              enable debug bitbake output."
-    echo "    -f, --fast               cross build reduced set of configurations."
+    echo "    -T, --tags               specify basic avocado tags."
     echo "    -q, --quiet              suppress verbose bitbake output."
     echo "    -n, --norun              do not execute QEMU run tests."
     echo "    -t, --timeout SEC        specify time in seconds to wait before stop QEMU."
@@ -61,7 +61,6 @@  show_help() {
     echo " 3  if invalid parameters are passed."
 }
 
-TAGS="full"
 QUIET="0"
 TIMEOUT=300
 
@@ -82,9 +81,14 @@  do
     -d|--debug)
         VERBOSE="--show=app,test"
         ;;
+    -T|--tags)
+        TAGS="$2"
+        shift
+        ;;
     -f|--fast)
         # Start build for the reduced set of configurations
-        TAGS="fast"
+        FAST="1"
+        echo "warning: deprecated parameter '$key', consider using '-T fast' instead"
         ;;
     -q|--quiet)
         QUIET="1"
@@ -109,6 +113,14 @@  do
     shift
 done
 
+if [ -z "$TAGS" ]; then
+    if [ -n "$FAST" ]; then
+        TAGS="fast"
+    else
+        TAGS="full"
+    fi
+fi
+
 if [ -n "$NORUN" ]; then
     TAGS="$TAGS,-startvm"
 else