Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move the cmake files in tools/cmake
[simgrid.git] / tools / cmake / Scripts / my_valgrind.pl
1 #!/usr/bin/perl -w
2
3 # Copyright (c) 2012-2014. The SimGrid Team.
4 # All rights reserved.
5
6 # This program is free software; you can redistribute it and/or modify it
7 # under the terms of the license (GNU LGPL) which comes with this package.
8
9 use strict;
10 my @argv = ("valgrind");
11 my $count = 0;
12
13 while (defined(my $arg = shift)) {
14     print "arg($count)$arg\n";
15     if ($arg =~ m!/smpirun$!) {
16         @argv = ( $arg, "-wrapper", "@argv" );
17     } elsif ($arg eq "--cd") {
18         $arg = shift;
19         print "cd $arg\n";
20         chdir ($arg);
21         $count++;
22     } else {
23         push @argv, $arg;
24     }
25     $count++;
26 }
27
28 #print "COMMAND : $bin $option $cd $path\n";
29 #print "cd $path\n";
30 #print "valgrind --trace-children=yes --leak-check=full --show-reachable=yes --track-origins=yes --read-var-info=no $bin $option\n";
31 print "@argv\n\n";
32 system @argv;