dsp: createtest added -m to merge few command test creation into one

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3459 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-06-15 21:56:00 +00:00
parent 4dba267775
commit ac572e9d03
1 changed files with 28 additions and 6 deletions

View File

@ -5,7 +5,9 @@ use XML::Simple;
use Getopt::Long; use Getopt::Long;
use POSIX qw(ceil floor); use POSIX qw(ceil floor);
#use Data::Dumper; use Data::Dumper;
my $merge = 0;
sub usage() { sub usage() {
die("createtest -i <test template> -c <command> \n"); die("createtest -i <test template> -c <command> \n");
@ -43,6 +45,7 @@ sub calculateLines {
my ($cmds,$input,$output); my ($cmds,$input,$output);
if (!GetOptions('cmds|c=s' => \$cmds, if (!GetOptions('cmds|c=s' => \$cmds,
'input|i=s' => \$input, 'input|i=s' => \$input,
'merge|m' => \$merge,
# 'output|o=s' => \$output, # 'output|o=s' => \$output,
)) { )) {
usage(); usage();
@ -77,7 +80,12 @@ foreach my $cmd (split(/,/, $cmds)) {
# how many tests we can fit in a ucode. # how many tests we can fit in a ucode.
my $ucodes = POSIX::floor((0x1000 - $hsize) / $bsize); my $ucodes = POSIX::floor((0x1000 - $hsize) / $bsize);
open(NAMES, ">$name.lst"); if ($merge) {
open(NAMES, ">>all.lst");
} else {
open(NAMES, ">$name.lst");
}
# print NAMES "; $name\n"; # print NAMES "; $name\n";
# print NAMES "; $desc\n"; # print NAMES "; $desc\n";
@ -91,9 +99,23 @@ foreach my $cmd (split(/,/, $cmds)) {
close(NAMES); close(NAMES);
system("dsptool -m $name.lst -h $name"); if (! $merge) {
unlink <$name*.tst>; system("dsptool -m $name.lst -h $name");
unlink "$name.lst"; open(NAMES, "$name.lst");
my @names = <NAMES>;
chomp @names;
unlink @names;
close(NAMES);
unlink("$name.lst");
}
} }
if ($merge) {
system("dsptool -m all.lst -h unite_test");
open(NAMES, "all.lst");
my @names = <NAMES>;
chomp @names;
unlink @names;
close(NAMES);
unlink "all.lst";
}