]> granicus.if.org Git - postgresql/commitdiff
pg_resetwal: Add simple test suite
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 23 Mar 2018 12:42:25 +0000 (08:42 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Fri, 23 Mar 2018 12:42:25 +0000 (08:42 -0400)
Some subsequent patches will add to this, but to avoid conflicts, set up
the basics separately.

src/bin/pg_resetwal/.gitignore
src/bin/pg_resetwal/Makefile
src/bin/pg_resetwal/t/001_basic.pl [new file with mode: 0644]

index 236abb4323c41671351cf603aa9aa653593a1bd6..56bade5ea44010db58bb283c23888dcab3f9a47f 100644 (file)
@@ -1 +1,2 @@
 /pg_resetwal
+/tmp_check/
index 5ab7ad33e0ae6a0d3600fff6e912c8dd5162e2b5..e49d52b92885759cf09a7a31963c3e147f9f77f2 100644 (file)
@@ -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 (file)
index 0000000..1b157cb
--- /dev/null
@@ -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');