tests/version: New; exercises config introspection commands

Exercise version, show and xdump, except for xdump of game state.

The xdump part is mostly factored out of tests/smoke.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-05-29 19:27:13 +02:00
parent f75d0e10f2
commit 9309670544
16 changed files with 3226 additions and 2929 deletions

View file

@ -13,7 +13,13 @@ getopts('js')
die "$0: either -j or -s, not both\n"
if $opt_j && $opt_s;
my $ctime_re = qr/(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 123][0-9] [0-2][0-9]:[0-5][0-9]:[0-6][0-9] [0-9][0-9][0-9][0-9]/;
my $dow_re = qr/(Sun|Mon|Tue|Wed|Thu|Fri|Sat)/;
my $mon_re = qr/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/;
my $tod_re = qr/[0-2][0-9]:[0-5][0-9]:[0-6][0-9]/;
my $year_re = qr/[0-9][0-9][0-9][0-9]/;
my $ctime19_re = qr/$dow_re $mon_re [ 123][0-9] $tod_re/;
my $ctime_re = qr/$dow_re $mon_re [ 123][0-9] $tod_re $year_re/;
my $fmttime2822_re = qr/$dow_re, [0123][0-9] $mon_re $year_re $tod_re [-+][0-9][0-9][0-9][0-9]/;
my $xdfld_re = qr/\([^)]*\)|[^ (][^ ]*/;
# Current dump, if any
@ -25,6 +31,8 @@ my $dump = "";
sub norm_ctime {
my ($s) = @_;
$s =~ s/$ctime_re/Thu Jan 1 00:00:00 1970/g;
$s =~ s/$ctime19_re/Thu Jan 1 00:00:00/g;
$s =~ s/$fmttime2822_re/Thu, 01 Jan 1970 00:00:00 +0000/g;
return $s;
}