summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-20 14:56:06 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-07-22 16:05:09 +0200
commitc1e202d225eea6838acd65ea81266996ee6bb9a2 (patch)
treed71f6df0afff2b47f61f26df08e64e331fa48da8
parent92296fe4b0862a04ea3d965b4cd2d4a420e3be9f (diff)
tests: skip over -flags for first option in autotests
Otherwise calls like "apt -q install" end up calling "aptautotest_apt_q" instead of "aptautotest_apt_install" Gbp-Dch: Ignore
-rw-r--r--test/integration/framework10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 54adcf92d..792ba79d9 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -1931,12 +1931,20 @@ mkdir() {
### general things about commands executed without writing the test every time.
aptautotest() {
+ if [ $# -lt 3 ]; then return; fi
local TESTCALL="$1"
local CMD="$2"
local FIRSTOPT="$3"
+ shift 2
+ for i in "$@"; do
+ if ! expr match "$i" '^-' >/dev/null 2>&1; then
+ FIRSTOPT="$i"
+ break
+ fi
+ done
+ shift
local AUTOTEST="aptautotest_$(echo "${CMD##*/}_${FIRSTOPT}" | tr -d -c 'A-za-z0-9')"
if command -v $AUTOTEST >/dev/null; then
- shift 3
# save and restore the *.output files from other tests
# as we might otherwise override them in these automatic tests
rm -rf "${TMPWORKINGDIRECTORY}/rootdir/tmp-before"