Skip to content

Commit

Permalink
Turn pgtap-core and pgtap-schema into proper extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Nov 11, 2011
1 parent 536ccda commit 5fe73c2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -8,4 +8,6 @@ pgtap.so
regression.*
*.html
bbin
/sql/pgtap--0.*
/sql/pgtap--1.*
/sql/pgtap-core--*
/sql/pgtap-schema--*
14 changes: 10 additions & 4 deletions Makefile
Expand Up @@ -75,14 +75,20 @@ OSNAME := $(shell ./getos.sh)
all: sql/pgtap.sql sql/uninstall_pgtap.sql sql/pgtap-core.sql sql/pgtap-schema.sql

# Add extension build targets on 9.1 and up.
ifeq ($(shell $(PG_CONFIG) --version | grep -qE "8[.]| 9[.]0" && echo no || echo yes),yes)
all: sql/$(EXTENSION)--$(EXTVERSION).sql
ifeq ($(shell echo $(VERSION) | grep -qE "8[.]|9[.]0" && echo no || echo yes),yes)
all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)-core--$(EXTVERSION).sql sql/$(EXTENSION)-schema--$(EXTVERSION).sql

sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
cp $< $@

DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql
EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql
sql/$(EXTENSION)-core--$(EXTVERSION).sql: sql/$(EXTENSION)-core.sql
cp $< $@

sql/$(EXTENSION)-schema--$(EXTVERSION).sql: sql/$(EXTENSION)-schema.sql
cp $< $@

DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)-core--$(EXTVERSION).sql sql/$(EXTENSION)-schema--$(EXTVERSION).sql
EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)-core--$(EXTVERSION).sql sql/$(EXTENSION)-schema--$(EXTVERSION).sql
endif

sql/pgtap.sql: sql/pgtap.sql.in test/setup.sql
Expand Down
6 changes: 6 additions & 0 deletions pgtap-core.control
@@ -0,0 +1,6 @@
# pgTAP Core extension
comment = 'Unit testing for PostgreSQL'
default_version = '1.0.0'
module_pathname = '$libdir/pgtap'
relocatable = true
superuser = false
6 changes: 6 additions & 0 deletions pgtap-schema.control
@@ -0,0 +1,6 @@
# pgTAP Schema testing extension
comment = 'Schema unit testing for PostgreSQL'
default_version = '1.0.0'
module_pathname = '$libdir/pgtap'
relocatable = true
superuser = false

0 comments on commit 5fe73c2

Please sign in to comment.