1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-18 13:44:19 +03:00
postgres/contrib/spi/meson.build
Tom Lane b1720fe63f Move contrib/spi testing from core regression tests to contrib/spi.
It's weird to have the core regression tests depending on contrib
code, and coverage testing shows that those test queries add nothing
to the core-code coverage of the core tests.  So pull those test bits
out and put them into ordinary test scripts inside contrib/spi/,
making that more like other contrib modules.

Aside from being structurally nicer, anything we can take out of the
core tests (which are executed multiple times per check-world run)
and put into tests executed only once should be a win.  It doesn't
look like this change will buy a whole lot of milliseconds, but a
cycle saved is a cycle earned.

Also, there is some discussion around possibly removing refint and/or
autoinc altogether.  I don't know if that will happen, but we'd
certainly need to decouple them from the core tests to do so.

The tests for autoinc were quite intertwined with the undocumented
"ttdummy" trigger in regress.c.  That made the tests very hard to
understand and contributed nothing to autoinc's testing either.
So I just deleted ttdummy and rewrote the autoinc tests without it.

I realized while doing this that the description of autoinc in
the SGML docs is not a great description of what the function
actually does, so the patch includes some updates to those docs.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/3872677.1744077559@sss.pgh.pa.us
2025-04-08 19:12:03 -04:00

122 lines
2.5 KiB
Meson

# Copyright (c) 2022-2025, PostgreSQL Global Development Group
autoinc_sources = files(
'autoinc.c',
)
if host_system == 'windows'
autoinc_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
'--NAME', 'autoinc',
'--FILEDESC', 'spi - examples of using SPI and triggers',])
endif
autoinc = shared_module('autoinc',
autoinc_sources,
kwargs: contrib_mod_args,
)
contrib_targets += autoinc
install_data('autoinc.control', 'autoinc--1.0.sql',
kwargs: contrib_data_args,
)
install_data('autoinc.example',
kwargs: contrib_doc_args,
)
insert_username_sources = files(
'insert_username.c',
)
if host_system == 'windows'
insert_username_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
'--NAME', 'insert_username',
'--FILEDESC', 'spi - examples of using SPI and triggers',])
endif
insert_username = shared_module('insert_username',
insert_username_sources,
kwargs: contrib_mod_args,
)
contrib_targets += insert_username
install_data(
'insert_username.control',
'insert_username--1.0.sql',
kwargs: contrib_data_args,
)
install_data('insert_username.example',
kwargs: contrib_doc_args,
)
moddatetime_sources = files(
'moddatetime.c',
)
if host_system == 'windows'
moddatetime_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
'--NAME', 'moddatetime',
'--FILEDESC', 'spi - examples of using SPI and triggers',])
endif
moddatetime = shared_module('moddatetime',
moddatetime_sources,
kwargs: contrib_mod_args,
)
contrib_targets += moddatetime
install_data(
'moddatetime.control',
'moddatetime--1.0.sql',
kwargs: contrib_data_args,
)
install_data('moddatetime.example',
kwargs: contrib_doc_args,
)
# this is needed for the regression tests;
# comment out if you want a quieter refint package for other uses
refint_cflags = ['-DREFINT_VERBOSE']
refint_sources = files(
'refint.c',
)
if host_system == 'windows'
refint_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
'--NAME', 'refint',
'--FILEDESC', 'spi - examples of using SPI and triggers',])
endif
refint = shared_module('refint',
refint_sources,
c_args: refint_cflags,
kwargs: contrib_mod_args,
)
contrib_targets += refint
install_data('refint.control', 'refint--1.0.sql',
kwargs: contrib_data_args,
)
install_data('refint.example',
kwargs: contrib_doc_args,
)
tests += {
'name': 'spi',
'sd': meson.current_source_dir(),
'bd': meson.current_build_dir(),
'regress': {
'sql': [
'autoinc',
'refint',
],
},
}