File: basic

package info (click to toggle)
python-click-log 0.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 164 kB
  • sloc: python: 264; makefile: 203; sh: 24
file content (36 lines) | stat: -rwxr-xr-x 743 bytes parent folder | download
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
36
#!/bin/bash

# This test exercises the example described in the README.

# basic-command is the example program from the README.
cmd=debian/tests/basic-command

die () {
    printf '%s\n' "$*" 1>&2
    exit 1
}

chmod +x $cmd || exit 1
log=$AUTOPKGTEST_TMP/error.log

$cmd &>$log

text='error: Failed to divide by zero'
# The output must contain this text.
if ! grep -q "$text" $log; then
    echo "Should have output the error, but did not."
    echo "Log: --"
    cat $log
    echo "--"
    exit 1
fi

# With verbosity critical, the output must not contain the error text.
$cmd --verbosity=critical &>$log
if grep -q "$text" $log; then
    echo "Should have NOT output the error."
    echo "Log: --"
    cat $log
    echo "--"
    exit 1
fi