Skip to content

Commit cf3c98c

Browse files
committed
Add auto_import test for IMPORT FOREIGN TABLE
1 parent 728c5d5 commit cf3c98c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+11198
-4939
lines changed

Makefile

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,27 @@ EXTENSION = sqlite_fdw
1616
DATA = sqlite_fdw--1.0.sql sqlite_fdw--1.0--1.1.sql
1717

1818
ifdef ENABLE_GIS
19-
override PG_CFLAGS += -DSQLITE_FDW_GIS_ENABLE
20-
GISTEST=postgis
19+
PG_CFLAGS += -DSQLITE_FDW_GIS_ENABLE
20+
GISTEST = postgis
21+
GISPREF = ok
2122
else
22-
GISTEST=nogis
23+
GISTEST = nogis
24+
GISPREF = no
2325
endif
2426

27+
# Tests for PostgreSQL data types support
28+
TYPETESTS = types/bitstring types/bool types/float4 types/float8 types/int4 types/int8 types/numeric types/$(GISTEST) types/macaddr types/macaddr8 types/out_of_range types/timestamp types/uuid
29+
# Tests with different versions with GIS support and without GIS support
30+
GISDEPTESTS = gis_$(GISPREF)/type gis_$(GISPREF)/auto_import
31+
2532
ifndef REGRESS
26-
REGRESS = extra/sqlite_fdw_post types/bitstring types/bool types/float4 types/float8 types/int4 types/int8 types/numeric types/$(GISTEST) types/macaddr types/macaddr8 types/out_of_range types/timestamp types/uuid extra/join extra/limit extra/aggregates extra/prepare extra/select_having extra/select extra/insert extra/update extra/encodings sqlite_fdw type_$(GISTEST) aggregate selectfunc
33+
# System tests, full default sequence
34+
REGRESS = extra/sqlite_fdw_post $(TYPETESTS) extra/join extra/limit extra/aggregates extra/prepare extra/select_having extra/select extra/insert extra/update extra/encodings sqlite_fdw aggregate selectfunc $(GISDEPTESTS)
2735
endif
2836

37+
# Other encodings also are tested. Client encoding should be UTF-8-
2938
REGRESS_OPTS = --encoding=utf8
3039

31-
SQLITE_LIB = sqlite3
32-
3340
UNAME = uname
3441
OS := $(shell $(UNAME))
3542
ifeq ($(OS), Darwin)
@@ -38,7 +45,12 @@ else
3845
DLSUFFIX = .so
3946
endif
4047

48+
ifdef SQLITE_FOR_TESTING_DIR
49+
SHLIB_LINK := -L$(SQLITE_FOR_TESTING_DIR)/lib -lsqlite3
50+
PG_CFLAGS += -I$(SQLITE_FOR_TESTING_DIR)/include -Wl,-rpath,$(SQLITE_FOR_TESTING_DIR)/lib
51+
else
4152
SHLIB_LINK := -lsqlite3
53+
endif
4254

4355
ifdef ENABLE_GIS
4456
override SHLIB_LINK += -lspatialite
@@ -70,9 +82,19 @@ endif
7082
REGRESS := $(addprefix $(REGRESS_PREFIX_SUB)/,$(REGRESS))
7183
$(shell mkdir -p results/$(REGRESS_PREFIX_SUB)/extra)
7284
$(shell mkdir -p results/$(REGRESS_PREFIX_SUB)/types)
85+
$(shell mkdir -p results/$(REGRESS_PREFIX_SUB)/gis_$(GISPREF))
86+
87+
# $(info ENABLE_GIS is $(ENABLE_GIS))
88+
$(info SHLIB_LINK is $(SHLIB_LINK))
89+
# $(info LD_LIBRARY_PATH is $(LD_LIBRARY_PATH))
90+
$(info PG_CFLAGS is $(PG_CFLAGS))
91+
$(info PG_CPPFLAGS is $(PG_CPPFLAGS))
92+
# $(info REGRESS is $(REGRESS))
93+
# $(info DLSUFFIX is $(DLSUFFIX))
7394

7495
ifdef ENABLE_GIS
7596
check: temp-install
7697
temp-install: EXTRA_INSTALL+=contrib/postgis
7798
checkprep: EXTRA_INSTALL+=contrib/postgis
7899
endif
100+

expected/13.15/gis_no/auto_import.out

Lines changed: 622 additions & 0 deletions
Large diffs are not rendered by default.

expected/13.15/type_nogis.out renamed to expected/13.15/gis_no/type.out

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -531,61 +531,7 @@ SELECT * FROM "type_DOUBLE"; -- OK, +- Inf
531531
-Infinity
532532
(4 rows)
533533

534-
--Testcase 47:
534+
--Testcase 300:
535+
SET client_min_messages TO ERROR;
536+
--Testcase 301: no details
535537
DROP EXTENSION sqlite_fdw CASCADE;
536-
NOTICE: drop cascades to 55 other objects
537-
DETAIL: drop cascades to server sqlite_svr
538-
drop cascades to foreign table department
539-
drop cascades to foreign table employee
540-
drop cascades to foreign table empdata
541-
drop cascades to foreign table numbers
542-
drop cascades to foreign table t
543-
drop cascades to foreign table multiprimary
544-
drop cascades to foreign table columntest
545-
drop cascades to foreign table noprimary
546-
drop cascades to foreign table limittest
547-
drop cascades to foreign table grem1_1
548-
drop cascades to foreign table grem1_2
549-
drop cascades to foreign table case_exp
550-
drop cascades to foreign table "type_STRING"
551-
drop cascades to foreign table "type_BOOLEANpk"
552-
drop cascades to foreign table "type_BYTE"
553-
drop cascades to foreign table "type_SINT"
554-
drop cascades to foreign table "type_BINT"
555-
drop cascades to foreign table "type_INTEGER"
556-
drop cascades to foreign table "type_FLOAT"
557-
drop cascades to foreign table "type_DOUBLE"
558-
drop cascades to foreign table "type_TIMESTAMP"
559-
drop cascades to foreign table "type_BLOB"
560-
drop cascades to foreign table "type_DATE"
561-
drop cascades to foreign table "type_TIME"
562-
drop cascades to foreign table "type_BIT"
563-
drop cascades to foreign table "type_VARBIT"
564-
drop cascades to foreign table "type_UUIDpk"
565-
drop cascades to foreign table "type_UUID"
566-
drop cascades to foreign table "type_MACADDRpk"
567-
drop cascades to foreign table "type_MACADDR"
568-
drop cascades to foreign table "type_MACADDR8pk"
569-
drop cascades to foreign table "type_MACADDR8"
570-
drop cascades to foreign table "types_PostGIS"
571-
drop cascades to foreign table "BitT"
572-
drop cascades to foreign table notype
573-
drop cascades to foreign table typetest
574-
drop cascades to foreign table "type_TEXT"
575-
drop cascades to foreign table alltypetest
576-
drop cascades to foreign table shorty
577-
drop cascades to foreign table "A a"
578-
drop cascades to foreign table fts_table
579-
drop cascades to foreign table fts_table_data
580-
drop cascades to foreign table fts_table_idx
581-
drop cascades to foreign table fts_table_content
582-
drop cascades to foreign table fts_table_docsize
583-
drop cascades to foreign table fts_table_config
584-
drop cascades to foreign table "RO_RW_test"
585-
drop cascades to foreign table "Unicode data"
586-
drop cascades to foreign table "type_BOOLEAN_oper"
587-
drop cascades to foreign table "♁"
588-
drop cascades to foreign table "♂"
589-
drop cascades to foreign table type_json
590-
drop cascades to foreign table "type_BOOLEAN"
591-
drop cascades to server sqlite2

0 commit comments

Comments
 (0)