diff options
author | Greg Sabino Mullane | 2009-04-23 17:24:48 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2009-04-23 17:24:48 +0000 |
commit | b1773c0b220b71ac486dfd4bfb2d7a95f623db32 (patch) | |
tree | 0f25c34fef67ad2ae7c8aa8089d6a82242937559 | |
parent | fddbfaa154b8758eea11101815f60b74a909299e (diff) |
Add a test to ensure test coverage of all actions.
Rename walfiles.t to wal_files.t
-rw-r--r-- | t/00_test_tester.t | 47 | ||||
-rw-r--r-- | t/02_wal_files.t (renamed from t/02_walfiles.t) | 0 |
2 files changed, 47 insertions, 0 deletions
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 index 520466687..520466687 100644 --- a/t/02_walfiles.t +++ b/t/02_wal_files.t |