Sha256: 78f6088d5bf87e49f11147b778a8c7f31d72ee550411a6d6cb88068ba41fca9f
Contents?: true
Size: 1.4 KB
Versions: 26
Compression:
Stored size: 1.4 KB
Contents
#!/usr/bin/perl -w use File::Basename; $directory = $ARGV[0]; open (EXAMPLES, "find $directory/examples -maxdepth 1 -type f ! -name '*.*' |"); while (my $x = <EXAMPLES>) { chomp($x); my ($filename, $dummydir, $suffix) = fileparse($x); open (HELP, "$x -help 2>&1 |"); my @prop; my @model; while (my $l = <HELP>) { if ($l =~ /-propagation \((.*)\)/) { $l1 = $1; $l1 =~ s/ //g; @prop = split(/,/, $l1); } elsif ($l =~ /-model \((.*)\)/) { $l1 = $1; $l1 =~ s/ //g; @model = split(/,/, $l1); } } if (scalar(@prop) == 0) { if (scalar(@model) == 0) { runexample($directory,$filename); } else { foreach $m (@model) { runexample($directory,"$filename -model $m"); } } } else { foreach $p (@prop) { if (scalar(@model) == 0) { runexample($directory,"$filename -propagation $p"); } else { foreach $m (@model) { runexample($directory,"$filename -propagation $p -model $m"); } } } } close (HELP); } close (EXAMPLES); sub runexample { $directory = $_[0]; $filename = $_[1]; print "------------------------------------------------------------\n"; print "Running $filename\n"; open (EX, "$directory/examples/$filename -time 120000 2>&1 |"); while ($l = <EX>) { print $l; } close (EX); print "------------------------------------------------------------\n"; }
Version data entries
26 entries across 26 versions & 2 rubygems