#!/bin/bash make echo_title () { echo -e "\033[0;34m$@\033[0m" } echo_title "=== Alpha-équivalence ===" for file in tests/alpha_equiv/*.lam; do echo "-- $file" ./pieuvre -alpha $file >/dev/null done echo_title "=== Bêta-réduction ===" for file in tests/lam/*.lam; do echo "-- $file" ./pieuvre -reduce $file >/dev/null done echo_title "=== Preuves ===" for file in tests/8pus/*.8pus; do echo "-- $file" ./pieuvre $file >/dev/null done echo_title "-== Preuves avec erreurs ==-" for file in tests/8pus/bad/*.8pus; do # On vérifie deux choses: # - Un message d'erreur s'affiche bien # - Le code de sortie est bien 0 echo "-- $file" error=$(./pieuvre $file 2>&1 1>/dev/null) retVal=$? if [ $retVal -ne 0 ]; then echo -e "\033[0;31mNon-0 exit code, see stderr:\033[0m" echo $error elif [[ $error == "" ]]; then echo -e "\033[0;31mNo message in stderr\033[0m" fi done