Skip to content

Commit

Permalink
Fix pgtap-core and pgtap-static (yugabyte#225)
Browse files Browse the repository at this point in the history
This also uncovered some issues due to patches for older versions, so remove all support for pre-9.1
  • Loading branch information
nasbyj authored Nov 23, 2019
1 parent 1b30e27 commit 1688085
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 1,441 deletions.
38 changes: 4 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,8 @@ $(info )
#
# TODO: update this
# TODO9.1: update the $(TB_DIR) target below when de-supporting 9.1
ifeq ($(shell echo $(VERSION) | grep -qE "^(7[.]|8[.]0)" && echo yes || echo no),yes)
$(error pgTAP requires PostgreSQL 8.1 or later. This is $(VERSION))
endif

# Compile the C code only if we're on 8.3 or older.
ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][123]" && echo yes || echo no),yes)
MODULES = src/pgtap
ifeq ($(shell echo $(VERSION) | grep -qE "^([78][.]|9[.]0)" && echo yes || echo no),yes)
$(error pgTAP requires PostgreSQL 9.1 or later. This is $(VERSION))
endif

# Make sure we build these.
Expand Down Expand Up @@ -140,16 +135,6 @@ ifeq ($(shell echo $(VERSION) | grep -qE "[89][.]" && echo yes || echo no),yes)
EXCLUDE_TEST_FILES += test/sql/partitions.sql
endif

# Enum tests not supported by 8.2 and earlier.
ifeq ($(shell echo $(VERSION) | grep -qE "8[.][12]" && echo yes || echo no),yes)
EXCLUDE_TEST_FILES += test/sql/enumtap.sql
endif

# Values tests not supported by 8.1 and earlier.
ifeq ($(shell echo $(VERSION) | grep -qE "8[.][1]" && echo yes || echo no),yes)
EXCLUDE_TEST_FILES += test/sql/valueset.sql
endif

#
# Check for missing extensions
#
Expand Down Expand Up @@ -222,21 +207,6 @@ ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][012]|8[.][1234])" && echo yes |
endif
ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][01]|8[.][1234])" && echo yes || echo no),yes)
patch -p0 < compat/install-9.1.patch
endif
ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.]0|8[.][1234])" && echo yes || echo no),yes)
patch -p0 < compat/install-9.0.patch
endif
ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][1234]" && echo yes || echo no),yes)
patch -p0 < compat/install-8.4.patch
endif
ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][123]" && echo yes || echo no),yes)
patch -p0 < compat/install-8.3.patch
endif
ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][12]" && echo yes || echo no),yes)
patch -p0 < compat/install-8.2.patch
endif
ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][1]" && echo yes || echo no),yes)
patch -p0 < compat/install-8.1.patch
endif
sed -e 's,MODULE_PATHNAME,$$libdir/pgtap,g' -e 's,__OS__,$(OSNAME),g' -e 's,__VERSION__,$(NUMVERSION),g' sql/pgtap.sql > sql/pgtap.tmp
mv sql/pgtap.tmp sql/pgtap.sql
Expand Down Expand Up @@ -298,10 +268,10 @@ sql/pgtap-static.sql: sql/pgtap.sql.in
sed -e 's#MODULE_PATHNAME#$$libdir/pgtap#g' -e 's#__OS__#$(OSNAME)#g' -e 's#__VERSION__#$(NUMVERSION)#g' $@.tmp > $@
EXTRA_CLEAN += sql/pgtap-static.sql sql/pgtap-static.sql.tmp

sql/pgtap-core.sql: sql/pgtap-static.sql
sql/pgtap-core.sql: sql/pgtap-static.sql compat/gencore
$(PERL) compat/gencore 0 sql/pgtap-static.sql > sql/pgtap-core.sql

sql/pgtap-schema.sql: sql/pgtap-static.sql
sql/pgtap-schema.sql: sql/pgtap-static.sql compat/gencore
$(PERL) compat/gencore 1 sql/pgtap-static.sql > sql/pgtap-schema.sql

$(B_DIR)/static/: $(B_DIR)
Expand Down
88 changes: 0 additions & 88 deletions compat/9.0/pgtap--0.96.0--0.97.0.patch

This file was deleted.

4 changes: 3 additions & 1 deletion compat/gencore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ my %keep = map { chomp; $_ => 1 } <DATA>;
my ($name, $type) = $invert ? ('Schema', 'schema-testing') : ('Core', 'assertion');
print qq{
-- This file defines pgTAP $name, a portable collection of $type
-- functions for TAP-based unit testing on PostgreSQL 8.3 or higher. It is
-- functions for TAP-based unit testing on PostgreSQL 9.1 or higher. It is
-- distributed under the revised FreeBSD license. The home page for the pgTAP
-- project is:
Expand Down Expand Up @@ -85,7 +85,9 @@ performs_ok
performs_within
_time_trials
_ident_array_to_string
_prokind
tap_funky
_funkargs
_got_func
has_function
hasnt_function
Expand Down
125 changes: 0 additions & 125 deletions compat/install-8.1.patch

This file was deleted.

Loading

0 comments on commit 1688085

Please sign in to comment.