# test script for xmilltest by Hedzer Westra <hhwestra@cs.uu.nl>
#
# parsing format:
# - whitespaces at begin & end of each line are trimmed
# - blank lines and lines starting with # are ignored
# - * at the start: enable setting mode
#   possible settings:
#    nozip | gzip | bzip2 | ppmdi	general-purpose compressor
#    gpcidx <level>			compressor level, valid for gzip and ppmdii
#					 for gzip, valid values are 1-9, default 6
#					 for ppmdii, valid values are 0-18, default 0
#					Note that these defaults are automatically
#					 set when choosing gzip or ppmdi!
#    lossy | lossless			drop / maintain whitespace
#    decomp | compdecomp | targetsize	test type
#     decomp: decompress, compare to original
#      accepts two file names: first XML, second XMI
#     compdecomp: compress, uncompress, compare to original
#      accepts one file name. .xmill is calculated from this
#     targetsize: same as compdecomp, but first accepts a target file size
#      an error msg is printed if this size is not matched
#    exprs | plain			use path expressions (.xmill file) or not
#    silent | verbose <level>		XMill verbose level (0-4, 0=silent)
#    noinc | allowinc			allow XMI file > XML file or not
#    ignorewhite | exact		when comparing original to decompressed
#					 file, compare with or without whitespace	
#    stats <level>			xmilltest verbose level (0-5, 0=silent)
#    mustfail | mustnotfail		whether an error should or should not
#                                        arise
#    quit				jump out immediately
#
#   defaults:
#    bzip2 lossy compdecomp plain silent noinc exact stats 2 mustnotfail
#
#   multiple settings on one line are possible, separate by a space
#   unmentioned settings are unmodified
#
# - other lines accept a number and a list of files, which are then run
#    the specified number of times using the current settings

*allowinc lossless plain stats 4 ignorewhite verbose 2

#Enable this to halt a compression as soon as the original XML size is surpassed.
#Clients that enable this should detect error XMILL_ERR_XMIFILELARGER (18) and
#then use the XML file verbatim as 'compressed' XMI. XMill will 'decompress' 
#(i.e. copy) an XML file without problems.
#* noinc

#block (de)comp test
# note: blocksize must be larger than largest element name or text item!
# note: this is quite slow
*blocks 2000 exprs
#1 base64img.xml shakespeare.xml simple.xml bla.xml tpc.xml dblp.xml sprot.xml
*plain blocks 0

# mustfail tests
*mustfail
#unclosed elements robustness
#1 unclosed.xml
#non-existent files 
1 foobar.xml
* decomp
1 foobar.xml foobar.xmi
#wrong targetsize
* targetsize
1 314159 simple.xml
* compdecomp
*mustnotfail

#basexnum test (hex, hexcase, bin and base64 compressors)
*exprs
1 base64img.xml bla.xml 
*plain

#large test - warning, the XML is 150MiB, which takes about 4 hours due to
# sloppy in-mem API code using realloc()...
#compressing this to file takes about 3 minutes on my Athlon XP 2000+.
#*lossless
#1 large.xml
#*quit

#decomp test
*decomp
3 shakespeare.xml shakespeare.xmi
*compdecomp

#nozip/gzip/bzip2/ppmdi test
#NoZip will start and end each data stream with 'NOZIP' and copy the data
#verbatim. This allows for inspection of the XMill file format and shows the
#XMill intrinsic compression rate, but other than that it is not really useful.
*nozip
3 tpc.xml shakespeare.xml dblp.xml sprot.xml bla.xml simple.xml treebank.xml weblog.xml base64img.xml
*gzip
3 tpc.xml shakespeare.xml dblp.xml sprot.xml bla.xml simple.xml treebank.xml weblog.xml base64img.xml
*bzip2
3 tpc.xml shakespeare.xml dblp.xml sprot.xml bla.xml simple.xml treebank.xml weblog.xml base64img.xml
*ppmdi
3 tpc.xml shakespeare.xml dblp.xml sprot.xml bla.xml simple.xml treebank.xml weblog.xml base64img.xml

#targetsize tests for exprs/plain and lossy/lossless combinations on four
# different XML files 
*targetsize bzip2
3 53373 shakespeare.xml

*lossy
3 52539 shakespeare.xml

#shakespeare.xml is not regular and therefore has no .xmill file, so no exprs test

3 2754 sprot.xml

*lossless
3 2881 sprot.xml

#note, size *with* exprs is actually larger!
*exprs
3 3245 sprot.xml

*lossy
3 3099 sprot.xml

3 37653 tpc.xml

*lossless
3 38128 tpc.xml

*plain
3 38703 tpc.xml

*lossy
3 38297 tpc.xml

3 16119 dblp.xml

#note, size *with* exprs is actually larger!
*exprs
3 18249 dblp.xml

*lossless
3 18506 dblp.xml

*plain
3 16393 dblp.xml
