-
Notifications
You must be signed in to change notification settings - Fork 1
/
test
executable file
·53 lines (46 loc) · 1.08 KB
/
test
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
#!/bin/bash
RED="\e[31m"
GREEN="\e[32m"
YELLOW="\e[33m"
NORMAL="\e[0;39m"
OK=0
FAILED=0
echo -e "${YELLOW}-------------------${NORMAL}"
echo -e "${YELLOW}Running retina/test${NORMAL}"
echo -e "${YELLOW}-------------------${NORMAL}"
echo ""
export PROLOG="${1:-tpl}"
export RETINA=`pwd`/retina.pl
pad () {
[ "$#" -gt 1 ]
[ -n "$2" ]
printf "%$2.${2#-}s" "$1"
}
begin=$(($(date +%s)))
pushd rdfsurfaces > /dev/null
for dir in */
do
pushd "${dir}" > /dev/null
echo -en "$(pad "${dir}" -24)"
start=$(($(date +%s%N)/1000000))
./test > /dev/null
end=$(($(date +%s%N)/1000000))
echo -en "${YELLOW}$(pad "`expr $end - $start` msec" 12)${NORMAL} "
if [[ $(git diff . | wc -l) -eq 0 ]]; then
echo -e "${GREEN}OK${NORMAL}"
((OK++))
else
echo -e "${RED}FAILED${NORMAL}"
((FAILED++))
fi
popd > /dev/null
done
popd > /dev/null
end=$(($(date +%s)))
echo ""
echo -e "${YELLOW}`expr $end - $begin` sec${NORMAL} ${GREEN}${OK} OK${NORMAL} ${RED}${FAILED} FAILED${NORMAL}"
if [[ ${FAILED} -eq 0 ]]; then
exit 0
else
exit 2
fi