-
Notifications
You must be signed in to change notification settings - Fork 0
/
runTester.sh
executable file
·56 lines (45 loc) · 1022 Bytes
/
runTester.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
reset
echo " "
echo "**Compilando"
make tester
if [ $? -ne 0 ]; then
echo " **Error de compilacion"
exit 1
fi
echo " "
echo "**Corriendo Valgrind"
command -v valgrind > /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: No se encuentra valgrind."
exit 1
fi
valgrind --show-reachable=yes --leak-check=full --error-exitcode=1 ./tester
if [ $? -ne 0 ]; then
echo " **Error de memoria"
exit 1
fi
echo " "
echo "**Corriendo diferencias con la catedra"
DIFFER="diff -d"
ERRORDIFF=0
$DIFFER salida.caso1.txt salida.caso1.catedra.txt > /tmp/diff1
if [ $? -ne 0 ]; then
echo " **Discrepancia en el caso 1"
ERRORDIFF=1
fi
$DIFFER salida.caso2.txt salida.caso2.catedra.txt > /tmp/diff2
if [ $? -ne 0 ]; then
echo " **Discrepancia en el caso 2"
ERRORDIFF=1
fi
$DIFFER salida.caso3.txt salida.caso3.catedra.txt > /tmp/diff3
if [ $? -ne 0 ]; then
echo " **Discrepancia en el caso 3"
ERRORDIFF=1
fi
echo " "
if [ $ERRORDIFF -eq 0 ]; then
echo "**Todos los tests pasan"
fi
echo " "