From: Bert Vermeulen Date: Wed, 11 Dec 2013 11:48:50 +0000 (+0100) Subject: pdtest: Add option for custom sigrok-dumps repository path. X-Git-Tag: libsigrokdecode-0.3.0~202 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c87dce4c93822df764cc380213e9a69eced7e6e9;p=libsigrokdecode.git pdtest: Add option for custom sigrok-dumps repository path. --- diff --git a/tests/pdtest b/tests/pdtest index 1258d27..45fb342 100755 --- a/tests/pdtest +++ b/tests/pdtest @@ -348,7 +348,7 @@ if len(sys.argv) == 1: opt_all = opt_run = opt_show = opt_list = False report_dir = None -opts, args = getopt(sys.argv[1:], "dvarslR:") +opts, args = getopt(sys.argv[1:], "dvarslRS:") for opt, arg in opts: if opt == '-d': DEBUG = True @@ -364,6 +364,8 @@ for opt, arg in opts: opt_list = True elif opt == '-R': report_dir = arg + elif opt == '-S': + dumps_dir = arg if opt_run and opt_show: usage("Use either -s or -r, not both.") @@ -382,6 +384,9 @@ try: usage("Specify either -a or tests.") if opt_run: + if not os.path.isdir(dumps_dir): + ERR("Could not find sigrok-dumps repository at %s" % dumps_dir) + sys.exit(1) results, errors = run_tests(testlist) ret = errors elif opt_show: