Logo AND Algorithmique Numérique Distribuée

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