-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunTester.sh
executable file
·51 lines (40 loc) · 897 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
#!/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.propios.caso1.txt salida.catedra.caso1.txt > /tmp/diff1
if [ $? -ne 0 ]; then
echo " **Discrepancia en el caso 1"
ERRORDIFF=1
fi
$DIFFER salida.propios.caso2.txt salida.catedra.caso2.txt > /tmp/diff2
if [ $? -ne 0 ]; then
echo " **Discrepancia en el caso 2"
ERRORDIFF=1
fi
echo " "
if [ $ERRORDIFF -eq 0 ]; then
echo "**Todos los tests pasan"
fi
echo " "