From: Peter Eisentraut Date: Fri, 23 Mar 2018 12:42:25 +0000 (-0400) Subject: pg_resetwal: Add simple test suite X-Git-Tag: REL_11_BETA1~505 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5700aa130186e0b5d600806645b051bfd9067f09;p=postgresql pg_resetwal: Add simple test suite Some subsequent patches will add to this, but to avoid conflicts, set up the basics separately. --- diff --git a/src/bin/pg_resetwal/.gitignore b/src/bin/pg_resetwal/.gitignore index 236abb4323..56bade5ea4 100644 --- a/src/bin/pg_resetwal/.gitignore +++ b/src/bin/pg_resetwal/.gitignore @@ -1 +1,2 @@ /pg_resetwal +/tmp_check/ diff --git a/src/bin/pg_resetwal/Makefile b/src/bin/pg_resetwal/Makefile index 5ab7ad33e0..e49d52b928 100644 --- a/src/bin/pg_resetwal/Makefile +++ b/src/bin/pg_resetwal/Makefile @@ -33,3 +33,10 @@ uninstall: clean distclean maintainer-clean: rm -f pg_resetwal$(X) $(OBJS) + rm -rf tmp_check + +check: + $(prove_check) + +installcheck: + $(prove_installcheck) diff --git a/src/bin/pg_resetwal/t/001_basic.pl b/src/bin/pg_resetwal/t/001_basic.pl new file mode 100644 index 0000000000..1b157cb555 --- /dev/null +++ b/src/bin/pg_resetwal/t/001_basic.pl @@ -0,0 +1,17 @@ +use strict; +use warnings; + +use PostgresNode; +use TestLib; +use Test::More tests => 11; + +program_help_ok('pg_resetwal'); +program_version_ok('pg_resetwal'); +program_options_handling_ok('pg_resetwal'); + +my $node = get_new_node('main'); +$node->init; + +command_like([ 'pg_resetwal', '-n', $node->data_dir ], + qr/checkpoint/, + 'pg_resetwal -n produces output');