Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
adapt perl tesh to handle timeout from command line, and defaut to 50 for windows...
[simgrid.git] / buildtools / Cmake / Scripts / tesh.pl
index cbdc724..174245c 100755 (executable)
@@ -15,6 +15,7 @@ B<tesh> [I<options>] I<tesh_file>
 =cut
 my($bindir)=".";
 my($srcdir)=".";
+my($timeout)=0;
 my $path = $0;
 my $OS;
 $path =~ s|[^/]*$||;
@@ -67,6 +68,10 @@ sub cd_cmd {
     }
 }
 
+sub timeout_cmd{
+    $timeout=$_[1];
+}
+
 sub setenv_cmd {
     my($var,$ctn);
     if ($_[0] =~ /^(.*)=(.*)$/) {
@@ -120,6 +125,7 @@ sub get_options {
         'debug|d'    => \$opt{"debug"},
 
        'cd=s'       => \&cd_cmd,
+       'timeout=s'  => \&timeout_cmd,  
        'setenv=s'   => \&setenv_cmd,
        'cfg=s'      => \@cfg,
        'log=s'      => \$log,
@@ -139,7 +145,6 @@ my %opts = get_options(@ARGV);
 ##
 my($sort)=0;
 my($nb_arg)=0;
-my($timeout)=0;
 my($old_buffer);
 my($linebis);
 my($SIGABRT)=0;