summaryrefslogtreecommitdiff
path: root/xml2po/tests/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'xml2po/tests/test.py')
-rwxr-xr-xxml2po/tests/test.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/xml2po/tests/test.py b/xml2po/tests/test.py
index 512eed9..c482b6e 100755
--- a/xml2po/tests/test.py
+++ b/xml2po/tests/test.py
@@ -1,7 +1,15 @@
#!/usr/bin/env python
import sys, os
-SIMPLETESTS = ['deep-finals.xml', 'deep-nonfinals.xml', 'attribute-entities.xml', 'docbook.xml', 'utf8-original.xml', 'footnotes.xml', 'keepents.xml' ]
+SIMPLETESTS = { 'deep-finals.xml' : {},
+ 'deep-nonfinals.xml': {},
+ 'attribute-entities.xml': {},
+ 'docbook.xml' : {},
+ 'utf8-original.xml': {},
+ 'footnotes.xml': {},
+ 'keepents.xml': { "options" : "-k" },
+ 'adjacent-ents.xml': { "options" : "-k" },
+ }
OTHERTESTS = [ ('relnotes', 'test.sh') ]
@@ -9,16 +17,23 @@ if len(sys.argv) > 1:
input = sys.argv[1]
pot = input.replace(".xml", ".pot")
po = input.replace(".xml", ".po")
+ myopts = ""
+ if len(sys.argv) > 2:
+ for opt in sys.argv[2:]:
+ myopts += " " + opt
output = input.replace(".xml", ".xml.out")
- ret = os.system("../xml2po %s | sed 's/\"POT-Creation-Date: .*$/\"POT-Creation-Date: \\\\n\"/' | diff -u %s -" % (input, pot))
+ ret = os.system("../xml2po %s %s | sed 's/\"POT-Creation-Date: .*$/\"POT-Creation-Date: \\\\n\"/' | diff -u %s -" % (myopts, input, pot))
if ret:
print "Problem: extraction from '%s'" % (input)
- ret = os.system("../xml2po -p %s %s | diff -u %s -" % (po, input, output))
+ ret = os.system("../xml2po -p %s %s %s | diff -u %s -" % (po, myopts, input, output))
if ret:
print "Problem: merging translation into '%s'" % (input)
else:
for t in SIMPLETESTS:
- if os.system("%s %s" % (sys.argv[0], t)):
+ if SIMPLETESTS[t].has_key("options"):
+ myopts = SIMPLETESTS[t]["options"]
+ else: myopts = ""
+ if os.system("%s %s %s" % (sys.argv[0], t, myopts)):
print "WARNING: Test %s failed." % (t)
for t in OTHERTESTS: