-
Notifications
You must be signed in to change notification settings - Fork 0
/
test
executable file
·49 lines (42 loc) · 1.23 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
#!/bin/bash
RED="\e[31m"
GREEN="\e[32m"
YELLOW="\e[33m"
NORMAL="\e[0;39m"
OK=0
FAILED=0
version=$(eye --version 2>&1 | grep EYE | awk '{ print $2 }')
echo -e "${YELLOW}-------------------${NORMAL}"
echo -e "${YELLOW}Running rdfpackages${NORMAL}"
echo -e "${YELLOW}eye $version${NORMAL}"
echo -e "${YELLOW}-------------------${NORMAL}"
echo ""
pad () {
[ "$#" -gt 1 ]
[ -n "$2" ]
printf "%$2.${2#-}s" "$1"
}
begin=$(($(date +%s)))
for file in *.trig
do
echo -en "$(pad "${file}" -24)"
start=$(($(date +%s%N)/1000000))
eye --quiet --skolem-genid 8b98b360-9a70-4845-b52c-c675af60ad01 --wcache https://eyereasoner.github.io/rdfpackages . --rdf-trig-output https://eyereasoner.github.io/rdfpackages/$file --output output/$file
end=$(($(date +%s%N)/1000000))
echo -en "${YELLOW}$(pad "`expr $end - $start` msec" 12)${NORMAL} "
if [[ $(git diff output/${file} | wc -l) -eq 0 ]]; then
echo -e "${GREEN}OK${NORMAL}"
((OK++))
else
echo -e "${RED}FAILED${NORMAL}"
((FAILED++))
fi
done
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