File: doctest-auto

package info (click to toggle)
charliecloud 0.43-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,116 kB
  • sloc: python: 6,021; sh: 4,284; ansic: 3,863; makefile: 598
file content (35 lines) | stat: -rwxr-xr-x 499 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
31
32
33
34
35
#!/bin/bash

# Print (on stdout) BATS tests to run doctests on each file in lib/.

set -e -o pipefail

# Ensure reproducible output (#1849)
export LC_ALL=C

cat <<EOF
# AUTOGENERATED -- DO NOT EDIT

load ../common

setup () {
    scope standard
    [[ \$CH_TEST_BUILDER = ch-image ]] || skip 'ch-image only'
}

EOF


for f in ../lib/*.py; do
    m=$(basename "$f")
    m=${m%%.py}
    if [[ $m == version ]]; then
        continue
    fi
cat <<EOF

@test 'doctest: $m' {
    ./doctest $m
}
EOF
done