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

Version Path
dep-selector-libgecode-1.3.5 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.3.1 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.3.0-x86_64-linux ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.3.0-x86_64-darwin-15 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.3.0 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.2.0 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.1.0 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.1.0.beta.1 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
gecoder-with-gecode-1.1.1.1 ext/gecode-2.2.0/misc/allexamples.perl
gecoder-with-gecode-1.1.1 ext/gecode-2.2.0/misc/allexamples.perl
dep-selector-libgecode-1.0.2 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.0.1 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.0.0 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.0.0.rc.1 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.0.0.rc.0 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.0.0.alpha.2 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.0.0.alpha.1 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
dep-selector-libgecode-1.0.0.alpha.0 ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl
gecoder-with-gecode-1.1.0 ext/gecode-2.2.0/misc/allexamples.perl
gecoder-with-gecode-0.8.0 ext/gecode-2.1.1/misc/allexamples.perl