summaryrefslogtreecommitdiffstats
path: root/test/update-test-cmd-list
blob: 20224b445a9e2af0f3943cfa84ac2d5435d4808d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env bash
set -eu

mydir=$(
    cd "$(dirname "$0")"
    pwd
)

cat "$mydir"/t/test_*.py |
    tr -d '\n' |
    grep -Eo '@pytest.mark.complete\(([^)]*\<require_(cmd|longopt) *= *True\>[^)]*)\)' |
    sed -ne 's/^[^"]*"\\\{0,1\}\([^_][^[:space:]"]*\)[[:space:]"].*/\1/p' |
    LC_ALL=C sort -u \
        >"$mydir"/test-cmd-list.txt