File: prove

package info (click to toggle)
pglogical 2.4.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,236 kB
  • sloc: ansic: 39,239; sql: 4,466; perl: 693; makefile: 210; sh: 77
file content (53 lines) | stat: -rwxr-xr-x 1,341 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
49
50
51
52
53
#!/bin/sh

set -e

SRCDIR=$(pwd)

# Make sure to have a writable copy of the source
WORKDIR=$(mktemp -d -t regresscheck.XXXXXX)
cleanup () {
	mkdir -p $SRCDIR/tmp_check/log
	cp -a $WORKDIR/tmp_check/log/* $SRCDIR/tmp_check/log || :
	rm -rf $WORKDIR
}
trap cleanup 0 HUP INT QUIT ILL ABRT PIPE TERM
cp -r $SRCDIR/* $WORKDIR/
cd $WORKDIR

# If executed as root become nobody
if [ $(id -u) -eq 0 ]
then
        chown nobody -R $WORKDIR/
        SU='su nobody -p -c'
else
        SU='bash -c'
fi

FAILED=
# Execute pg_prove for all the supported versions
for v in $(pg_buildext installed-versions); do
        echo "### $v ###"
        case $v in
          1[5-9])
            echo "Skipping prove test on PG $v, test not compatible yet"
            continue
            ;;
        esac
        TESTS='t/010_pglogical_create_subscriber.pl t/020_non_default_replication_set.pl'
        VERSION_PATH="/usr/lib/postgresql/$v/bin:$PATH"
        if ! $SU "PATH=$VERSION_PATH pg_prove -I /usr/lib/postgresql/$v/lib/pgxs/src/makefiles/../../src/test/perl/ -ovf \
                $TESTS";
        then
                set +e
                for log in tmp_check/log/*.log; do
                        echo "*** $log ***"
                        cat $log
                done
                FAILED=1
        fi
done

if [ -n "$FAILED" ]; then
	exit 1
fi