Commit 9c9e2dd4 authored by Marc G. Fournier's avatar Marc G. Fournier

More splits of the regression tests in order to make them more

user-friendly (and more useful)
parent aa51d0d1
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.1 1997/01/21 01:27:18 momjian Exp $ # $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.2 1997/04/05 21:24:06 scrappy Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -45,6 +45,8 @@ OUTFILES= stud_emp.data onek.data regress.out aportal.out ...@@ -45,6 +45,8 @@ OUTFILES= stud_emp.data onek.data regress.out aportal.out
# prepare to run the test (including clean-up after the last run) # prepare to run the test (including clean-up after the last run)
# #
all: $(INFILES) all: $(INFILES)
cd input; gmake all; cd ..
cd output; gmake all; cd ..
rm -f $(OUTFILES) rm -f $(OUTFILES)
# #
......
QUERY: CREATE TABLE hobbies_r (
name text,
person text
);
QUERY: CREATE TABLE equipment_r (
name text,
hobby text
);
QUERY: CREATE TABLE onek (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 char16,
stringu2 char16,
string4 char16
);
QUERY: CREATE TABLE tenk1 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 char16,
stringu2 char16,
string4 char16
);
QUERY: CREATE TABLE tenk2 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 char16,
stringu2 char16,
string4 char16
);
QUERY: CREATE TABLE person (
name text,
age int4,
location point
);
QUERY: CREATE TABLE emp (
salary int4,
manager char16
) INHERITS (person);
QUERY: CREATE TABLE student (
gpa float8
) INHERITS (person);
QUERY: CREATE TABLE stud_emp (
percent int4
) INHERITS (emp, student);
QUERY: CREATE TABLE city (
name char16,
location box,
budget city_budget
);
QUERY: CREATE TABLE dept (
dname char16,
mgrname text
);
QUERY: CREATE TABLE slow_emp4000 (
home_base box
);
QUERY: CREATE TABLE fast_emp4000 (
home_base box
);
QUERY: CREATE TABLE road (
name text,
thepath path
);
QUERY: CREATE TABLE ihighway () INHERITS (road);
QUERY: CREATE TABLE shighway (
surface text
) INHERITS (road);
QUERY: CREATE TABLE real_city (
pop int4,
cname text,
outline path
);
QUERY: CREATE TABLE a_star (
class char,
a int4
);
QUERY: CREATE TABLE b_star (
b text
) INHERITS (a_star);
QUERY: CREATE TABLE c_star (
c char16
) INHERITS (a_star);
QUERY: CREATE TABLE d_star (
d float8
) INHERITS (b_star, c_star);
QUERY: CREATE TABLE e_star (
e int2
) INHERITS (c_star);
QUERY: CREATE TABLE f_star (
f polygon
) INHERITS (e_star);
QUERY: CREATE TABLE aggtest (
a int2,
b float4
);
QUERY: CREATE TABLE arrtest (
a int2[],
b int4[][][],
c char16[],
d text[][],
e float8[]
);
QUERY: CREATE TABLE hash_i4_heap (
seqno int4,
random int4
);
QUERY: CREATE TABLE hash_c16_heap (
seqno int4,
random char16
);
QUERY: CREATE TABLE hash_txt_heap (
seqno int4,
random text
);
QUERY: CREATE TABLE hash_f8_heap (
seqno int4,
random float8
);
QUERY: CREATE TABLE bt_i4_heap (
seqno int4,
random int4
);
QUERY: CREATE TABLE bt_c16_heap (
seqno char16,
random int4
);
QUERY: CREATE TABLE bt_txt_heap (
seqno text,
random int4
);
QUERY: CREATE TABLE bt_f8_heap (
seqno float8,
random int4
);
QUERY: CREATE TYPE circle (
internallength = 24,
input = circle_in,
output = circle_out,
alignment = double
);
QUERY: CREATE TYPE city_budget (
internallength = 16,
input = int44in,
output = int44out,
element = int4
);
#-------------------------------------------------------------------------
#
# Makefile--
# Makefile for regress (the regression test)
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/regress/input/Attic/Makefile,v 1.1 1997/04/05 21:24:38 scrappy Exp $
#
#-------------------------------------------------------------------------
SRCDIR= ../../..
include ../../../Makefile.global
#
# ... plus test query inputs
#
# INFILES is the files the regression test uses for input.
INFILES= create_misc.sql \
create_function.sql
all: $(INFILES)
%.sql: %.source
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
if [ -z "$$USER" ]; then echo 'Cannot deduce $$USER.'; exit 1; fi; \
rm -f $@; \
C=`pwd`; \
sed -e "s:_CWD_:$(PWD):g" \
-e "s:_OBJWD_:$(PWD):g" \
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
-e "s/_USER_/$$USER/g" < $< > ../sql/$@
--
-- create.source
--
--
CREATE FUNCTION circle_in(opaque)
RETURNS circle
AS '_OBJWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
CREATE FUNCTION circle_out(opaque)
RETURNS opaque
AS '_OBJWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
--
-- FUNCTION DEFINITIONS
--
CREATE FUNCTION hobbies(person)
RETURNS setof hobbies_r
AS 'select * from hobbies_r where person = $1.name'
LANGUAGE 'sql';
CREATE FUNCTION hobby_construct(text, text)
RETURNS hobbies_r
AS 'select $1 as name, $2 as hobby'
LANGUAGE 'sql';
CREATE FUNCTION equipment(hobbies_r)
RETURNS setof equipment_r
AS 'select * from equipment_r where hobby = $1.name'
LANGUAGE 'sql';
CREATE FUNCTION user_relns()
RETURNS setof name
AS 'select relname
from pg_class
where relname !~ ''pg_.*'' and
relkind <> ''i'' '
LANGUAGE 'sql';
CREATE FUNCTION pt_in_circle(point, circle)
RETURNS int4
AS '_OBJWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
CREATE FUNCTION overpaid(emp)
RETURNS bool
AS '_OBJWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
CREATE FUNCTION boxarea(box)
RETURNS int4
AS '_OBJWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
CREATE FUNCTION interpt_pp(path, path)
RETURNS point
AS '_OBJWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
CREATE FUNCTION reverse_c16(char16)
RETURNS char16
AS '_OBJWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
--
-- FUNCTION DYNAMIC LOADING
--
LOAD '_OBJWD_/regress_DLSUFFIX_';
This diff is collapsed.
#-------------------------------------------------------------------------
#
# Makefile--
# Makefile for regress (the regression test)
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/test/regress/output/Attic/Makefile,v 1.1 1997/04/05 21:25:02 scrappy Exp $
#
#-------------------------------------------------------------------------
SRCDIR= ../../..
include ../../../Makefile.global
#
# ... plus test query inputs
#
# INFILES is the files the regression test uses for input.
INFILES= create_misc.out \
create_function.out
all: $(INFILES)
%.out: %.source
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
if [ -z "$$USER" ]; then echo 'Cannot deduce $USER.'; exit 1; fi; \
rm -f expected.out; \
MYTZ=`date | cut -c21`; \
C="`pwd`"; \
sed -e "s:_CWD_:$(PWD):g" \
-e "s:_OBJWD_:$(PWD):g" \
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
-e "s;\([A-Z][a-z][a-z][^ ]* [A-Z][a-z][a-z] [0-9 ][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9] \)[A-Z]\([A-Z][A-Z]\);\1$$MYTZ\2;g" \
-e "s;\([A-Z][a-z][a-z][^ ]* [A-Z][a-z][a-z] [0-9 ][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] \)[A-Z]\([A-Z][A-Z] [0-9][0-9][0-9][0-9]\);\1$$MYTZ\2;g" \
-e "s:_USER_:$$USER:g" < $< > ../expected/$@
@echo "YOUR EXPECTED RESULTS ARE NOW IN FILE expected.out."
QUERY: CREATE FUNCTION circle_in(opaque)
RETURNS circle
AS '_CWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
NOTICE:ProcedureCreate: type 'circle' is not yet defined
QUERY: CREATE FUNCTION circle_out(opaque)
RETURNS opaque
AS '_CWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
QUERY: CREATE FUNCTION hobbies(person)
RETURNS setof hobbies_r
AS 'select * from hobbies_r where person = $1.name'
LANGUAGE 'sql';
QUERY: CREATE FUNCTION hobby_construct(text, text)
RETURNS hobbies_r
AS 'select $1 as name, $2 as hobby'
LANGUAGE 'sql';
QUERY: CREATE FUNCTION equipment(hobbies_r)
RETURNS setof equipment_r
AS 'select * from equipment_r where hobby = $1.name'
LANGUAGE 'sql';
QUERY: CREATE FUNCTION user_relns()
RETURNS setof name
AS 'select relname
from pg_class
where relname !~ ''pg_.*'' and
relkind <> ''i'' '
LANGUAGE 'sql';
QUERY: CREATE FUNCTION pt_in_circle(point, circle)
RETURNS int4
AS '_CWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
QUERY: CREATE FUNCTION overpaid(emp)
RETURNS bool
AS '_CWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
QUERY: CREATE FUNCTION boxarea(box)
RETURNS int4
AS '_CWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
QUERY: CREATE FUNCTION interpt_pp(path, path)
RETURNS point
AS '_CWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
QUERY: CREATE FUNCTION reverse_c16(char16)
RETURNS char16
AS '_CWD_/regress_DLSUFFIX_'
LANGUAGE 'c';
QUERY: LOAD '_CWD_/regress_DLSUFFIX_';
This diff is collapsed.
#!/bin/sh #!/bin/sh
# $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.4 1997/04/05 11:58:35 scrappy Exp $ # $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.5 1997/04/05 21:24:11 scrappy Exp $
# #
if [ -d ./obj ]; then if [ -d ./obj ]; then
cd ./obj cd ./obj
...@@ -29,9 +29,9 @@ fi ...@@ -29,9 +29,9 @@ fi
echo =============== running regression queries ... ================= echo =============== running regression queries ... =================
for i in `cat sql/tests` for i in `cat sql/tests`
do do
echo -n ${i} .. echo -n "${i} .. "
$FRONTEND regression < sql/${i}.sql 2>&1 | tee output/${i}.out $FRONTEND regression < sql/${i}.sql > results/${i}.out 2>&1
if [ `diff expected/${i}.out output/${i}.out | wc -l` -ne 0 ] if [ `diff expected/${i}.out results/${i}.out | wc -l` -ne 0 ]
then then
echo failed echo failed
else else
......
--
-- create.source
--
--
--
-- CLASS DEFINITIONS
--
CREATE TABLE hobbies_r (
name text,
person text
);
CREATE TABLE equipment_r (
name text,
hobby text
);
CREATE TABLE onek (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 char16,
stringu2 char16,
string4 char16
);
CREATE TABLE tenk1 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 char16,
stringu2 char16,
string4 char16
);
CREATE TABLE tenk2 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 char16,
stringu2 char16,
string4 char16
);
CREATE TABLE person (
name text,
age int4,
location point
);
CREATE TABLE emp (
salary int4,
manager char16
) INHERITS (person);
CREATE TABLE student (
gpa float8
) INHERITS (person);
CREATE TABLE stud_emp (
percent int4
) INHERITS (emp, student);
CREATE TABLE city (
name char16,
location box,
budget city_budget
);
CREATE TABLE dept (
dname char16,
mgrname text
);
CREATE TABLE slow_emp4000 (
home_base box
);
CREATE TABLE fast_emp4000 (
home_base box
);
CREATE TABLE road (
name text,
thepath path
);
CREATE TABLE ihighway () INHERITS (road);
CREATE TABLE shighway (
surface text
) INHERITS (road);
CREATE TABLE real_city (
pop int4,
cname text,
outline path
);
--
-- test the "star" operators a bit more thoroughly -- this time,
-- throw in lots of NULL fields...
--
-- a is the type root
-- b and c inherit from a (one-level single inheritance)
-- d inherits from b and c (two-level multiple inheritance)
-- e inherits from c (two-level single inheritance)
-- f inherits from e (three-level single inheritance)
--
CREATE TABLE a_star (
class char,
a int4
);
CREATE TABLE b_star (
b text
) INHERITS (a_star);
CREATE TABLE c_star (
c char16
) INHERITS (a_star);
CREATE TABLE d_star (
d float8
) INHERITS (b_star, c_star);
CREATE TABLE e_star (
e int2
) INHERITS (c_star);
CREATE TABLE f_star (
f polygon
) INHERITS (e_star);
CREATE TABLE aggtest (
a int2,
b float4
);
CREATE TABLE arrtest (
a int2[],
b int4[][][],
c char16[],
d text[][],
e float8[]
);
CREATE TABLE hash_i4_heap (
seqno int4,
random int4
);
CREATE TABLE hash_c16_heap (
seqno int4,
random char16
);
CREATE TABLE hash_txt_heap (
seqno int4,
random text
);
CREATE TABLE hash_f8_heap (
seqno int4,
random float8
);
-- don't include the hash_ovfl_heap stuff in the distribution
-- the data set is too large for what it's worth
--
-- CREATE TABLE hash_ovfl_heap (
-- x int4,
-- y int4
-- );
CREATE TABLE bt_i4_heap (
seqno int4,
random int4
);
CREATE TABLE bt_c16_heap (
seqno char16,
random int4
);
CREATE TABLE bt_txt_heap (
seqno text,
random int4
);
CREATE TABLE bt_f8_heap (
seqno float8,
random int4
);
--
-- create.source
--
--
CREATE TYPE circle (
internallength = 24,
input = circle_in,
output = circle_out,
alignment = double
);
CREATE TYPE city_budget (
internallength = 16,
input = int44in,
output = int44out,
element = int4
);
create_function
create_type
create_table
create_misc
reltime reltime
abstime abstime
boolean boolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment