Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cae0a63a08dff685142b1fde833df0e39b1d761b
[simgrid.git] / buildtools / Cmake / tesh.pl
1 #!perl -w
2 use strict;
3
4 if($#ARGV!=1) {
5     die "Usage: perl tesh.pl <directory> <teshfile.tesh>\n";
6 }
7
8 my($directory)=$ARGV[0];
9 my($file)=$ARGV[1];
10
11 chdir("$directory");
12
13 open SH_LIGNE, $file or die "Unable to open $file. $!\n";
14
15 my($line);
16 my($line_exec);
17 my($l);
18 my($tmp);
19
20 while(defined($line=<SH_LIGNE>))
21 {
22
23                 if($line =~ /^\$(.*)$/) 
24                 {
25                         $line_exec = $line;
26                         $line =~ s/\$\{srcdir\:\=\.\}/./g;
27                         $line =~ s/\$SG_TEST_EXENV//g;
28                         $line =~ s/\$EXEEXT//g;
29                         $line =~ s/^\$\ */.\//g;
30                         $line =~ s/^.\/lua/lua/g;
31                         $line =~ s/^.\/ruby/ruby/g;
32                         print "$line_exec\n";
33                         chomp $line;
34                         system "$line";
35                         }
36 }
37
38 close(SH_LIGNE);