forked from CofiTy/XmlParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscriptTest
More file actions
executable file
·99 lines (79 loc) · 2.33 KB
/
scriptTest
File metadata and controls
executable file
·99 lines (79 loc) · 2.33 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
nbOK=0
courant=1
echo "Validation de plusiers XML-DTD"
echo
echo "Test Validation nº1"
echo "Validation d'un fichier XML avec un fichier DTD avec que de declaration d'elements"
./analyse Test/rap1.xml > Test/output1
if ! diff Test/output1 Test/modelOutput1 > /dev/null ; then
echo "Test $courant fail. (sortie)"
else
if ! diff Test/rap1-Transformed.html Test/modelOutput1.1 > /dev/null; then
echo "Test $courant fail. (html genere)"
else
echo "Test $courant OK."
let "nbOK=nbOK+1"
fi
fi
echo
let "courant=courant+1"
echo "Test Validation nº2"
echo "Validation d'un fichier XML avec un fichier DTD avec que de declaration d'elements et attributes melangés"
./analyse Test/rap2.xml > Test/output2
if ! diff Test/output2 Test/modelOutput2 > /dev/null ; then
echo "Test $courant fail. (sortie)"
else
echo "Test $courant OK."
let "nbOK=nbOK+1"
fi
echo
let "courant=courant+1"
echo "Test Validation nº3"
echo "Validation d'un fichier XML avec un fichier DTD un peu plus complique,avec des cardinalites [0...n] et une structure données en forme d'arbre."
./analyse -s Test/rap4.xml Test/rap4.xsl > Test/output3
if ! diff Test/output3 Test/modelOutput3 > /dev/null ; then
echo "Test $courant fail. (sortie)"
else
if ! diff Test/rap4-Transformed.html Test/modelOutput3.1 > /dev/null; then
echo "Test $courant fail. (html genere)"
else
echo "Test $courant OK."
let "nbOK=nbOK+1"
fi
fi
echo
let "courant=courant+1"
echo "Test Validation nº4"
echo "Fichier xml non valide."
./analyse Test/non_valide.xml > Test/output4 2>&1
if ! diff Test/output4 Test/modelOutput4 > /dev/null 2>&1 ; then
echo "Test $courant fail. (sortie)"
else
echo "Test $courant OK."
let "nbOK=nbOK+1"
fi
echo
let "courant=courant+1"
echo "Test Validation nº5"
echo "Fichier ne correspondant pas à la DTD."
./analyse Test/not_dtd_compliant.xml > Test/output5 2>&1
if ! diff Test/output5 Test/modelOutput5 > /dev/null 2>&1 ; then
echo "Test $courant fail. (sortie)"
else
echo "Test $courant OK."
let "nbOK=nbOK+1"
fi
echo
let "courant=courant+1"
echo "Test Validation nº6"
echo "Recuperation d'erreurs."
./analyse Test/rap7.xml > Test/output6 2>&1
if ! diff Test/output6 Test/modelOutput6 > /dev/null 2>&1 ; then
echo "Test $courant fail. (sortie)"
else
echo "Test $courant OK."
let "nbOK=nbOK+1"
fi
echo
echo "$nbOK tests passes sur $courant ."