Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating babelfisgpg_unit Extension #1586

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions contrib/babelfishpg_unit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
MODULE_big = babelfishpg_unit
EXTENSION = babelfishpg_unit # the extension's name
DATA = babelfishpg_unit--1.0.0.sql # script file to install
OBJS = $(SRCS:.c=.o) # object files

# source code files
SRCS = babelfishpg_unit.c test_money.c \

# for posgres build
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
16 changes: 16 additions & 0 deletions contrib/babelfishpg_unit/babelfishpg_unit--1.0.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION babelfishpg_unit" to load this file. \quit


-- Invoke all tests
CREATE OR REPLACE FUNCTION babelfishpg_unit_run_tests() RETURNS
TABLE(TEST_NAME text, STATUS text, "runtime(µs)" bigint, ENABLED text)
as 'babelfishpg_unit', 'babelfishpg_unit_run_tests'
LANGUAGE C IMMUTABLE STRICT;


-- Invoke specific tests by passing test_name, cateogry_name or JIRA associated with
CREATE OR REPLACE FUNCTION babelfishpg_unit_run_tests(VARIADIC name text[]) RETURNS
TABLE(TEST_NAME text, STATUS text, "runtime(µs)" bigint, ENABLED text)
as 'babelfishpg_unit', 'babelfishpg_unit_run_tests'
LANGUAGE C IMMUTABLE STRICT;
Loading