From 5700aa130186e0b5d600806645b051bfd9067f09 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 23 Mar 2018 08:42:25 -0400 Subject: [PATCH] pg_resetwal: Add simple test suite Some subsequent patches will add to this, but to avoid conflicts, set up the basics separately. --- src/bin/pg_resetwal/.gitignore | 1 + src/bin/pg_resetwal/Makefile | 7 +++++++ src/bin/pg_resetwal/t/001_basic.pl | 17 +++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 src/bin/pg_resetwal/t/001_basic.pl diff --git a/src/bin/pg_resetwal/.gitignore b/src/bin/pg_resetwal/.gitignore index 236abb4323c..56bade5ea44 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 5ab7ad33e0a..e49d52b9288 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 00000000000..1b157cb5557 --- /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'); -- 2.39.5