mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
cmdlineTests.sh: Accept test name patterns as positional arguments
This commit is contained in:
parent
e3184c737a
commit
ad3d3c0df6
@ -37,11 +37,8 @@ source "${REPO_ROOT}/scripts/common.sh"
|
|||||||
# shellcheck source=scripts/common_cmdline.sh
|
# shellcheck source=scripts/common_cmdline.sh
|
||||||
source "${REPO_ROOT}/scripts/common_cmdline.sh"
|
source "${REPO_ROOT}/scripts/common_cmdline.sh"
|
||||||
|
|
||||||
(( $# <= 1 )) || { printError "Too many arguments"; exit 1; }
|
|
||||||
(( $# == 0 )) || [[ $1 == '--update' ]] || { printError "Invalid argument: '$1'"; exit 1; }
|
|
||||||
|
|
||||||
AUTOUPDATE=false
|
AUTOUPDATE=false
|
||||||
[[ $1 == --update ]] && AUTOUPDATE=true
|
[[ $1 == --update ]] && AUTOUPDATE=true && shift
|
||||||
|
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
msys)
|
msys)
|
||||||
@ -294,8 +291,21 @@ test_solc_behaviour "${0}" "ctx:=/some/remapping/target" "" "" 1 "" "Invalid rem
|
|||||||
printTask "Running general commandline tests..."
|
printTask "Running general commandline tests..."
|
||||||
(
|
(
|
||||||
cd "$REPO_ROOT"/test/cmdlineTests/
|
cd "$REPO_ROOT"/test/cmdlineTests/
|
||||||
for tdir in */
|
for tdir in ${*:-*/}
|
||||||
do
|
do
|
||||||
|
if ! [[ -d $tdir ]]; then
|
||||||
|
if [[ $tdir =~ ^--.*$ ]]; then
|
||||||
|
if [[ $tdir == "--update" ]]; then
|
||||||
|
printError "The --update option must be given before any positional arguments."
|
||||||
|
else
|
||||||
|
printError "Invalid option: $tdir."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
printError "Test directory not found: $tdir"
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
printTask " - ${tdir}"
|
printTask " - ${tdir}"
|
||||||
|
|
||||||
# Strip trailing slash from $tdir.
|
# Strip trailing slash from $tdir.
|
||||||
|
Loading…
Reference in New Issue
Block a user