Commits
Darrell Schiebel authored 78b3043539c Merge
1 + | #!/usr/bin/perl |
2 + | use :: ; |
3 + | use 'abs_path'; |
4 + | use 'getcwd'; |
5 + | use qw(strftime); |
6 + | |
7 + | $scripts_dir = ( ($0)); |
8 + | $build_dir = ("$scripts_dir/../build"); |
9 + | $bin_dir = ""; |
10 + | |
11 + | opendir( $BDH, $build_dir ) || die "Can't open $build_dir: $!"; |
12 + | while ( readdir $BDH ) { |
13 + | if ( - "$build_dir/$_" && |^| ) { |
14 + | $bin_dir = "$build_dir/$_"; |
15 + | } |
16 + | } |
17 + | die "could not find bin directory" unless $bin_dir; |
18 + | $binary = "$bin_dir/casaviewer.app/usr/bin/casaviewer"; |
19 + | die "casaviewer executable not found" unless - $binary; |
20 + | |
21 + | chomp($valgrind = `which valgrind`); |
22 + | die "could not find valgrind" unless -x $valgrind; |
23 + | $logfile = ("valgrind-%Y.%m.%d.log",localtime); |
24 + | splice( @ARGV, 1, 0, "--nofork" ); |
25 + | @args = ( $valgrind, "--trace-children=yes", "--log-file=$logfile", $binary, @ARGV ); |
26 + | exec { $args[0] } @args; |