Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[tesh] Fix usage sting in update_tesh.pl
[simgrid.git] / tools / cmake / scripts / my_valgrind.pl
1 #!/usr/bin/env perl
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 use warnings;
11
12 my @argv = ("valgrind");
13 my $count = 0;
14
15 while (defined(my $arg = shift)) {
16     print "arg($count)$arg\n";
17     if ($arg =~ m!/smpirun$!) {
18         @argv = ( $arg, "-wrapper", "@argv" );
19     } elsif ($arg eq "--cd") {
20         $arg = shift;
21         print "cd $arg\n";
22         chdir ($arg);
23         $count++;
24     } else {
25         push @argv, $arg;
26     }
27     $count++;
28 }
29
30 #print "COMMAND : $bin $option $cd $path\n";
31 #print "cd $path\n";
32 #print "valgrind --trace-children=yes --leak-check=full --show-reachable=yes --track-origins=yes --read-var-info=no $bin $option\n";
33 print "@argv\n\n";
34 system @argv;