X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fdata-io%2Fget-data-psql.at;h=fc99babf348d49bdc4fc1f4367644e08460f21ec;hb=a9e5621ea36156f1855bfa701f9fae07a648c844;hp=8aa777c514ae27511dd0e519100d44fdafdb4015;hpb=12594449b5aad90c16f26dc33b017f7385b4e4cb;p=pspp diff --git a/tests/language/data-io/get-data-psql.at b/tests/language/data-io/get-data-psql.at index 8aa777c514..fc99babf34 100644 --- a/tests/language/data-io/get-data-psql.at +++ b/tests/language/data-io/get-data-psql.at @@ -1,3 +1,19 @@ +dnl PSPP - a program for statistical analysis. +dnl Copyright (C) 2017 Free Software Foundation, Inc. +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl AT_BANNER([GET DATA /TYPE=PSQL]) m4_define([INIT_PSQL], @@ -6,14 +22,15 @@ m4_define([INIT_PSQL], export PATH PGDATA=`pwd`/cluster export PGDATA - PGHOST=`pwd` - export PGHOST PGPORT=$PG_PORT export PGPORT + socket_dir=`mktemp -d` + PGHOST="$socket_dir" + export PGHOST AT_CHECK([initdb -A trust], [0], [ignore]) - AT_CHECK([pg_ctl start -w -o "-k `pwd` -h ''"], [0], [ignore]) + AT_CHECK([pg_ctl start -w -o "-k $socket_dir -h ''"], [0], [ignore]) trap 'CLEANUP_PSQL' 0 - AT_CHECK([createdb -h "`pwd`" -p $PG_PORT $PG_DBASE], + AT_CHECK([createdb -h "$socket_dir" -p $PG_PORT $PG_DBASE], [0], [ignore], [ignore]) AT_DATA([populate.sql], [CREATE TABLE empty (a int, b date, c numeric(23, 4)); @@ -115,17 +132,18 @@ m4_define([INIT_PSQL], '01:05:02 UTC-7' ); ]) - AT_CHECK([psql -h "`pwd`" -p $PG_PORT $PG_DBASE < populate.sql], + AT_CHECK([psql -h "$socket_dir" -p $PG_PORT $PG_DBASE < populate.sql], [0], [ignore])]) -m4_define([CLEANUP_PSQL], [pg_ctl stop -W -o "-k `pwd` -h ''"]) +m4_define([CLEANUP_PSQL], [pg_ctl stop -W -o "-k $socket_dir -h ''"]) -AT_SETUP([GET DATA /TYPE=PSQL -- ordinary query]) +AT_SETUP([GET DATA /TYPE=PSQL]) INIT_PSQL -AT_CAPTURE_FILE([get-data.sps]) -AT_CHECK([cat > get-data.sps < ordinary-query.sps < get-data.sps < empty-result.sps < get-data.sps < large-result.sps < get-data.sps <