File: missing_extensions.sh

package info (click to toggle)
pgtap 1.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,792 kB
  • sloc: sql: 25,795; sh: 790; makefile: 287; perl: 175
file content (29 lines) | stat: -rwxr-xr-x 884 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

MISSING_EXTENSIONS=$1
EXTENSION_TEST_FILES=$2

# Doesn't seem worth pulling all of util.sh in for just this, but if you need
# anything else please just pull it in!
stderr() {
    echo "$@" >&2
}

if [ -n "$MISSING_EXTENSIONS" ]; then
    if [ -n "$ALLOW_MISSING_EXTENSIONS" ]; then
        stderr
        stderr '***************************'
        stderr "WARNING: Some mandatory extensions ($MISSING_EXTENSIONS) are not installed, ignoring tests: $EXTENSION_TEST_FILES"
        stderr '***************************'
        stderr
    else
        stderr
        stderr '***************************'
        stderr "ERROR: Missing extensions required for testing: $MISSING_EXTENSIONS"
        stderr
        stderr "You may over-ride by setting \$ALLOW_MISSING_EXTENSIONS to a value."
        stderr '***************************'
        stderr
        exit 1
    fi
fi