File: _include.sh

package info (click to toggle)
sedsed 2.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,008 kB
  • sloc: sed: 37,239; ansic: 2,395; python: 815; sh: 624; makefile: 95
file content (48 lines) | stat: -rw-r--r-- 953 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
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Include file used by all the sedsed tests.

# Turn strict mode on for all scripts
set -o errexit -o nounset -o pipefail

# shellcheck disable=SC2034
sed='gsed'

# shellcheck disable=SC2034
sedsed='python ../../sedsed.py'
# sedsed='python2.7 ../../sedsed.py'
# sedsed='python3   ../../sedsed.py'

failed=0
sed_output='sed-output.txt'
sedsed_output='sedsed-output.txt'

# shellcheck disable=SC2034
text=$(echo one two three four five six | tr ' ' '\n')

test_message() {
    echo "                $*"
}

tests_clean_up() {
    rm -f $sed_output $sedsed_output \
        w.out1 w.out2 \
        'filesw;' \
        filesw \
        filew
}

tests_git_status() {
    local problems
    # Use git to show the errors (differences)
    tests_clean_up
    problems=$(git status --short . | sed 's/^/ERROR (use git diff): /')
    if test -n "$problems"
    then
        failed=1
        echo "$problems"
    fi
}

tests_exit() {
    exit $failed
}