linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	linux-renesas-soc@vger.kernel.org,
	Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: [VSP-Tests PATCH 3/7] vsp-lib: Provide command line argument parsing
Date: Tue,  4 Dec 2018 15:51:42 +0000	[thread overview]
Message-ID: <20181204155146.9726-4-kieran.bingham@ideasonboard.com> (raw)
In-Reply-To: <20181204155146.9726-1-kieran.bingham@ideasonboard.com>

Extend the vsp-lib to support command line parsing for all tests.  The
arguments parsed here should be common to all tests, and initially
provide shell level verbose debug output, and the option to easily keep
frames output by the VSP1.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 scripts/vsp-lib.sh | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh
index 0f3992a7827e..56969606382f 100755
--- a/scripts/vsp-lib.sh
+++ b/scripts/vsp-lib.sh
@@ -1094,3 +1094,37 @@ test_complete() {
 test_run() {
 	test_main | ./logger.sh error >> $logfile
 }
+
+# ------------------------------------------------------------------------------
+# Common argument parsing
+#
+# non-recognised arguments are restored, to allow tests to implement their own
+# parsing if necessary.
+
+POSITIONAL=()
+while [[ $# -gt 0 ]]
+do
+case $1 in
+	-x|--debug)
+		set -x;
+		shift
+		;;
+	-k|--keep-frames)
+		export VSP_KEEP_FRAMES=1
+		shift
+		;;
+	-h|--help)
+		echo "$(basename $0): VSP Test library"
+		echo "  -x|--debug          enable shell debug"
+		echo "  -k|--keep-frames    keep generated and captured frames"
+		echo "  -h|--help           this help"
+		exit
+		shift
+		;;
+	*)    # unknown option
+		POSITIONAL+=("$1") # save it in an array for later
+		shift # past argument
+		;;
+esac
+done
+set -- "${POSITIONAL[@]}" # restore positional parameters
-- 
2.17.1

  parent reply	other threads:[~2018-12-04 15:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 15:51 [VSP-Tests PATCH 0/7] Reset controls and unloved patches Kieran Bingham
2018-12-04 15:51 ` [VSP-Tests PATCH 1/7] tests: add pseudo platform test Kieran Bingham
2019-02-17  2:41   ` Laurent Pinchart
2019-02-17 20:41     ` Kieran Bingham
2018-12-04 15:51 ` [VSP-Tests PATCH 2/7] tests: Provide copy test to validate 1xN streams Kieran Bingham
2019-02-17  2:47   ` Laurent Pinchart
2019-02-17 20:43     ` Kieran Bingham
2018-12-04 15:51 ` Kieran Bingham [this message]
2019-02-17  2:48   ` [VSP-Tests PATCH 3/7] vsp-lib: Provide command line argument parsing Laurent Pinchart
2019-02-17 20:47     ` Kieran Bingham
2018-12-04 15:51 ` [VSP-Tests PATCH 4/7] vsp-lib: trivial: Fix spelling of Reference Kieran Bingham
2019-02-17  2:42   ` Laurent Pinchart
2019-02-17 20:48     ` Kieran Bingham
2018-12-04 15:51 ` [VSP-Tests PATCH 5/7] vsp-lib: Allow forcing pixel perfect comparisons Kieran Bingham
2019-02-17 11:59   ` Laurent Pinchart
2019-02-17 20:51     ` Kieran Bingham
2019-02-19 16:35       ` Laurent Pinchart
2018-12-04 15:51 ` [VSP-Tests PATCH 6/7] vsp-lib: Support late queuing of buffers in yavta Kieran Bingham
2019-02-17 12:00   ` Laurent Pinchart
2019-02-17 20:57     ` Kieran Bingham
2019-02-19 16:37       ` Laurent Pinchart
2018-12-04 15:51 ` [VSP-Tests PATCH 7/7] vsp-lib: Reset controls to defaults on each test run Kieran Bingham
2019-02-17 12:01   ` Laurent Pinchart
2019-02-17 21:00     ` Kieran Bingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181204155146.9726-4-kieran.bingham@ideasonboard.com \
    --to=kieran.bingham@ideasonboard.com \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).