Skip to content
Extraits de code Groupes Projets
Valider 91cd3ed1 rédigé par Corentin Lengelé's avatar Corentin Lengelé
Parcourir les fichiers

Added colors for make test

parent 9b5529a1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -5,26 +5,30 @@ define diff_bash =
./fact example_input.txt test_output.txt
diff -q <(sort test_output.txt) <(sort example_output.txt) 1>/dev/null
if [ $? == 0 ]; then \
echo "output.txt and example_output.txt have the same lines (correct)"; \
echo "$(tput setaf 2)output.txt and example_output.txt have the same lines (correct)$(tput sgr 0)"; \
else \
echo "output.txt and example_output.txt have differents lines (incorrect)"; \
echo "$(tput setaf 1)output.txt and example_output.txt have differents lines (incorrect)$(tput sgr 0)"; \
fi
endef
fact:
gcc main.c -o fact -std=c99 -lm -lpthread
gcc main.c -o fact -std=c99 -lm -lpthread -Wno-implicit-function-declaration
clean:
rm -f fact test_prime_divs valgrind_result.txt cppcheck_result.txt test_output.txt
test: fact
gcc -o test_prime_divs test_prime_divs.c -std=c99 -lpthread -Wall -lm -lcunit
gcc -o test_prime_divs test_prime_divs.c -std=c99 -lpthread -Wall -lm -lcunit -Wno-implicit-function-declaration
tput setaf 4
./test_prime_divs
tput sgr 0
rm test_prime_divs
$(value diff_bash)
valgrind --tool=memcheck --log-file="valgrind_result.txt" ./fact example_input.txt test_output.txt
rm test_output.txt
cppcheck --enable=all --output-file=cppcheck_result.txt main.c
tput setaf 2
echo "For Valgrind result, check valgrind_result.txt"
echo "For Cppcheck result, check cppcheck_result.txt"
tput sgr 0
.ONESHELL:
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter