File: test.sh

package info (click to toggle)
pyxb 1.2.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 63,792 kB
  • ctags: 48,994
  • sloc: python: 235,928; sh: 803; xml: 657; makefile: 57
file content (30 lines) | stat: -rwxr-xr-x 807 bytes parent folder | download | duplicates (2)
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
TEST_URI=http://www.w3.org/People/mimasa/test/xhtml/media-types/test.xhtml

aout="${0}"

fail () {
  echo 1>&2 "${aout} FAILED: ${@}"
  exit 1
}

if [ ! -f in.xhtml ] ; then
  wget -O in.xhtml ${TEST_URI} || fail Unable to retrieve test document
fi
python rewrite.py || fail Unable to rewrite test document

xmllint --format in.xhtml > inf.xhtml
xmllint --format out.xhtml > outf.xhtml
diff -uw inf.xhtml outf.xhtml > deltas

# Need to manually validate that outf.xhtml and in.xhtml are about the
# same.  The rewrite does not preserve the order of attributes in the
# elements.
echo "See deltas for differences"

# Test most primitive generation of documents
rm -f genout.xhtml
python generate.py \
  && diff expout.xhtml genout.xhtml \
  || fail generate did not match expected

echo "Passed XHTML tests"