File: check-extensions.sh

package info (click to toggle)
pgrouting 2.3.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,624 kB
  • ctags: 3,244
  • sloc: cpp: 86,010; sql: 30,138; ansic: 9,711; python: 3,105; perl: 1,307; sh: 957; xml: 182; makefile: 126
file content (41 lines) | stat: -rwxr-xr-x 982 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
37
38
39
40
41
#!/bin/bash
# ------------------------------------------------------------------------------
# Travis CI scripts 
# Copyright(c) pgRouting Contributors
#
# check pgtap & postgis on travis
# ------------------------------------------------------------------------------

set -e

POSTGRESQL_VERSION="$1"
DATABASE="$2"
PGUSER=postgres

sudo updatedb
echo "locate pgtap"
locate pgtap.control
echo "locate postgis"
locate postgis.control
  


cd ..
# Define alias function for psql command
run_psql () {
    PGOPTIONS='--client-min-messages=warning' psql -U $PGUSER  -e -X -v ON_ERROR_STOP=1 --pset pager=off "$@" -d $DATABASE
    if [ "$?" -ne 0 ]
    then
        echo "Test query failed: $@"
        ERROR=1
    fi
}

run_psql -c "SELECT version()" 
run_psql -c "CREATE EXTENSION pgtap" 
run_psql -c "SELECT pgtap_version()"
run_psql -c "CREATE EXTENSION postgis" 
run_psql -c "SELECT postgis_full_version()"
run_psql -c "DROP EXTENSION pgtap" 
run_psql -c "DROP EXTENSION postgis"