Debian Codegraph @

test/integration/targets/packaging_cli-doc/runme.sh

raw
1 #!/usr/bin/env bash
2
3 set -eux
4
5 source virtualenv.sh
6
7 mkdir -p "${JUNIT_OUTPUT_DIR}" # ensure paths relative to this path work
8
9 cli_doc="${JUNIT_OUTPUT_DIR}/../../../packaging/cli-doc"
10 build="${cli_doc}/build.py"
11 template="template.j2"
12
13 # Test `rst` command
14
15 pip install jinja2
16
17 rst_dir="${OUTPUT_DIR}/rst"
18
19 python.py "${build}" rst --output-dir "${rst_dir}" && ./verify.py "${rst_dir}"
20 python.py "${build}" rst --output-dir "${rst_dir}" --template "${template}" && ./verify.py "${rst_dir}"
21
22 # Test `man` command (and the argcomplete code path)
23
24 pip install docutils argcomplete
25
26 man_dir="${OUTPUT_DIR}/man"
27
28 python.py "${build}" man --output-dir "${man_dir}" && ./verify.py "${man_dir}"
29 python.py "${build}" man --output-dir "${man_dir}" --template "${template}" && ./verify.py "${man_dir}"
30
31 # Test `json` command
32
33 python.py "${build}" json --output-file docs.json && ls -l docs.json
34
35 # Ensure complete coverage of the main conditional
36
37 echo "import sys; sys.path.insert(0, '${cli_doc}'); import build" > cover.py
38 python.py cover.py