Created
August 7, 2012 17:22
-
-
Save Phhere/3287469 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SOURCE_FILE=`ls *.c` | |
COUNT=$(echo "$SOURCE_FILE" | wc -w) | |
if [ $COUNT=0 ]; then | |
echo "Source File: $SOURCE_FILE" | |
gcc -o carcassonne $SOURCE_FILE | |
for ((i=1;i<=14;i++)) | |
do | |
echo "Beispiel $i" | |
./carcassonne play "Tests/beispiel_$i/karten.txt" > /dev/null | |
OUTPUT_TOOL=`md5sum ausgabe.txt | awk '{ print $1 }'` | |
OUTPUT_EXPECTED=`md5sum "Tests/beispiel_$i/ausgabe.txt" | awk '{ print $1 }'` | |
echo $OUTPUT_TOOL | |
echo $OUTPUT_EXPECTED | |
if [ "$OUTPUT_TOOL" == "$OUTPUT_EXPECTED" ];then | |
echo "Korrekt" | |
else | |
echo "Fehlerhaft" | |
#diff ausgabe.txt "Tests/beispiel_$i/ausgabe.txt" | |
fi | |
echo "" | |
done | |
else | |
echo "Es gibt mehr als eine .c Datei:" | |
echo $SOURCE_FILE | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
!/bin/bash
gcc -o carcassone main.c
for ((i=1;i<=14;i++))
do
echo "Beispiel $i"
./carcassone play "Tests/beispiel_$i/karten.txt" > /dev/null
OUTPUT_TOOL=$(md5sum ausgabe.txt|awk '{print $1}')
OUTPUT_EXPECTED=$(md5sum "Tests/beispiel_$i/ausgabe.txt"|awk '{print $1}')
if ["$OUTPUT_TOOL" = "$OUTPUT_EXPECTED"];then
echo "Korrekt"
else
echo "Fehlerhaft:"
diff ausgabe.txt "Tests/beispiel_$i/ausgabe.txt"
fi
#md5sum ausgabe.txt
#md5sum "Tests/beispiel_$i/ausgabe.txt"
echo ""
done