-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.sh
executable file
·45 lines (41 loc) · 1.44 KB
/
test.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
#!/bin/bash
error=false
# for files in tests/valid no output should be given
FILES="$(pwd)/tests/valid/skos.shacl.ttl/*"
for f in $FILES
do
echo "Processing $f ..."
# take action on each file. $f store current file name
scripts/validate-skos -s skos.shacl.ttl -l all "$f" 2>/dev/null
if test $? -eq 1; then echo "Error: $f should be valid, but is invalid"; error=true; fi;
done
# for files in tests/invalid output should be received
FILES="$(pwd)/tests/invalid/skos.shacl.ttl/*"
for f in $FILES
do
echo "Processing $f ..."
# validate with script and log error messages to dev null
scripts/validate-skos -s skos.shacl.ttl -l all "$f" 2>/dev/null
if test $? -eq 0; then echo "Error: $f should be invalid, but is valid"; error=true; fi
done
FILES="$(pwd)/tests/valid/skohub.shacl.ttl/*"
for f in $FILES
do
echo "Processing $f ..."
# take action on each file. $f store current file name
scripts/validate-skos -s skohub.shacl.ttl -l all "$f" 2>/dev/null
if test $? -eq 1; then echo "Error: $f should be valid, but is invalid"; error=true; fi;
done
FILES="$(pwd)/tests/invalid/skohub.shacl.ttl/*"
for f in $FILES
do
echo "Processing $f ..."
# validate with script and log error messages to dev null
scripts/validate-skos -s skohub.shacl.ttl -l all "$f" 2>/dev/null
if test $? -eq 0; then echo "Error: $f should be invalid, but is valid"; error=true; fi
done
if test "$error" = true;
then
echo "There were errors in your tests!"
exit 1
fi