From: Greg Sabino Mullane Date: Thu, 23 Apr 2009 17:24:48 +0000 (-0400) Subject: Add a test to ensure test coverage of all actions. X-Git-Tag: 2.9.0~98 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=b1773c0b220b71ac486dfd4bfb2d7a95f623db32;p=check_postgres.git Add a test to ensure test coverage of all actions. Rename walfiles.t to wal_files.t --- diff --git a/t/00_test_tester.t b/t/00_test_tester.t new file mode 100644 index 000000000..9ae0c5e4f --- /dev/null +++ b/t/00_test_tester.t @@ -0,0 +1,47 @@ +#!perl + +## Make sure we have tests for all actions + +use strict; +use warnings; +use Data::Dumper; +use DBI; +use Test::More tests => 1; +use lib 't','.'; +use CP_Testing; + +use vars qw/$dbh $SQL $t $info/; + +my $cp = CP_Testing->new(); + +$dbh = $cp->test_database_handle(); + +$info = $cp->run('help','--help'); + +my %action; +for my $line (split /\n/ => $info) { + next if $line !~ /^ (\w+) +\- [A-Z]/; + $action{$1}++; +} + +my $ok = 1; +for my $act (sort keys %action) { + ## Special known exceptions + next if $act eq 'table_size' or $act eq 'index_size'; + next if $act eq 'last_autoanalyze' or $act eq 'last_autovacuum'; + + my $file = "t/02_$act.t"; + if (! -e $file) { + diag qq{No matching test file found for action "$act" (expected $file)\n}; + $ok = 0; + } +} + +if ($ok) { + pass "There is a test for every action\n"; +} +else { + fail "Did not find a test for every action\n"; +} + +exit; diff --git a/t/02_walfiles.t b/t/02_wal_files.t similarity index 100% rename from t/02_walfiles.t rename to t/02_wal_files.t