runtest.sh : fichier à tester en argument + correction erreurs
This commit is contained in:
parent
96db73c0ed
commit
ca09a9756b
64
runtest.sh
64
runtest.sh
@ -52,9 +52,6 @@ options=(
|
|||||||
[--jest-options]=${JESTOPTIONS}
|
[--jest-options]=${JESTOPTIONS}
|
||||||
)
|
)
|
||||||
|
|
||||||
# S'assurer que le script de test est à jour
|
|
||||||
make ${TESTFILE}
|
|
||||||
|
|
||||||
# la commande
|
# la commande
|
||||||
COMMANDE=selenium-side-runner
|
COMMANDE=selenium-side-runner
|
||||||
for elem in ${!options[@]}
|
for elem in ${!options[@]}
|
||||||
@ -63,27 +60,54 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Traiter les arguments
|
# Traiter les arguments
|
||||||
if [[ $# -ne 0 ]]
|
while [[ $# -gt 0 ]]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
"-t")
|
||||||
|
shift
|
||||||
|
TESTFILE="$1"
|
||||||
|
if
|
||||||
|
! echo "$TESTFILE" | grep -q -e "_v4"
|
||||||
|
then
|
||||||
|
TESTFILE=$(basename "$TESTFILE" ".side")_v4.side
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
"-a")
|
||||||
|
# exécuter tous les tests
|
||||||
|
tests="tous"
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# exécuter les tests fournis en argument
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# S'assurer que le script de test est à jour
|
||||||
|
make ${TESTFILE}
|
||||||
|
|
||||||
|
if [[ "$tests" == "tous" ]]
|
||||||
then
|
then
|
||||||
if [[ "$1" == "-a" ]]
|
# exécuter tous les tests
|
||||||
then
|
COMMEXEC="${COMMANDE} ${TESTFILE}"
|
||||||
# exécuter tous les tests
|
eval ${COMMEXEC} 2>&1 | traiter_test
|
||||||
COMMANDE="${COMMANDE} ${TESTFILE}"
|
elif [[ $# -gt 0 ]]
|
||||||
eval ${COMMANDE} 2>&1 | traiter_test
|
# exécuter les tests passés en arguments
|
||||||
else
|
then
|
||||||
for test in "$@"
|
for test in "$@"
|
||||||
do
|
do
|
||||||
echo "Tester « $test »"
|
echo "Tester « $test »"
|
||||||
COMMANDE="${COMMANDE} -f \"$test\" ${TESTFILE}"
|
COMMEXEC="${COMMANDE} -f \"$test\" ${TESTFILE}"
|
||||||
eval ${COMMANDE} 2>&1 | traiter_test
|
eval ${COMMEXEC} 2>&1 | traiter_test
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
# Afficher les noms des suites de tests
|
# Afficher les noms des suites de tests
|
||||||
lesTests=$(awk \
|
lesTests=$(awk \
|
||||||
'/"suites"/ { suite=1 } ; \
|
'/"suites"/ { suite=1 } ; \
|
||||||
$1 ~ /"name":/ && suite { print gensub(/^.*: "(.+)",$/, "\\1", "g")}' \
|
$1 ~ /"name":/ && suite { print gensub(/^.*: "(.+)",$/, "\\1", "g")}' \
|
||||||
paheko.side | \
|
${TESTFILE} | \
|
||||||
sort | \
|
sort | \
|
||||||
zenity \
|
zenity \
|
||||||
--width=440 --height=500 \
|
--width=440 --height=500 \
|
||||||
@ -98,10 +122,10 @@ else
|
|||||||
IFS="\|"
|
IFS="\|"
|
||||||
for test in $lesTests
|
for test in $lesTests
|
||||||
do
|
do
|
||||||
COMMANDE="${COMMANDE} -f \"$test\" ${TESTFILE}"
|
COMMEXEC="${COMMANDE} -f \"$test\" ${TESTFILE}"
|
||||||
CURIFS=$IFS
|
CURIFS=$IFS
|
||||||
IFS=$OLDIFS
|
IFS=$OLDIFS
|
||||||
eval ${COMMANDE} 2>&1 | traiter_test
|
eval ${COMMEXEC} 2>&1 | traiter_test
|
||||||
IFS=$CURIFS
|
IFS=$CURIFS
|
||||||
done
|
done
|
||||||
IFS=$OLDIFS
|
IFS=$OLDIFS
|
||||||
|
Loading…
Reference in New Issue
Block a user