Created
April 26, 2012 15:52
-
-
Save MasseGuillaume/2500535 to your computer and use it in GitHub Desktop.
log1000 correction tp4
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/sh | |
SOURCE=tictactoe.cpp | |
SOURCE_TMP=tmp_tictactoe.cpp | |
DIFF_FAIL="ok" | |
COMPILE_FAIL="ok" | |
cp $SOURCE $SOURCE_TMP | |
#test patches | |
for diff in *.diff | |
do | |
#patch | |
echo "+ "$diff | |
patch $SOURCE < $diff &> /dev/null | |
#compile | |
# make clean &> /dev/null | |
make test &> /dev/null | |
# compile must not fail | |
if [ "$?" != "0" ]; then | |
COMPILE_FAIL="$COMPILE_FAIL $diff" | |
fi | |
./ttt_test &> /dev/null | |
# test must fail | |
if [ "$?" == "0" ]; then | |
DIFF_FAIL="$DIFF_FAIL $diff" | |
fi | |
rm $SOURCE | |
cp $SOURCE_TMP $SOURCE | |
done; | |
rm $SOURCE_TMP | |
echo "DIFFs: `ls *.diff | wc -l`" | |
if [ DIFF_FAIL != "ok" ]; then | |
for diff in $DIFF_FAIL | |
do | |
echo $diff | |
done; | |
fi | |
echo "Compile:" | |
if [ COMPILE_FAIL != "ok" ]; then | |
for fail in $COMPILE_FAIL | |
do | |
echo $fail | |
done; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment