diff --git a/LICENSE.md b/LICENSE.md index db82631..37d71ac 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - Copyright 2022 Crunchy Data Solutions, Inc. + Copyright 2022-2024 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index 2653110..d8f1027 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ EXTENSION = pg_kaboom MODULE_big = pg_kaboom DATA = pg_kaboom--0.0.1.sql OBJS = pg_kaboom.o +TAP_TESTS = t/001_basic.pl PG_CONFIG ?= pg_config PG_CFLAGS := -Wno-missing-prototypes -Wno-deprecated-declarations -Wno-unused-result PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/pg_kaboom.c b/pg_kaboom.c index 5ade012..3dbf0f8 100644 --- a/pg_kaboom.c +++ b/pg_kaboom.c @@ -1,5 +1,5 @@ /* - Copyright 2022 Crunchy Data Solutions, Inc. + Copyright 2022-2024 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -605,7 +605,7 @@ static void wpn_xact_wrap(WPN_ARGS) { static void wpn_mem(WPN_ARGS) { char *size = payload ? simple_get_json_str(payload, "size") : "1GB"; - char *context = payload ? simple_get_json_str(payload, "context") : "Current"; /* TODO */ + //char *context = payload ? simple_get_json_str(payload, "context") : "Current"; /* TODO */ int64 alloc_size = DatumGetInt64(DirectFunctionCall1(pg_size_bytes, CStringGetDatum(size))); pfree(palloc(alloc_size)); diff --git a/t/001_basic.pl b/t/001_basic.pl new file mode 100644 index 0000000..b23d07d --- /dev/null +++ b/t/001_basic.pl @@ -0,0 +1,17 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use PostgreSQL::Test::Cluster; +use Test::More qw/no_plan/; + +my $node = PostgreSQL::Test::Cluster->new('primary'); + +$node->init(); +$node->start(); + +$node->safe_psql('postgres','CREATE EXTENSION IF NOT EXISTS pg_kaboom'); + +is ($node->safe_psql('postgres',"select extname from pg_extension where extname = 'pg_kaboom'"), + 'pg_kaboom', + 'successfully created the extension' +);