Test cases are in cases.tsv:
- tab separated values
- one row per test case
- for multiple test cases with the same resource have multiple rows with the same resource
- at least three columns should be present on a row
- resource
- project
- endpoint
- The subsequent columns are used for parameter values. They should make sense for the endpoint.
Show help:
python3 run.py -hRun tests:
cat cases.tsv | python3 run.pyOr using -i param:
python3 run.py -i cases.tsvYou need implement two shell scripts navigation.sh and document.sh
or provide two commands with the --document or --navigation
parameter. The scripts or commands are expected to return the
endpoint's output on stdout and error messages on stderr.
You can choose between different types of parameter styles with the
-p option. Use the --shell switch to call the commands via the
system shell.
Example for DTS Transformations:
document.sh
#!/bin/sh
SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
$SCRIPTPATH/target/bin/xslt.sh -config:$SCRIPTPATH/test/saxon.xml -xsl:$SCRIPTPATH/xsl/document.xsl -it -ea:on $@navigation.sh is the same, but uses an other XSLT stylesheet.
Running the test suite this like so:
python3 run.py -i cases.tsv -d '../document.sh' -n '../navigation.sh' -p equalsAlternative without shell scripts:
python3 run.py -i cases.tsv \
-d '../target/bin/xslt.sh -config:../test/saxon.xml -xsl:../xsl/document.xsl -ea:on -it' \
-n '../target/bin/xslt.sh -config:../test/saxon.xml -xsl:../xsl/navigation.xsl -ea:on -it' \
-p equals \
--shellRun python3 run.py -h to get help:
Output as of 2025-10-22:
usage: run.py [-h] [-i FILE] [--delim CHARACTER] [-n COMMAND] [-d COMMAND] [-o DIRECTORY] [-p FUNCTION_NAME] [-r FUNCTION_NAME] [--log FILE]
Make output for the DTS community test cases running the configured implementation
options:
-h, --help show this help message and exit
-i, --infile FILE CSV/TSV file with test cases, one case per line. Defaults to stdin
--delim CHARACTER Delimiter. Default to TAB for TSV input.
-n, --navigation COMMAND
Command to be called for a test case on the navigation endpoint. Defaults to ./navigation.sh
-d, --document COMMAND
Command to be called for a test case on the document endpoint. Default to ./document.sh
-o, --outputDir DIRECTORY
Base directory of the output files. Default to: output
-p, --parameterStyle FUNCTION_NAME
How parameters are passed to the endpoint commands. Allowed values: ['equals', 'query', 'bash', 'java']. Default to: equals
-r, --driver FUNCTION_NAME
How the endpoint command is called. Allowed values: ['cmd', 'shell']. Defaults to: cmd
--log FILE Log file. Defaults to stderr
For more info seeThere are two files per test case:
.jsonfor navigation endpoint or.xmlfor document endpoint holds the result.loghas an error log
Output file tree as of 2025-10-21:
output/
├── dts-transformations
│ ├── document?resource=john.xml&start=p.1.start&end=p.1.end&tree=page-hateoas.log
│ ├── document?resource=john.xml&start=p.1.start&end=p.1.end&tree=page-hateoas.xml
│ ├── navigation?resource=john.xml.json
│ ├── navigation?resource=john.xml.log
│ ├── navigation?resource=john.xml&tree=page-content-by-intersection-2.json
│ ├── navigation?resource=john.xml&tree=page-content-by-intersection-2.log
│ ├── navigation?resource=john.xml&tree=page-content-by-intersection.json
│ ├── navigation?resource=john.xml&tree=page-content-by-intersection.log
│ ├── navigation?resource=john.xml&tree=page-content-xquery-like.json
│ ├── navigation?resource=john.xml&tree=page-content-xquery-like.log
│ ├── navigation?resource=john.xml&tree=page-hateoas.json
│ ├── navigation?resource=john.xml&tree=page-hateoas.log
│ ├── navigation?resource=john.xml&tree=page-level2-start-end.json
│ ├── navigation?resource=john.xml&tree=page-level2-start-end.log
│ ├── navigation?resource=john.xml&tree=page-milestone.json
│ ├── navigation?resource=john.xml&tree=page-milestone.log
│ ├── navigation?resource=john.xml&tree=wadm.json
│ └── navigation?resource=john.xml&tree=wadm.log
└── MyDapytains
├── navigation?resource=base_tei.xml.json
├── navigation?resource=base_tei.xml.log
├── navigation?resource=double_tree_lb.xml.json
├── navigation?resource=double_tree_lb.xml.log
├── navigation?resource=generated_lb.xml.json
├── navigation?resource=generated_lb.xml.log
├── navigation?resource=lb_diff_ab.xml.json
├── navigation?resource=lb_diff_ab.xml.log
├── navigation?resource=lb_same_ab.xml.json
├── navigation?resource=lb_same_ab.xml.log
├── navigation?resource=lb_uneven_ab_ending_node.xml.json
├── navigation?resource=lb_uneven_ab_ending_node.xml.log
├── navigation?resource=lb_uneven_ab.xml.json
├── navigation?resource=lb_uneven_ab.xml.log
├── navigation?resource=multiple_tree.xml.json
├── navigation?resource=multiple_tree.xml.log
├── navigation?resource=multiple_tree.xml&tree=alpha.json
├── navigation?resource=multiple_tree.xml&tree=alpha.log
├── navigation?resource=simple_doc.xml.json
├── navigation?resource=simple_doc.xml.log
├── navigation?resource=tei_with_two_traversing_with_n.xml.json
├── navigation?resource=tei_with_two_traversing_with_n.xml.log
├── navigation?resource=tei_with_two_traversing.xml.json
├── navigation?resource=tei_with_two_traversing.xml.log
├── navigation?resource=test_citeData_two_levels.xml.json
├── navigation?resource=test_citeData_two_levels.xml.log
├── navigation?resource=test_citeData.xml.json
├── navigation?resource=test_citeData.xml.log
├── navigation?resource=xml_entity_tail.xml.json
├── navigation?resource=xml_entity_tail.xml.log
├── navigation?resource=xml_entity.xml.json
└── navigation?resource=xml_entity.xml.logChoose one of MIT or C0