From ab0e15202bf1d741ae159846c7349258544e3f43 Mon Sep 17 00:00:00 2001 From: navarrop Date: Thu, 22 Jul 2010 15:23:53 +0000 Subject: [PATCH] Tool to update tesh files. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8054 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- buildtools/Cmake/update_tesh.pl | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 buildtools/Cmake/update_tesh.pl diff --git a/buildtools/Cmake/update_tesh.pl b/buildtools/Cmake/update_tesh.pl new file mode 100644 index 0000000000..9d751906e1 --- /dev/null +++ b/buildtools/Cmake/update_tesh.pl @@ -0,0 +1,54 @@ +#!/usr/bin/perl -w +use strict; + +if($#ARGV!=2) { + die "Usage: perl make_tesh.pl \n"; +} + +my($directory)=$ARGV[0]; +my($old)=$ARGV[1]; +my($new)=$ARGV[2]; + +chdir("$directory"); + +open SH_LIGNE, $old or die "Unable to open $old. $!\n"; + +my($line); +my($line_exec); +my($l); +my($tmp); + +print "#! ./tesh\n"; + +while(defined($line=)) +{ + if($line =~ /^p(.*)$/) + { + print "$line\n"; + } + else + { + if($line =~ /^\$(.*)$/) + { + $line_exec = $line; + $line =~ s/\$\{srcdir\:\=\.\}/./g; + $line =~ s/\$SG_TEST_EXENV//g; + $line =~ s/\$EXEEXT//g; + $line =~ s/^\$\ */.\//g; + $line =~ s/^.\/lua/lua/g; + $line =~ s/^.\/ruby/ruby/g; + print "$line_exec\n"; + chomp $line; + open (FILE, "$line 2>&1|"); + while(defined($l=)) + { + chomp $l; + print "\> $l\n"; + } + + } + close(FILE); + } +} + +close(SH_LIGNE); -- 2.20.1