source: tests/scripts/checkxml.sh @ 0018ac0

Last change on this file since 0018ac0 was 0018ac0, checked in by zzz <zzz@…>, 10 years ago

run test scripts at release time

  • Property mode set to 100755
File size: 4.7 KB
Line 
1#
2# Validate XML and HTML files using xmllint
3# Returns nonzero on failure
4#
5# Note that the news.xml and initialNews*.xml files are really HTML
6#
7# zzz 2011-03
8# public domain
9#
10
11cd `dirname $0`/../..
12
13XMLFILES="\
14./apps/addressbook/build.xml \
15./apps/addressbook/web.xml \
16./apps/BOB/build.xml \
17./apps/BOB/Demos/echo/echoclient/build.xml \
18./apps/BOB/Demos/echo/echoclient/nbproject/build-impl.xml \
19./apps/BOB/Demos/echo/echoclient/nbproject/private/private.xml \
20./apps/BOB/Demos/echo/echoclient/nbproject/project.xml \
21./apps/BOB/Demos/echo/echoserver/build.xml \
22./apps/BOB/Demos/echo/echoserver/nbproject/build-impl.xml \
23./apps/BOB/Demos/echo/echoserver/nbproject/private/private.xml \
24./apps/BOB/Demos/echo/echoserver/nbproject/project.xml \
25./apps/BOB/nbproject/build-impl.xml \
26./apps/BOB/nbproject/project.xml \
27./apps/desktopgui/build.xml \
28./apps/fortuna/build.xml \
29./apps/i2psnark/java/build.xml \
30./apps/i2psnark/jetty-i2psnark.xml \
31./apps/i2psnark/web.xml \
32./apps/i2ptunnel/java/build.xml \
33./apps/i2ptunnel/jsp/web.xml \
34./apps/jetty/build.xml \
35./apps/ministreaming/java/build.xml \
36./apps/routerconsole/java/build.xml \
37./apps/routerconsole/jsp/web.xml \
38./apps/sam/java/build.xml \
39./apps/streaming/java/build.xml \
40./apps/susidns/src/build.xml \
41./apps/susidns/src/WEB-INF/web-template.xml \
42./apps/susimail/build.xml \
43./apps/susimail/src/WEB-INF/web.xml \
44./apps/systray/java/build.xml \
45./build.xml \
46./core/java/build.xml \
47./core/java/nbproject/project.xml \
48./installer/i2pinstaller.xml \
49./installer/i2pstandalone.xml \
50./installer/install.xml \
51./installer/lib/launch4j/build.xml \
52./installer/resources/jetty.xml \
53./installer/resources/shortcutSpec.xml \
54./router/java/build.xml \
55./Slackware/i2p-base/build.xml \
56./Slackware/i2p/build.xml"
57
58HTMLFILES="\
59./installer/resources/initialNews/*.xml \
60./installer/resources/news.xml \
61./apps/BOB/src/net/i2p/BOB/package.html \
62./apps/desktopgui/src/net/i2p/desktopgui/package.html \
63./apps/ministreaming/java/src/net/i2p/client/streaming/package.html \
64./apps/routerconsole/jsp/i2psnark/index.html \
65./apps/susidns/src/index.html \
66./apps/susimail/src/index.html \
67./core/java/src/net/i2p/client/datagram/package.html \
68./core/java/src/net/i2p/client/naming/package.html \
69./core/java/src/net/i2p/client/package.html \
70./core/java/src/net/i2p/crypto/package.html \
71./core/java/src/net/i2p/data/i2cp/package.html \
72./core/java/src/net/i2p/data/package.html \
73./core/java/src/net/i2p/internal/package.html \
74./core/java/src/net/i2p/package.html \
75./core/java/src/net/i2p/stat/package.html \
76./core/java/src/net/i2p/time/package.html \
77./core/java/src/net/i2p/util/package.html \
78./installer/resources/eepsite.help/help/index_de.html \
79./installer/resources/eepsite.help/help/index_fr.html \
80./installer/resources/eepsite.help/help/index.html \
81./installer/resources/eepsite.help/help/index_na.html \
82./installer/resources/eepsite.help/help/index_nl.html \
83./installer/resources/eepsite.help/help/index_ru.html \
84./installer/resources/eepsite.help/help/index_sv.html \
85./installer/resources/eepsite.help/help/pagetemplate.html \
86./installer/resources/eepsite.help/index.html \
87./installer/resources/readme/readme_ar.html \
88./installer/resources/readme/readme_de.html \
89./installer/resources/readme/readme_es.html \
90./installer/resources/readme/readme_fr.html \
91./installer/resources/readme/readme.html \
92./installer/resources/readme/readme_nl.html \
93./installer/resources/readme/readme_pt.html \
94./installer/resources/readme/readme_ru.html \
95./installer/resources/readme/readme_sv.html \
96./installer/resources/readme/readme_zh.html \
97./installer/resources/small/toolbar.html \
98./installer/resources/startconsole.html \
99./router/java/src/net/i2p/data/i2np/package.html \
100./router/java/src/net/i2p/router/package.html \
101./router/java/src/net/i2p/router/peermanager/package.html \
102./router/java/src/net/i2p/router/startup/package.html \
103./router/java/src/net/i2p/router/transport/ntcp/package.html \
104./router/java/src/net/i2p/router/transport/package.html \
105./router/java/src/net/i2p/router/transport/udp/package.html \
106./router/java/src/net/i2p/router/util/package.html"
107
108echo 'Checking XML files....................'
109for i in $XMLFILES
110do
111        echo "Checking $i ..."
112        xmllint --noout $i
113        if [ $? -ne 0 ]
114        then
115                echo "********* FAILED CHECK FOR $i *************"
116                FAIL=1
117        fi
118done
119
120echo 'Checking HTML files....................'
121for i in $HTMLFILES
122do
123        echo "Checking $i ..."
124        xmllint --html --noout $i
125        # FIXME html mode never exits with an error code
126        # ... but it does output errors
127        if [ $? -ne 0 ]
128        then
129                echo "********* FAILED CHECK FOR $i *************"
130                FAIL=1
131        fi
132done
133
134if [ "$FAIL" != "" ]
135then
136        echo "******** At least one file failed check *********"
137else
138        echo "All files passed"
139fi
140exit $FAIL
Note: See TracBrowser for help on using the repository browser.