1bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen#!/usr/bin/perl -w 2bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# Copyright (C) 2010 Google Inc. All rights reserved. 3bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# 4bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# Redistribution and use in source and binary forms, with or without 5bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# modification, are permitted provided that the following conditions are 6bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# met: 7bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# 8bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# * Redistributions of source code must retain the above copyright 9bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# notice, this list of conditions and the following disclaimer. 10bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# * Redistributions in binary form must reproduce the above 11bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# copyright notice, this list of conditions and the following disclaimer 12bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# in the documentation and/or other materials provided with the 13bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# distribution. 14bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# * Neither the name of Google Inc. nor the names of its 15bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# contributors may be used to endorse or promote products derived from 16bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# this software without specific prior written permission. 17bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# 18bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen 30bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenuse strict; 31bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenuse File::Spec; 32bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenuse FindBin; 33bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenuse lib $FindBin::Bin; 34bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenuse webkitdirs; 35bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen 36bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen# Allow running this script from any directory. 37bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenmy $sourceRootDir = File::Spec->catfile($FindBin::Bin, "../.."); 38bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenchdir($sourceRootDir); 39bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen 40bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian MonsensetConfiguration(); 41bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen 42bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenmy $pathToBinary; 43bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenif (isDarwin()) { 442fc2651226baac27029e38c9d6ef883fa32084dbSteve Block $pathToBinary = "Source/WebKit/chromium/xcodebuild/" . configuration() . "/webkit_unit_tests"; 45bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen} elsif (isCygwin() || isWindows()) { 462fc2651226baac27029e38c9d6ef883fa32084dbSteve Block $pathToBinary = "Source/WebKit/chromium/" . configuration() . "/webkit_unit_tests.exe"; 47bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen} elsif (isLinux()) { 48bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen $pathToBinary = "out/" . configuration() . "/webkit_unit_tests"; 49bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen} 50bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen 51bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsenexit system ($pathToBinary, @ARGV); 52