#!/usr/bin/perl # Copyright (C) 2011 Samsung Electronics # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA use strict; use File::Spec; use Getopt::Long; use FindBin; use lib $FindBin::Bin; use webkitdirs; my $showHelp = 0; my $testName = ""; GetOptions( 'help' => \$showHelp, 'r|run-test=s' => \$testName, '<>' => \&usage ) or usage(); if ($showHelp) { usage(); } setConfiguration(); my $sourceRootDir = File::Spec->catfile($FindBin::Bin, "../.."); chdir($sourceRootDir); runTest($testName); sub runTest { my $args = @_[0]; my $pathToBinary = "Source/Programs/EUnitTests"; my $utName = ""; if (length($args) > 0) { $utName = " --gtest_filter=" . $args . ".*" . "\n"; } exit system($pathToBinary . $utName); } sub usage { my $programName = basename($0); my $usageText = <