DASM
test-dump/Tests.pm
Go to the documentation of this file.
00001 #!/usr/bin/perl -w
00002 ##
00003 # Test rules for the test-dump directory: positive tests.
00004 #
00005 # These routines provide regression tests to ensure that the dump load
00006 # routines generate the same results in repeated runs.
00007 #
00008 # We read .dump files and re-dump them. The expectation is the standard
00009 # format, and should appear consistent.
00010 #
00011 
00012 
00013 ##
00014 # Assemble the .dasm file and dump it; comparing to the expectation.
00015 addTest('name' => 'Read and write',
00016         'input'    => '(?<!expect)\.dump$',
00017         'expect'   => '.expect.dump',
00018         'generate' => sub {
00019                 my ($directory, $input) = @_;
00020 
00021                 my $cmd = "./dasm.pl -o .dump -i $directory/$input";
00022                 my ($rc, $output) = capture_output($cmd);
00023 
00024                 return ($rc, $output, $cmd);
00025             },
00026 
00027         'compare' => \&compare,
00028        );
00029 
00030 1;