Copyright statement comment fix.
[beedb.git] / test / wrap_binary.pl
bloba236847c514effd4f134d79fcb8163af576f40f6
1 #! /usr/bin/perl
3 # Copyright 2009 Kristian Nielsen
5 # This file is part of BeeDB.
7 # Foobar is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 2 of the License, or
10 # (at your option) any later version.
12 # Foobar is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Foobar. If not, see <http://www.gnu.org/licenses/>.
20 use strict;
21 use warnings;
23 # The Perl test framework runs test programs as Perl scripts. But some
24 # of our test programs need to be written in C++.
26 # This wrapper simply calls on to the C++ binary of the same name
27 # (without .pl).
29 # Later we can add any further Perl stuff that needs to be done.
31 # Another idea is to run the binary under Valgrind.
33 my $program_name= $0;
34 if ($0 =~ /^(.*)\.t$/) {
35 my $name= $1;
36 $name= './'. $name if ($name !~ m|/|);
37 exec $name, @ARGV;
38 } else {
39 die "Invalid wrapper filename '$0' (no trailing .t).";