Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
605
Issues
605
List
Boards
Labels
Service Desk
Milestones
Merge Requests
111
Merge Requests
111
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
BIND
Commits
d10294ac
Commit
d10294ac
authored
Apr 24, 2020
by
Ondřej Surý
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the requirement for GNU getopt and parse long options using getopts
parent
51188b33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
26 deletions
+16
-26
bin/tests/system/system-test-driver.sh.in
bin/tests/system/system-test-driver.sh.in
+16
-26
No files found.
bin/tests/system/system-test-driver.sh.in
View file @
d10294ac
...
...
@@ -9,21 +9,6 @@ usage() {
echo
"
$0
--test-name=NAME --log-file=PATH.log --trs-file=PATH.trs --color-tests={yes|no} --expect-failure={yes|no} --enable-hard-errors={yes|no}"
}
#
# This requires GNU getopt
#
getopt
--test
>
/dev/null
if
[
"
$?
"
-ne
4
]
;
then
echo
"fatal: GNU getopt is required"
exit
1
fi
OPTS
=
$(
getopt
--shell
sh
--name
"
$(
basename
"
$0
"
)
"
--options
''
--longoptions
test-name:,log-file:,trs-file:,color-tests:,expect-failure:,enable-hard-errors:
--
"
$@
"
)
if
[
"
$?
"
-ne
0
]
;
then
echo
"Failed parsing options."
>
&2
;
exit
1
;
fi
eval set
--
"
$OPTS
"
TEST_NAME
=
LOG_FILE
=
TRS_FILE
=
...
...
@@ -31,18 +16,23 @@ COLOR_TESTS=yes
EXPECT_FAILURE
=
no
HARD_ERRORS
=
yes
while
true
;
do
case
"
$1
"
in
--test-name
)
TEST_NAME
=
"
$2
"
;
shift
;
shift
;;
--log-file
)
LOG_FILE
=
"
$2
"
;
shift
;
shift
;;
--trs-file
)
TRS_FILE
=
"
$2
"
;
shift
;
shift
;;
--color-tests
)
COLOR_TESTS
=
"
$2
"
;
shift
;
shift
;;
--expect-failure
)
EXPECT_FAILURE
=
"
$2
"
;
shift
;
shift
;;
--hard-errors
)
HARD_ERRORS
=
"
$2
"
;
shift
;
shift
;;
--
)
shift
;
break
;;
*
)
break
;;
esac
while
getopts
-: OPT
;
do
if
[
"
$OPT
"
=
"-"
]
&&
[
-n
"
$OPTARG
"
]
;
then
OPT
=
"
${
OPTARG
%%=*
}
"
OPTARG
=
"
${
OPTARG
#
$OPT
}
"
OPTARG
=
"
${
OPTARG
#=
}
"
fi
case
"
$OPT
"
in
test-name
)
TEST_NAME
=
"
$OPTARG
"
;;
log-file
)
LOG_FILE
=
"
$OPTARG
"
;;
trs-file
)
TRS_FILE
=
"
$OPTARG
"
;;
color-tests
)
COLOR_TESTS
=
"
$OPTARG
"
;;
expect-failure
)
EXPECT_FAILURE
=
"
$OPTARG
"
;;
hard-errors
)
HARD_ERRORS
=
"
$OPTARG
"
;;
*
)
break
;;
esac
done
shift
$((
OPTIND-1
))
if
[
-z
"
$1
"
]
;
then
echo
"fatal: test name required"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment