Next | Automated Testing | 25 |
First, I made a record of what the output was supposed to look like:
perl extract.pl mv OUT.out SAMPLE-OUTPUT
Then I wrote test.pl:
#!/usr/bin/perl
my $prog = shift || 'extract3.pl'; chdir("/home/mjd/TPC/2002/Flags/extract") or die $!; system("perl $prog"); system("cmp -s SAMPLE-OUTPUT OUT.out"); print $? == 0 ? "ok\n" : "not ok\n";
After each change, I ran test.pl
If it said ok, I continued
If not, I ran diff into the two outputs to see what had gone wrong
Something this trivial is often sufficient
Next | Copyright © 2004 Mark Dominus |