Browse Source

[enh] unit tests: add color output if succeed or not. diff output is used.

Moul 3 years ago
parent
commit
c28b362592
1 changed files with 6 additions and 1 deletions
  1. 6 1
      tests.sh

+ 6 - 1
tests.sh

@@ -168,10 +168,15 @@ echo "\033[0;35m##### TESTS UNITAIRES DU SHELL #####\033[0m"
 
 for tu in $tests
 do
-	echo "\033[0;32m>>>> Test \"$tu\" <<<<\033[0m"
+	echo "\033[0;33m>>>> Test \"$tu\" <<<<\033[0m"
 	./$TSH -c $tu > $TSHO
 	$SH -c $tu > $SHO
 	diff $TSHO $SHO
+	if [ `echo $?` = 0 ]; then
+		echo "\033[0;32m Succeed \033[0m"
+	else
+		echo "\033[0;31m Failed \033[0m"
+	fi
 	echo ""
 done
 echo "\033[0;32m>>>> Test \"sh shell_script.sh\" <<<<\033[0m"