source: tests/scripts/checkxml.sh @ b30e1f5

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

two more simple test scripts

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