1d0825bca7fe65beaee391d30da42e937db621564Steve Block#!/usr/bin/perl 2d0825bca7fe65beaee391d30da42e937db621564Steve Block# 3d0825bca7fe65beaee391d30da42e937db621564Steve Block# Copyright (C) 2009 Chris Jerdonek (chris.jerdonek@gmail.com) 4231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# 5231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# Redistribution and use in source and binary forms, with or without 6231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# modification, are permitted provided that the following conditions are 7231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# met: 8231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# 9231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# * Redistributions of source code must retain the above copyright 10231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# notice, this list of conditions and the following disclaimer. 11231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# * Redistributions in binary form must reproduce the above 12231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# copyright notice, this list of conditions and the following disclaimer 13231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# in the documentation and/or other materials provided with the 14231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# distribution. 15231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# * Neither the name of Google Inc. nor the names of its 16231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# contributors may be used to endorse or promote products derived from 17231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# this software without specific prior written permission. 18231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# 19231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 31d0825bca7fe65beaee391d30da42e937db621564Steve Block# Runs unit tests of WebKit Perl code. 32d0825bca7fe65beaee391d30da42e937db621564Steve Block 33d0825bca7fe65beaee391d30da42e937db621564Steve Blockuse strict; 34d0825bca7fe65beaee391d30da42e937db621564Steve Blockuse warnings; 35d0825bca7fe65beaee391d30da42e937db621564Steve Block 36d0825bca7fe65beaee391d30da42e937db621564Steve Blockuse File::Spec; 37d0825bca7fe65beaee391d30da42e937db621564Steve Blockuse FindBin; 38d0825bca7fe65beaee391d30da42e937db621564Steve Blockuse Test::Harness; 39d0825bca7fe65beaee391d30da42e937db621564Steve Blockuse lib $FindBin::Bin; # so this script can be run from any directory. 40d0825bca7fe65beaee391d30da42e937db621564Steve Blockuse VCSUtils; 41d0825bca7fe65beaee391d30da42e937db621564Steve Block 4221939df44de1705786c545cd1bf519d47250322dBen Murdoch# Change the working directory so that we can pass shorter, relative 4321939df44de1705786c545cd1bf519d47250322dBen Murdoch# paths to runtests(), rather than longer, absolute paths. 4421939df44de1705786c545cd1bf519d47250322dBen Murdoch# 4521939df44de1705786c545cd1bf519d47250322dBen Murdoch# We change to the source root so the paths can be relative to the 4621939df44de1705786c545cd1bf519d47250322dBen Murdoch# source root. These paths display on the screen, and their meaning 4721939df44de1705786c545cd1bf519d47250322dBen Murdoch# will be clearer to the user if relative to the root, rather than to 4821939df44de1705786c545cd1bf519d47250322dBen Murdoch# the Scripts directory, say. 4921939df44de1705786c545cd1bf519d47250322dBen Murdoch# 5021939df44de1705786c545cd1bf519d47250322dBen Murdoch# Source root is two levels up from the Scripts directory. 5121939df44de1705786c545cd1bf519d47250322dBen Murdochmy $sourceRootDir = File::Spec->catfile($FindBin::Bin, "../.."); 5221939df44de1705786c545cd1bf519d47250322dBen Murdochchdir($sourceRootDir); 53d0825bca7fe65beaee391d30da42e937db621564Steve Block 5421939df44de1705786c545cd1bf519d47250322dBen Murdoch# Relative to root 55f05b935882198ccf7d81675736e3aeb089c5113aBen Murdochmy $pattern = "Tools/Scripts/webkitperl/*_unittest/*.pl"; 56231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 57d0825bca7fe65beaee391d30da42e937db621564Steve Blockmy @files = <${pattern}>; # lists files alphabetically 58231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block 59d0825bca7fe65beaee391d30da42e937db621564Steve Blockruntests(@files); 60