Compare commits

..

No commits in common. "f1054a71cadc8ee40c2278de6eb4bc1f15381293" and "32dd66f0a827c48c9f97e42e6fa42287de16874d" have entirely different histories.

3 changed files with 2 additions and 12 deletions

View file

View file

14
test.sh
View file

@ -40,24 +40,14 @@ process_args () {
function usage (){
msg "\n**Script de test de code retour**\n"
msg "Ce script permet de comparer les codes retour attendu et ceux obtenus\n"
msg "Dans le cadre du Mooc bash de la licence ADSILLH\n"
msg "\n__USAGE__\n\n"
msg "$0 -d <rep> -s <script> -t <test>\n\n"
msg "-d\trépertoire ou se trouve le script à tester\n"
msg "-s\tnom du script à tester\n"
msg "-t\tfichier texte contenant les paramètres et codes retour attendus\n"
msg "\tCe fichier contient un test par lignes sous la forme\n"
msg "\t<arguments>**:**<code_retour_attendu>\n\n"
msg "Dans le cadre du Mooc bash de la licence ADSILLH\n\n"
}
msg "**ADSILLH Bash return code test**\n"
echo " Hououuuu ${PWD}"
process_args $@
[[ -z $COMMAND || -z $TEST_FILE ]] && error "You must specity a command and a test file"
msg "Test $COMMAND script with $TEST_FILE\n\n"
cd $DIR
[ ! -f $COMMAND ] && error "script **$COMMAND** not found"
while IFS='' read -r i || [[ -n "$line" ]]; do
args=$(echo $i | cut -d: -f1)
e_code=$(echo $i | cut -d: -f2)