Bug 563109: Retire jsDriver.pl and friends, in favor of jstests.py. r=bclary
authorJim Blandy <jimb@mozilla.org>
Thu, 10 Jun 2010 14:43:54 -0700
changeset 47431 230fd4230baab0db1eaf4be5f8557412390f9f84
parent 47430 2164d3ca17def306c739a6179b9aaff4f1d7a6e9
child 47432 47e02e48437a9ed3f2afd43b4abe14e3a320adb6
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbclary
bugs563109
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 563109: Retire jsDriver.pl and friends, in favor of jstests.py. r=bclary
js/src/tests/README-jsDriver.html
js/src/tests/jsDriver.pl
js/src/tests/runRhinoTests.pl
js/src/tests/runtests.pl
js/src/tests/runtests2.pl
deleted file mode 100644
--- a/js/src/tests/README-jsDriver.html
+++ /dev/null
@@ -1,325 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-  <head>
-    <title>jsDriver.pl</title>
-  </head>
-
-  <body bgcolor="white">
-    <h1 align="right">jsDriver.pl</h1>
-
-    <dl>
-      <dt><b>NAME</b></dt>
-      <dd>
-        <b>jsDriver.pl</b> - execute JavaScript programs in various shells in
-        batch or single mode, reporting on failures encountered.
-        <br>
-        <br>
-
-      <dt><b>SYNOPSIS</b></dt>
-      <dd>
-        <table>
-          <tr>
-            <td align="right" valign="top">
-              <code>
-                <b>jsDriver.pl</b>
-              </code>
-            </td>
-            <td>
-              <code>
-                [-hkt] [-b BUGURL] [-c CLASSPATH] [-f OUTFILE]
-                [-j JAVAPATH] [-l TESTLIST ...] [-L NEGLIST ...] [-p TESTPATH]
-                [-s SHELLPATH] [-u LXRURL] [--help] [--confail] [--trace]
-                [--classpath=CLASSPATH] [--file=OUTFILE] [--javapath=JAVAPATH]
-                [--list=TESTLIST] [--neglist=TESTLIST] [--testpath=TESTPATH]
-                [--shellpath=SHELLPATH] [--lxrurl=LXRURL] {-e ENGINETYPE |
-                --engine=ENGINETYPE}
-              </code>
-            </td>
-          </tr>
-        </table>
-        <br>
-        <br>
-
-      <dt><b>DESCRIPTION</b></dt>
-      <dd>
-        <b>jsDriver.pl</b> is normally used to run a series of tests against
-        one of the JavaScript shells.  These tests are expected to be laid out
-        in a directory structure exactly three levels deep.  The first level
-        is considered the <b>root</b> of the tests, subdirectories under the
-        <b>root</b> represent <b>Test Suites</b> and generally mark broad
-        categories such as <i>ECMA Level 1</i> or <i>Live Connect 3</i>.  Under the
-        <b>Test Suites</b> are the <b>Test Categories</b>, which divide the 
-        <b>Test Suite</b> into smaller categories, such as <i>Execution Contexts</i>
-        or <i>Lexical Rules</i>.  Testcases are located under the
-        <B>Test Categories</b> as normal JavaScript (*.js) files.  
-        <p>
-          If a file named <b>shell.js</b> exists in either the
-          <b>Test Suite</b> or the <b>Test Category</b> directory, it is
-          loaded into the shell before the testcase.  If <b>shell.js</b>
-          exists in both directories, the version in the <b>Test Suite</b>
-          directory is loaded <i>first</i>, giving the version associated with
-          the <b>Test Category</b> the ability to override functions previously
-          declared.  You can use this to
-          create functions and variables common to an entire suite or category.
-        <p>
-          Testcases can report failures back to <b>jsDriver.pl</b> in one of
-          two ways.  The most common is to write a line of text containing
-          the word <code>FAILED!</code> to <b>STDOUT</b> or <b>STDERR</b>.
-          When the engine encounters a matching line, the test is marked as
-          failed, and any line containing <code>FAILED!</code> is displayed in
-          the failure report.  The second way a test case can report failure is
-          to return an unexpected exit code.  By default, <b>jsDriver.pl</b>
-          expects all test cases to return exit code 0, although a test
-          can output a line containing <code>EXPECT EXIT <i>n</i></code> where
-          <i>n</i> is the exit code the driver should expect to see.  Testcases
-          can return a nonzero exit code by calling the shell function
-          <code>quit(<i>n</i>)</code> where <code><i>n</i></code> is the
-          code to exit with.  The various JavaScript shells report
-          non-zero exit codes under the following conditions:
-
-          <center>
-            <table border="1">
-              <tr>
-                <th>Reason</th>
-                <th>Exit Code</th>
-              </tr>
-              <tr>
-                <td>
-                  Engine initialization failure.
-                </td>
-                <td>
-                  1
-                </td>
-              </tr>
-              <tr>
-                <td>
-                  Invalid argument on command line.
-                </td>
-                <td>
-                  2
-                </td>
-              </tr>
-              <tr>
-                <td>
-                  Runtime error (uncaught exception) encountered.
-                </td>
-                <td>
-                  3
-                </td>
-              </tr>
-              <tr>
-                <td>
-                  File argument specified on command line not found.
-                </td>
-                <td>
-                  4
-                </td>
-              </tr>
-              <tr>
-                <td>
-                  Reserved for future use.
-                </td>
-                <td>
-                  5-9
-                </td>
-              </tr>
-            </table>
-          </center>
-          <br>
-          <br>
-
-      <dt><b>OPTIONS</b></dt>
-      <dd>
-        <dl>
-          <dt><b>-b URL, --bugurl=URL</b></dt>
-          <dd>
-            Bugzilla URL.  When a testcase writes a line in the format
-            <code>BUGNUMBER <i>n</i></code> to <b>STDOUT</b> or <b>STDERR</b>,
-            <b>jsDriver.pl</b> interprets <code><i>n</i></code> as a bugnumber
-            in the <a href="http://bugzilla.mozilla.org">BugZilla</a> bug
-            tracking system.  In the event that a testcase which has specified
-            a bugnumber fails, a hyperlink to the BugZilla database
-            will be included in the output by prefixing the bugnumber with the
-            URL specified here.  By default, URL is assumed to be
-            &quot;http://bugzilla.mozilla.org/show_bug.cgi?id=&quot;.
-            <br>
-            <br>
-            <a name="classpath"></a>
-          <dt><b>-c PATH, --classpath=PATH</b></dt>
-          <dd>
-            Classpath to pass the the Java Virtual Machine.  When running tests
-            against the <b>Rhino</b> engine, PATH will be passed in as the value
-            to an argument named &quot;-classpath&quot;.  If your particular JVM
-            does not support this option, it is recommended you specify your
-            class path via an environment setting.  Refer to your JVM
-            documentation for more details about CLASSPATH.
-            <br>
-            <br>
-          <dt><b>-e TYPE ..., --engine=TYPE ...</b></dt>
-          <dd>
-            Required.  Type of engine(s) to run the tests against.  TYPE can be
-            one or more of the following values:
-            <center>
-              <table border="1">
-                <tr>
-                  <th>TYPE</th>
-                  <th>Engine</th>
-                </tr>
-                <tr>
-                  <td>rhino</td>
-                  <td>Rhino compiled mode</td>
-                </tr>
-                <tr>
-                  <td>rhinoi</td>
-                  <td>Rhino interpreted mode</td>
-                </tr>
-                <tr>
-                  <td>rhinoms</td>
-                  <td>Rhino compiled mode for the Microsoft VM (jview)</td>
-                </tr>
-                <tr>
-                  <td>rhinomsi</td>
-                  <td>Rhino interpreted mode for the Microsoft VM (jview)</td>
-                </tr>
-                <tr>
-                  <td>smopt</td>
-                  <td>Spider-Monkey, optimized</td>
-                </tr>
-                <tr>
-                  <td>smdebug</td>
-                  <td>Spider-Monkey, debug</td>
-                </tr>
-                <tr>
-                  <td>xpcshell</td>
-                  <td>XPConnect shell</td>
-                </tr>
-              </table>
-            </center>
-            <br>
-            <br>
-          <dt><b>-f FILE, --file=FILE</b></dt>
-          <dd>
-            Generate html output to the HTML file named by FILE.  By default,
-            a filename will be generated using a combination of the engine type
-            and a date/time stamp, in the format: 
-            <code>results-<i>&lt;engine-type&gt;</i>-<i>&lt;date-stamp&gt;</i>.html</code>
-            <br>
-            <br>
-          <dt><b>-h, --help</b></dt>
-          <dd>
-            Prints usage information.
-            <br>
-            <br>
-          <dt><b>-j PATH, --javapath=PATH</b></dt>
-          <dd>
-            Set the location of the Java Virtual Machine to use when running
-            tests against the <b>Rhino</b> engine.  This can be used to test
-            against multiple JVMs on the same system.
-            <br>
-            <br>
-          <dt><b>-k, --confail</b></dt>
-          <dd>
-            Log failures to the console.  This will show any failures, as they
-            occur, on <b>STDERR</b> in addition to creating the HTML results
-            file.  This can be useful for times when it may be 
-            counter-productive to load an HTML version of the results each time
-            a test is re-run.
-            <br>
-            <br>
-          <dt><b>-l FILE ..., --list=FILE ...</b></dt>
-          <dd>
-            Specify a list of tests to execute.  FILE can be a plain text file
-            containing a list of testcases to execute, a subdirectory 
-            in which to
-            <a href="http://www.instantweb.com/~foldoc/foldoc.cgi?query=grovel">grovel</a>
-            for tests, or a single testcase to execute.  Any number of FILE 
-            specifiers may follow this option.  The driver uses the fact that a
-            valid testcase should be a file ending in .js to make the distinction
-            between a file containing a list of tests and an actual testcase.
-            <br>
-            <br>
-          <dt><b>-L FILE ..., --neglist=FILE ...</b></dt>
-          <dd>
-            Specify a list of tests to skip.  FILE has the same meaning as in
-            the <b>-l</b> option.  This option is evaluated after
-            <b>all</b> <b>-l</b> and <b>--list</b> options, allowing a user
-            to subtract a single testcase, a directory of testcases, or a
-            collection of unrelated testcases from the execution list.
-            <br>
-            <br>
-          <dt><b>-p PATH, --testpath=PATH</b></dt>
-          <dd>
-            Directory holding the &quot;Test Suite&quot; subdirectories.  By
-            default this is ./
-            <br>
-            <br>
-          <dt><b>-s PATH, --shellpath=PATH</b></dt>
-          <dd>
-            Directory holding the JavaScript shell.  This can be used to override
-            the automatic shell location <b>jsDriver.pl</b> performs based on
-            you OS and engine type.  For Non <b>Rhino</b> engines, this 
-            includes the name of the executable as well as the path.  In
-            <b>Rhino</b>, this path will be appended to your 
-            <a href="#classpath">CLASSPATH</a>.  For the 
-            <b>SpiderMonkey</b> shells, this value defaults to
-            ../src/&lt;Platform-and-buildtype-specific-directory&gt;/[js|jsshell],
-            and for the <b>xpcshell</b> the default is the value of
-            your <code>MOZILLA_FIVE_HOME</code> environment variable.
-            There is no default (as it is usually not needed) for
-            the <b>Rhino</b> shell.
-            <br>
-            <br>
-          <dt><b>-t, --trace</b></dt>
-          <dd>
-            Trace execution of <b>jsDriver.pl</b>.  This option is primarily
-            used for debugging of the script itself, but if you are interested in
-            seeing the actual command being run, or generally like gobs of
-            useless information, you may find it entertaining.
-            <br>
-            <br>
-          <dt><b>-u URL, --lxrurl=URL</b></dt>
-          <dd>
-            Failures listed in the HTML results will be hyperlinked to the
-            lxr source available online by prefixing the test path and
-            name with this URL.  By default, URL is
-            http://lxr.mozilla.org/mozilla/source/js/tests/
-            <br>
-            <br>
-
-        </dl>
-      <dt><b>SEE ALSO</b></dt>
-      <dd>
-        <a href="http://lxr.mozilla.org/mozilla/source/js/tests/jsDriver.pl">jsDriver.pl</a>,
-        <a href="http://lxr.mozilla.org/mozilla/source/js/tests/mklistpage.pl">mklistpage.pl</a>,
-        <a href="http://www.mozilla.org/js/">http://www.mozilla.org/js/</a>,
-        <a href="http://www.mozilla.org/js/tests/library.html">http://www.mozilla.org/js/tests/library.html</a>
-        <br>
-        <br>
-
-      <dt><b>REQUIREMENTS</b></dt>
-      <dd>
-        <b>jsDriver.pl</b> requires the
-        <a href="http://search.cpan.org/search?module=Getopt::Mixed">Getopt::Mixed</a>
-        perl package, available from <a href="http://www.cpan.org">cpan.org</a>.
-        <br>
-        <br>
-      <dt><b>EXAMPLES</b></dt>
-      <dd>
-          <code>perl jsDriver.pl -e smdebug -L ecma_3*</code><br>
-          Executes all tests EXCEPT the ecma_3 tests against the
-          SpiderMonkey debug shell, writing the results
-          to the default result file.  (NOTE: Unix shells take care of wildcard
-          expansion, turning <code>ecma_3*</code> into
-	  <code>ecma_3 ecma_3_1</code>.  Under a DOS shell, you must explicitly
-	  list the directories.)
-        <p>
-          <code>perl jsDriver.pl -e rhino -L rhino-n.tests</code><br>
-          Executes all tests EXCEPT those listed in the
-          <code>rhino-n.tests</code> file.
-    </dl>
-    <hr>
-    Author: Robert Ginda<br>
-    Currently maintained by <i><a href="mailto:pschwartau@meer.net">Phil Schwartau</a> </i><br>
-<!-- Created: Thu Dec  2 19:08:05 PST 1999 -->
-  </body>
-</html>
deleted file mode 100755
--- a/js/src/tests/jsDriver.pl
+++ /dev/null
@@ -1,1537 +0,0 @@
-#!/usr/bin/perl
-# -*- Mode: Perl; tab-width: 4; indent-tabs-mode: nil; -*-
-# vim: set ts=4 sw=4 et tw=80:
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is JavaScript Core Tests.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1997-1999
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Robert Ginda <rginda@netscape.com>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-# Second cut at runtests.pl script originally by
-# Christine Begle (cbegle@netscape.com)
-# Branched 11/01/99
-
-use strict;
-use File::Temp qw/ tempfile tempdir /;
-use POSIX qw(sys_wait_h);
-
-my $os_type = &get_os_type;
-my $unixish = (($os_type ne "WIN") && ($os_type ne "MAC"));
-my $path_sep = ($os_type eq "MAC") ? ":" : "/";
-my $win_sep  = ($os_type eq "WIN")? &get_win_sep : "";
-my $redirect_command = ($os_type ne "MAC") ? " 2>&1" : "";
-
-# command line option defaults
-my $opt_suite_path;
-my $opt_trace = 0;
-my $opt_classpath = "";
-my $opt_rhino_opt = 0;
-my $opt_rhino_ms = 0;
-my @opt_engine_list;
-my $opt_engine_type = "";
-my $opt_engine_params = "";
-my $opt_user_output_file = 0;
-my $opt_output_file = "";
-my @opt_test_list_files;
-my @opt_neg_list_files;
-my $opt_shell_path = "";
-my $opt_java_path = "";
-my $opt_bug_url = "https://bugzilla.mozilla.org/show_bug.cgi?id=";
-my $opt_console_failures = 0;
-my $opt_console_failures_line = 0;
-my $opt_lxr_url = "http://lxr.mozilla.org/mozilla/source/js/tests/";
-my $opt_exit_munge = ($os_type ne "MAC") ? 1 : 0;
-my $opt_timeout = 3600;
-my $opt_enable_narcissus = 0;
-my $opt_narcissus_path = "";
-my $opt_no_quit = 0;
-my $opt_report_summarized_results = 0;
-
-# command line option definition
-my $options = "b=s bugurl>b c=s classpath>c e=s engine>e f=s file>f " .
-  "h help>h i j=s javapath>j k confail>k K linefail>K R report>R l=s list>l " .
-  "L=s neglist>L o=s opt>o p=s testpath>p s=s shellpath>s t trace>t " .
-  "T=s timeout>T u=s lxrurl>u " .
-  "x noexitmunge>x n=s narcissus>n " .
-  "Q noquitinthandler>Q";
-
-my $last_option;
-
-if ($os_type eq "MAC") {
-    $opt_suite_path = `directory`;
-    $opt_suite_path =~ s/[\n\r]//g;
-    $opt_suite_path .= ":";
-} else {
-    $opt_suite_path = "./";
-}
-
-&parse_args;
-
-my $user_exit = 0;
-my ($engine_command, $html, $failures_reported, $tests_completed,
-    $exec_time_string);
-my @failed_tests;
-my @test_list = &get_test_list;
-
-if ($#test_list == -1) {
-    die ("Nothing to test.\n");
-}
-
-if ($unixish && $opt_no_quit == 0) {
-    # on unix, ^C pauses the tests, and gives the user a chance to quit but
-    # report on what has been done, to just quit, or to continue (the
-    # interrupted test will still be skipped.)
-    # windows doesn't handle the int handler they way we want it to,
-    # so don't even pretend to let the user continue.
-    $SIG{INT} = 'int_handler';
-}
-
-my $current_test;
-my $current_test_pid;
-
-&main;
-
-#End.
-
-sub main {
-    my $start_time;
-
-    while ($opt_engine_type = pop (@opt_engine_list)) {
-        dd ("Testing engine '$opt_engine_type'");
-
-        $engine_command = &get_engine_command;
-        $html = "";
-        @failed_tests = ();
-        $failures_reported = 0;
-        $tests_completed = 0;
-        $start_time = time;
-
-
-        &execute_tests (@test_list);
-
-        my $exec_time = (time - $start_time);
-        my $exec_hours = int($exec_time / 60 / 60);
-        $exec_time -= $exec_hours * 60 * 60;
-        my $exec_mins = int($exec_time / 60);
-        $exec_time -= $exec_mins * 60;
-        my $exec_secs = ($exec_time % 60);
-
-        if ($exec_hours > 0) {
-            $exec_time_string = "$exec_hours hours, $exec_mins minutes, " .
-              "$exec_secs seconds";
-        } elsif ($exec_mins > 0) {
-            $exec_time_string = "$exec_mins minutes, $exec_secs seconds";
-        } else {
-            $exec_time_string = "$exec_secs seconds";
-        }
-
-        if (!$opt_user_output_file) {
-            $opt_output_file = &get_tempfile_name;
-        }
-
-        &write_results;
-
-    }
-}
-
-sub append_file_to_command {
-    my ($command, $file) = @_;
-
-    if ($opt_enable_narcissus == 1) {
-        $command .= " -e 'evaluate(\"load(\\\"$file\\\")\")'"
-    } else {
-        $command .= " -f $file";
-    }
-}
-
-sub execute_tests {
-    my (@test_list) = @_;
-    my ($test, $shell_command, $line, @output, $path);
-    my ($last_suite, $last_test_dir);
-
-    &status ("Executing " . ($#test_list + 1) . " test(s).");
-
-    foreach $test (@test_list) {
-        my ($suite, $test_dir, $test_file) = split($path_sep, $test);
-        # *-n.js is a negative test, expect exit code 3 (runtime error)
-        my $expected_exit = ($test =~ /\-n\.js$/) ? 3 : 0;
-        my ($got_exit, $exit_signal);
-        my $failure_lines;
-        my $bug_number;
-        my $status_lines;
-        my $result_lines;
-
-        # Allow the test to declare multiple possible success exit codes.
-        # This is useful in situations where the test fails if a
-        # crash occurs but passes if no crash occurs even if an
-        # out of memory error occurs.
-        my @expected_exit_list = ($expected_exit);
-
-        # user selected [Q]uit from ^C handler.
-        if ($user_exit) {
-            return;
-        }
-
-        $current_test = $test;
-
-        # Append the shell.js files to the shell_command if they're there.
-        # (only check for their existence if the suite or test_dir has changed
-        # since the last time we looked.)
-        if ($last_suite ne $suite || $last_test_dir ne $test_dir) {
-            $shell_command = &xp_path($engine_command);
-
-            $path = &xp_path($opt_suite_path ."shell.js");
-            if (-f $path) {
-                $shell_command = &append_file_to_command($shell_command,
-                                                         $path);
-            }
-
-            $path = &xp_path($opt_suite_path . $suite . "/shell.js");
-            if (-f $path) {
-                $shell_command = &append_file_to_command($shell_command,
-                                                         $path);
-            }
-
-            $path = &xp_path($opt_suite_path . $suite . "/" .
-                             $test_dir . "/shell.js");
-            if (-f $path) {
-                $shell_command = &append_file_to_command($shell_command,
-                                                         $path);
-            }
-
-            $last_suite = $suite;
-            $last_test_dir = $test_dir;
-        }
-        
-        $path = &xp_path($opt_suite_path . $test);
-        my $command = &append_file_to_command($shell_command, $path);
-
-        $path = &xp_path($opt_suite_path ."js-test-driver-end.js");
-        if (-f $path) {
-            $command = &append_file_to_command($command,
-                                               $path);
-        }
-
-        &dd ("executing: " . $command);
-
-        my $jsout;
-        (undef, $jsout) = tempfile();
-
-        #XXX cloned from tinderbox. See sub kill_process
-        my $pid = fork; # Fork a child process to run the test
-        unless ($pid) {
-            open STDOUT, ">$jsout";
-            open STDERR, ">&STDOUT";
-            select STDOUT; $| = 1; # make STDOUT unbuffered
-            select STDERR; $| = 1; # make STDERR unbuffered
-            exec $command;
-            die "Could not exec $command";
-        }
-
-        $current_test_pid = $pid;
-
-        my $timed_out = 0;
-        my $dumped_core = 0;
-        my $loop_count = 0;
-        my $wait_pid = -1;
-
-        eval
-        {
-            local $SIG{ALRM} = sub { die "time out" };
-            alarm $opt_timeout;
-            $wait_pid = waitpid($pid, 0);
-            alarm 0;
-        };
-
-        if ($@ and $@ =~ /time out/)
-        {
-            kill_process($pid);
-            $timed_out = 1;
-        }
-
-        $current_test_pid = undef;
-
-        if ($opt_exit_munge == 1) {
-            # signal information in the lower 8 bits, exit code above that
-            $got_exit = ($? >> 8);
-            $exit_signal = ($? & 255);
-        } else {
-            # user says not to munge the exit code
-            $got_exit = $?;
-            $exit_signal = 0;
-        }
-
-        open (OUTPUT, "$jsout") or
-           die "failed to open temporary file $jsout: $!\n";
-        @output = <OUTPUT>;
-        close (OUTPUT);
-        unlink "$jsout";
-        @output = grep (!/js\>/, @output);
-
-        $failure_lines = "";
-        $bug_number = "";
-        $status_lines = "";
-        $result_lines = "";
-
-        foreach $line (@output) {
-
-            # watch for testcase to proclaim what exit code it expects to
-            # produce (0 by default)
-            if ($line =~ /expect(ed)?\s*exit\s*code\s*\:?\s*(\d+)/i) {
-                $expected_exit = $2;
-                push @expected_exit_list, ($expected_exit);
-                &dd ("Test case expects exit code $expected_exit");
-            }
-
-            # watch for failures
-            if ($line =~ /^\s*FAILED!/) {
-                $failure_lines .= $line;
-            }
-
-            # and watch for bugnumbers
-            # XXX This only allows 1 bugnumber per testfile, should be
-            # XXX modified to allow for multiple.
-            if ($line =~ /bugnumber\s*\:?\s*(.*)/i) {
-                my $bugline = $1;
-                $bugline =~ /(\d+)/;
-                $bug_number = $1;
-            }
-
-            # and watch for status
-            if ($line =~ /status/i) {
-                $status_lines .= $line;
-            }
-
-            # collect result summary lines
-            if ($line =~ /^jstest:/)
-            {
-                $result_lines .= $line;
-            }
-        }
-
-        if (!@output) {
-            @output = ("Testcase produced no output!");
-        }
-
-        if ($opt_report_summarized_results) {
-            print STDERR $result_lines;
-            if ($timed_out)
-            {
-                &report_summary_result($test, $bug_number, "FAILED TIMED OUT",
-                                       "", "", "",
-                                       join("\n",@output));
-            }
-            elsif (index(join(',', @expected_exit_list), $got_exit) == -1 ||
-                   $exit_signal != 0) {
-                &report_summary_result($test, $bug_number, "FAILED",
-                                       "", 
-                                       "Expected exit $expected_exit",
-                                       "Actual exit $got_exit, signal $exit_signal",
-                                       join("\n",@output));
-            }
-            elsif ($got_exit != 0) {
-                # abnormal termination but the test passed, so output a summary line
-                &report_summary_result($test, $bug_number, "PASSED",
-                                       "", 
-                                       "Expected exit $expected_exit",
-                                       "Actual exit $got_exit, signal $exit_signal",
-                                       join("\n",@output));
-            }
-        }
-        elsif ($timed_out) {
-            # test was terminated due to timeout
-            &report_failure ($test, "TIMED OUT ($opt_timeout seconds) " .
-                             "Complete testcase output was:\n" .
-                             join ("\n",@output), $bug_number);
-        }
-        elsif (index(join(',', @expected_exit_list), $got_exit) == -1 ||
-               $exit_signal != 0) {
-            # full testcase output dumped on mismatched exit codes,
-            &report_failure ($test, "Expected exit code " .
-                             "$expected_exit, got $got_exit\n" .
-                             "Testcase terminated with signal $exit_signal\n" .
-                             "Complete testcase output was:\n" .
-                             join ("\n",@output), $bug_number);
-        } elsif ($failure_lines) {
-            # only offending lines if exit codes matched
-            &report_failure ($test, "$status_lines\n".
-                             "Failure messages were:\n$failure_lines",
-                             $bug_number);
-        }
-
-        &dd ("exit code $got_exit, exit signal $exit_signal.");
-
-        $tests_completed++;
-    }
-}
-
-sub write_results {
-    my ($list_name, $neglist_name);
-    my $completion_date = localtime;
-    my $failure_pct = int(($failures_reported / $tests_completed) * 10000) /
-      100;
-    &dd ("Writing output to $opt_output_file.");
-
-    if ($#opt_test_list_files == -1) {
-        $list_name = "All tests";
-    } elsif ($#opt_test_list_files < 10) {
-        $list_name = join (", ", @opt_test_list_files);
-    } else {
-        $list_name = "($#opt_test_list_files test files specified)";
-    }
-
-    if ($#opt_neg_list_files == -1) {
-        $neglist_name = "(none)";
-    } elsif ($#opt_test_list_files < 10) {
-        $neglist_name = join (", ", @opt_neg_list_files);
-    } else {
-        $neglist_name = "($#opt_neg_list_files skip files specified)";
-    }
-
-    open (OUTPUT, "> $opt_output_file") ||
-      die ("Could not create output file $opt_output_file");
-
-    print OUTPUT
-      ("<html><head>\n" .
-       "<title>Test results, $opt_engine_type</title>\n" .
-       "</head>\n" .
-       "<body bgcolor='white'>\n" .
-       "<a name='tippy_top'></a>\n" .
-       "<h2>Test results, $opt_engine_type</h2><br>\n" .
-       "<p class='results_summary'>\n" .
-       "Test List: $list_name<br>\n" .
-       "Skip List: $neglist_name<br>\n" .
-       ($#test_list + 1) . " test(s) selected, $tests_completed test(s) " .
-       "completed, $failures_reported failures reported " .
-       "($failure_pct% failed)<br>\n" .
-       "Engine command line: $engine_command<br>\n" .
-       "OS type: $os_type<br>\n");
-
-    if ($opt_engine_type =~ /^rhino/) {
-        open (JAVAOUTPUT, $opt_java_path . "java -fullversion " .
-              $redirect_command . " |");
-        print OUTPUT <JAVAOUTPUT>;
-        print OUTPUT "<BR>";
-        close (JAVAOUTPUT);
-    }
-
-    print OUTPUT
-      ("Testcase execution time: $exec_time_string.<br>\n" .
-       "Tests completed on $completion_date.<br><br>\n");
-
-    if ($failures_reported > 0) {
-        my $output_file_failures = $opt_output_file;
-        $output_file_failures =~ s/(.*)\.html$/$1-failures.txt/;
-        open (OUTPUTFAILURES, "> $output_file_failures") ||
-            die ("Could not create failure output file $output_file_failures");
-        print OUTPUTFAILURES (join ("\n", @failed_tests));
-        print OUTPUTFAILURES "\n";
-        close OUTPUTFAILURES;
-
-        &status ("Wrote failures to '$output_file_failures'.");
-
-        print OUTPUT
-          ("[ <a href='#fail_detail'>Failure Details</a> | " .
-           "<a href='#retest_list'>Retest List</a> | " .
-           "<a href='$opt_lxr_url" . "menu.html'>Test Selection Page</a> ]<br>\n" .
-           "<hr>\n" .
-           "<a name='fail_detail'></a>\n" .
-           "<h2>Failure Details</h2><br>\n<dl>" .
-           $html .
-           "</dl>\n[ <a href='#tippy_top'>Top of Page</a> | " .
-           "<a href='#fail_detail'>Top of Failures</a> ]<br>\n" .
-           "<hr>\n" .
-           "<a name='retest_list'></a>\n" .
-           "<h2>Retest List</h2><br>\n" .
-           "<pre>\n" .
-           "# Retest List, $opt_engine_type, " .
-           "generated $completion_date.\n" .
-           "FAILURE: # Original test base was: $list_name.\n" .
-           "FAILURE: # $tests_completed of " . ($#test_list + 1) .
-           " test(s) were completed, " .
-           "$failures_reported failures reported.\n" .
-           "FAILURE: Engine command line: $engine_command<br>\n" .
-           join ("\n", map { "FAILURE: $_" } @failed_tests) .
-           "\n</pre>\n" .
-           "[ <a href='#tippy_top'>Top of Page</a> | " .
-           "<a href='#retest_list'>Top of Retest List</a> ]<br>\n");
-    } else {
-        print OUTPUT
-          ("<h1>Whoop-de-doo, nothing failed!</h1>\n");
-    }
-
-    print OUTPUT "</body>";
-
-    close (OUTPUT);
-
-    &status ("Wrote results to '$opt_output_file'.");
-
-    if ($opt_console_failures) {
-        &status ("$failures_reported test(s) failed");
-    }
-
-}
-
-sub next_option {
-    my ($key, $val, $implied);
-
-    return if @ARGV == 0;
-
-    &dd ("ARGV is now: @ARGV\n");
-
-    $key = shift @ARGV;
-    if ($key =~ s/^--?(.*)/$1/) {
-        $implied = 0;
-    } else {
-        $implied = 1;
-        $val = $key;
-        $key = $last_option;
-    }
-
-    if ($key =~ /\w+/ and $options =~ /\b$key>(\w+)/) {
-        $key = $1;
-    }
-
-    if ($options =~ /\b$key=s\b/) {
-        if (!$implied) {
-            die "option '$key' requires an argument" if @ARGV == 0;
-            $val = shift @ARGV;
-        }
-    } elsif ($options =~ /(^|\s)$key(\s|$)/) {
-        die "option '$key' doesn't take an argument" if $implied;
-        $val = 1;
-    } else {
-        die "can't figure out option '$key'";
-    }
-    $last_option = $key;
-    return ($key, $val);
-}
-
-sub parse_args {
-    my ($option, $value, $lastopt);
-
-    &dd ("checking command line options.");
-
-    while (($option, $value) = next_option()) {
-
-        if ($option eq "b") {
-            &dd ("opt: setting bugurl to '$value'.");
-            $opt_bug_url = $value;
-
-        } elsif ($option eq "c") {
-            &dd ("opt: setting classpath to '$value'.");
-            $opt_classpath = $value;
-
-        } elsif (($option eq "e") || (($option eq "") && ($lastopt eq "e"))) {
-            &dd ("opt: adding engine $value.");
-            push (@opt_engine_list, $value);
-
-        } elsif ($option eq "f") {
-            if (!$value) {
-                die ("Output file cannot be null.\n");
-            }
-            &dd ("opt: setting output file to '$value'.");
-            $opt_user_output_file = 1;
-            $opt_output_file = $value;
-
-        } elsif ($option eq "h") {
-            &usage;
-
-        } elsif ($option eq "j") {
-            if (!($value =~ /[\/\\]$/)) {
-                $value .= "/";
-            }
-            &dd ("opt: setting java path to '$value'.");
-            $opt_java_path = $value;
-
-        } elsif ($option eq "k") {
-            &dd ("opt: displaying failures on console.");
-            $opt_console_failures=1;
-
-        } elsif ($option eq "K") {
-            &dd ("opt: displaying failures on console as single line.");
-            $opt_console_failures=1;
-            $opt_console_failures_line=1;
-
-        } elsif ($option eq "R") {
-            &dd ("opt: Report summarized test results.");
-            $opt_report_summarized_results=1;
-
-        } elsif ($option eq "l" || (($option eq "") && ($lastopt eq "l"))) {
-            $option = "l";
-            &dd ("opt: adding test list '$value'.");
-            push (@opt_test_list_files, $value);
-
-        } elsif ($option eq "L" || (($option eq "") && ($lastopt eq "L"))) {
-            $option = "L";
-            &dd ("opt: adding negative list '$value'.");
-            push (@opt_neg_list_files, $value);
-
-        } elsif ($option eq "o") {
-            $opt_engine_params = $value;
-            &dd ("opt: setting engine params to '$opt_engine_params'.");
-
-        } elsif ($option eq "p") {
-            $opt_suite_path = $value;
-
-            if ($os_type eq "MAC") {
-                if (!($opt_suite_path =~ /\:$/)) {
-                    $opt_suite_path .= ":";
-                }
-            } else {
-                if (!($opt_suite_path =~ /[\/\\]$/)) {
-                    $opt_suite_path .= "/";
-                }
-            }
-
-            &dd ("opt: setting suite path to '$opt_suite_path'.");
-
-        } elsif ($option eq "s") {
-            $opt_shell_path = $value;
-            &dd ("opt: setting shell path to '$opt_shell_path'.");
-
-        } elsif ($option eq "t") {
-            &dd ("opt: tracing output.  (console failures at no extra charge.)");
-            $opt_console_failures = 1;
-            $opt_trace = 1;
-
-        } elsif ($option eq "u") {
-            &dd ("opt: setting lxr url to '$value'.");
-            $opt_lxr_url = $value;
-
-        } elsif ($option eq "x") {
-            &dd ("opt: turning off exit munging.");
-            $opt_exit_munge = 0;
-
-        } elsif ($option eq "T") {
-            $opt_timeout = $value;
-            &dd ("opt: setting timeout to $opt_timeout.");
-
-        } elsif ($option eq "n") {
-            &dd ("opt: enabling narcissus.");
-            $opt_enable_narcissus = 1;
-            if ($value) {
-                $opt_narcissus_path = $value;
-            }
-
-        } elsif ($option eq "Q") {
-            &dd ("opt: disabling interrupt handler.");
-            $opt_no_quit = 1;
-
-        } else {
-            &dd ("opt: unknown option $option '$value'.");
-            &usage;
-        }
-
-        $lastopt = $option;
-
-    }
-
-    if ($#opt_engine_list == -1) {
-        die "You must select a shell to test in.\n";
-    }
-
-}
-
-#
-# print the arguments that this script expects
-#
-sub usage {
-    print STDERR
-      ("\nusage: $0 [<options>] \n" .
-       "(-b|--bugurl)             Bugzilla URL.\n" .
-       "                          (default is $opt_bug_url)\n" .
-       "(-c|--classpath)          Classpath (Rhino only.)\n" .
-       "(-e|--engine) <type> ...  Specify the type of engine(s) to test.\n" .
-       "                          <type> is one or more of\n" .
-       "                          (smopt|smdebug|xpcshell|" .
-       "rhino|rhinoi|rhinoms|rhinomsi|rhino9|rhinoms9).\n" .
-       "(-f|--file) <file>        Redirect output to file named <file>.\n" .
-       "                          (default is " .
-       "results-<engine-type>-<date-stamp>.html)\n" .
-       "(-h|--help)               Print this message.\n" .
-       "(-j|--javapath)           Location of java executable.\n" .
-       "(-k|--confail)            Log failures to console (also.)\n" .
-       "(-K|--linefail)           Log failures to console as single line (also.)\n" .
-       "(-R|--report)             Report summarized test results.\n" .
-       "(-l|--list) <file> ...    List of tests to execute.\n" .
-       "(-L|--neglist) <file> ... List of tests to skip.\n" .
-       "(-o|--opt) <options>      Options to pass to the JavaScript engine.\n" .
-       "                          (Make sure to quote them!)\n" .
-       "(-p|--testpath) <path>    Root of the test suite. (default is ./)\n" .
-       "(-s|--shellpath) <path>   Location of JavaScript shell.\n" .
-       "(-t|--trace)              Trace script execution.\n" .
-       "(-T|--timeout) <seconds>  Time in seconds before the test is terminated.\n" .
-       "                          (default is 3600).\n" .
-       "(-u|--lxrurl) <url>       Complete URL to tests subdirectory on lxr.\n" .
-       "                          (default is $opt_lxr_url)\n" .
-       "(-x|--noexitmunge)        Don't do exit code munging (try this if it\n" .
-       "                          seems like your exit codes are turning up\n" .
-       "                          as exit signals.)\n" .
-       "(-n|--narcissus)[=<path>] Run the test suite through Narcissus, run\n" .
-       "                          through the given shell. The optional path\n".
-       "                          is the path to Narcissus' js.js file.\n".
-       "(-Q|--noquitinthandler)   Do not prompt user to Quit, Report or Continue\n".
-       "                          in the event of a user interrupt.\n"
-       );
-    exit (1);
-
-}
-
-#
-# get the shell command used to start the (either) engine
-#
-sub get_engine_command {
-
-    my $retval;
-
-    if ($opt_engine_type eq "rhino") {
-        &dd ("getting rhino engine command.");
-        $opt_rhino_opt = 0;
-        $opt_rhino_ms = 0;
-        $retval = &get_rhino_engine_command;
-    } elsif ($opt_engine_type eq "rhinoi") {
-        &dd ("getting rhinoi engine command.");
-        $opt_rhino_opt = -1;
-        $opt_rhino_ms = 0;
-        $retval = &get_rhino_engine_command;
-    } elsif ($opt_engine_type eq "rhino9") {
-        &dd ("getting rhino engine command.");
-        $opt_rhino_opt = 9;
-        $opt_rhino_ms = 0;
-        $retval = &get_rhino_engine_command;
-    } elsif ($opt_engine_type eq "rhinoms") {
-        &dd ("getting rhinoms engine command.");
-        $opt_rhino_opt = 0;
-        $opt_rhino_ms = 1;
-        $retval = &get_rhino_engine_command;
-    } elsif ($opt_engine_type eq "rhinomsi") {
-        &dd ("getting rhinomsi engine command.");
-        $opt_rhino_opt = -1;
-        $opt_rhino_ms = 1;
-        $retval = &get_rhino_engine_command;
-    } elsif ($opt_engine_type eq "rhinoms9") {
-        &dd ("getting rhinomsi engine command.");
-        $opt_rhino_opt = 9;
-        $opt_rhino_ms = 1;
-        $retval = &get_rhino_engine_command;
-    } elsif ($opt_engine_type eq "xpcshell") {
-        &dd ("getting xpcshell engine command.");
-        $retval = &get_xpc_engine_command;
-    } elsif ($opt_engine_type =~ /^sm(opt|debug)$/) {
-        &dd ("getting spidermonkey engine command.");
-        $retval = &get_sm_engine_command;
-    } elsif ($opt_engine_type =~ /^ep(opt|debug)$/) {
-        &dd ("getting epimetheus engine command.");
-        $retval = &get_ep_engine_command;
-    } else {
-        die ("Unknown engine type selected, '$opt_engine_type'.\n");
-    }
-
-    $retval .= " $opt_engine_params";
-
-    if ($opt_enable_narcissus == 1) {
-        my $narcissus_path = &get_narcissus_path;
-        $retval .= " -f $narcissus_path";
-    }
-
-    &dd ("got '$retval'");
-
-    return $retval;
-}
-
-#
-# get the path to the Narcissus js.js file.
-#
-sub get_narcissus_path {
-    my $retval;
-
-    if ($opt_narcissus_path) {
-        $retval = $opt_narcissus_path;
-    } else {
-        # For now, just assume that we're in js/tests.
-        $retval = "../narcissus/js.js";
-    }
-
-    if (!-e $retval) {
-        # XXX if it didn't exist, try something more fancy?
-        die "Unable to find Narcissus' js.js at $retval";
-    }
-
-    return $retval;
-}
-
-#
-# get the shell command used to run rhino
-#
-sub get_rhino_engine_command {
-    my $retval = $opt_java_path . ($opt_rhino_ms ? "jview " : "java ");
-
-    if ($opt_shell_path) {
-        $opt_classpath = ($opt_classpath) ?
-          $opt_classpath . ":" . $opt_shell_path :
-            $opt_shell_path;
-    }
-
-    if ($opt_classpath) {
-        $retval .= ($opt_rhino_ms ? "/cp:p" : "-classpath") . " $opt_classpath ";
-    }
-
-    $retval .= "org.mozilla.javascript.tools.shell.Main";
-
-    if ($opt_rhino_opt) {
-        $retval .= " -opt $opt_rhino_opt";
-    }
-
-    return $retval;
-
-}
-
-#
-# get the shell command used to run xpcshell
-#
-sub get_xpc_engine_command {
-    my $retval;
-    my $m5_home = @ENV{"MOZILLA_FIVE_HOME"} ||
-      die ("You must set MOZILLA_FIVE_HOME to use the xpcshell" ,
-           (!$unixish) ? "." : ", also " .
-           "setting LD_LIBRARY_PATH to the same directory may get rid of " .
-           "any 'library not found' errors.\n");
-
-    if (($unixish) && (!@ENV{"LD_LIBRARY_PATH"})) {
-        print STDERR "-#- WARNING: LD_LIBRARY_PATH is not set, xpcshell may " .
-          "not be able to find the required components.\n";
-    }
-
-    if (!($m5_home =~ /[\/\\]$/)) {
-        $m5_home .= "/";
-    }
-
-    $retval = $m5_home . "xpcshell";
-
-    if ($os_type eq "WIN") {
-        $retval .= ".exe";
-    }
-
-    $retval = &xp_path($retval);
-
-    if (($os_type ne "MAC") && !(-x $retval)) {
-        # mac doesn't seem to deal with -x correctly
-        die ($retval . " is not a valid executable on this system.\n");
-    }
-
-    return $retval;
-
-}
-
-#
-# get the shell command used to run spidermonkey
-#
-sub get_sm_engine_command {
-    my $retval;
-
-    # Look for Makefile.ref style make first.
-    # (On Windows, spidermonkey can be made by two makefiles, each putting the
-    # executable in a diferent directory, under a different name.)
-
-    if ($opt_shell_path) {
-        # if the user provided a path to the shell, return that.
-        $retval = $opt_shell_path;
-
-    } else {
-
-        if ($os_type eq "MAC") {
-            $retval = $opt_suite_path . ":src:macbuild:JS";
-        } else {
-            $retval = $opt_suite_path . "../src/";
-            opendir (SRC_DIR_FILES, $retval);
-            my @src_dir_files = readdir(SRC_DIR_FILES);
-            closedir (SRC_DIR_FILES);
-
-            my ($dir, $object_dir);
-            my $pattern = ($opt_engine_type eq "smdebug") ?
-              'DBG.OBJ' : 'OPT.OBJ';
-
-            # scan for the first directory matching
-            # the pattern expected to hold this type (debug or opt) of engine
-            foreach $dir (@src_dir_files) {
-                if ($dir =~ $pattern) {
-                    $object_dir = $dir;
-                    last;
-                }
-            }
-
-            if (!$object_dir && $os_type ne "WIN") {
-                die ("Could not locate an object directory in $retval " .
-                     "matching the pattern *$pattern.  Have you built the " .
-                     "engine?\n");
-            }
-
-            if (!(-x $retval . $object_dir . "/js.exe") && ($os_type eq "WIN")) {
-                # On windows, you can build with js.mak as well as Makefile.ref
-                # (Can you say WTF boys and girls?  I knew you could.)
-                # So, if the exe the would have been built by Makefile.ref isn't
-                # here, check for the js.mak version before dying.
-                if ($opt_shell_path) {
-                    $retval = $opt_shell_path;
-                    if (!($retval =~ /[\/\\]$/)) {
-                        $retval .= "/";
-                    }
-                } else {
-                    if ($opt_engine_type eq "smopt") {
-                        $retval = "../src/Release/";
-                    } else {
-                        $retval = "../src/Debug/";
-                    }
-                }
-
-                $retval .= "jsshell.exe";
-
-            } else {
-                $retval .= $object_dir . "/js";
-                if ($os_type eq "WIN") {
-                    $retval .= ".exe";
-                }
-            }
-        } # mac/ not mac
-
-        $retval = &xp_path($retval);
-
-    } # (user provided a path)
-
-
-    if (($os_type ne "MAC") && !(-x $retval)) {
-        # mac doesn't seem to deal with -x correctly
-        die ($retval . " is not a valid executable on this system.\n");
-    }
-
-    return $retval;
-
-}
-
-#
-# get the shell command used to run epimetheus
-#
-sub get_ep_engine_command {
-    my $retval;
-
-    if ($opt_shell_path) {
-        # if the user provided a path to the shell, return that -
-        $retval = $opt_shell_path;
-
-    } else {
-        my $dir;
-        my $os;
-        my $debug;
-        my $opt;
-        my $exe;
-
-        $dir = $opt_suite_path . "../../js2/src/";
-
-        if ($os_type eq "MAC") {
-            #
-            # On the Mac, the debug and opt builds lie in the same directory -
-            #
-            $os = "macbuild:";
-            $debug = "";
-            $opt = "";
-            $exe = "JS2";
-        } elsif ($os_type eq "WIN") {
-            $os = "winbuild/Epimetheus/";
-            $debug = "Debug/";
-            $opt = "Release/";
-            $exe = "Epimetheus.exe";
-        } else {
-            $os = "";
-            $debug = "";
-            $opt = "";    # <<<----- XXX THIS IS NOT RIGHT! CHANGE IT!
-            $exe = "epimetheus";
-        }
-
-
-        if ($opt_engine_type eq "epdebug") {
-            $retval = $dir . $os . $debug . $exe;
-        } else {
-            $retval = $dir . $os . $opt . $exe;
-        }
-
-        $retval = &xp_path($retval);
-
-    }# (user provided a path)
-
-
-    if (($os_type ne "MAC") && !(-x $retval)) {
-        # mac doesn't seem to deal with -x correctly
-        die ($retval . " is not a valid executable on this system.\n");
-    }
-
-    return $retval;
-}
-
-sub get_os_type {
-
-    if ("\n" eq "\015") {
-        return "MAC";
-    }
-
-    my $uname = `uname -a`;
-
-    if ($uname =~ /WIN/) {
-        $uname = "WIN";
-    } else {
-        chop $uname;
-    }
-
-    &dd ("get_os_type returning '$uname'.");
-    return $uname;
-
-}
-
-sub get_test_list {
-    my @test_list;
-    my @neg_list;
-
-    if ($#opt_test_list_files > -1) {
-        my $list_file;
-
-        &dd ("getting test list from user specified source.");
-
-        foreach $list_file (@opt_test_list_files) {
-            push (@test_list, &expand_user_test_list($list_file));
-        }
-    } else {
-        &dd ("no list file, groveling in '$opt_suite_path'.");
-
-        @test_list = &get_default_test_list($opt_suite_path);
-    }
-
-    if ($#opt_neg_list_files > -1) {
-        my $list_file;
-        my $orig_size = $#test_list + 1;
-        my $actually_skipped;
-
-        &dd ("getting negative list from user specified source.");
-
-        foreach $list_file (@opt_neg_list_files) {
-            push (@neg_list, &expand_user_test_list($list_file));
-        }
-
-        @test_list = &subtract_arrays (\@test_list, \@neg_list);
-
-        $actually_skipped = $orig_size - ($#test_list + 1);
-
-        &dd ($actually_skipped . " of " . $orig_size .
-             " tests will be skipped.");
-        &dd ((($#neg_list + 1) - $actually_skipped) . " skip tests were " .
-             "not actually part of the test list.");
-
-    }
-
-
-    # Don't run any shell.js files as tests; they are only utility files
-    @test_list = grep (!/shell\.js$/, @test_list);
-
-    # Don't run any browser.js files as tests; they are only utility files
-    @test_list = grep (!/browser\.js$/, @test_list);
-
-    # Don't run any jsref.js files as tests; they are only utility files
-    @test_list = grep (!/jsref\.js$/, @test_list);
-
-    return @test_list;
-
-}
-
-#
-# reads $list_file, storing non-comment lines into an array.
-# lines in the form suite_dir/[*] or suite_dir/test_dir/[*] are expanded
-# to include all test files under the specified directory
-#
-sub expand_user_test_list {
-    my ($list_file) = @_;
-    my @retval = ();
-
-    #
-    # Trim off the leading path separator that begins relative paths on the Mac.
-    # Each path will get concatenated with $opt_suite_path, which ends in one.
-    #
-    # Also note:
-    #
-    # We will call expand_test_list_entry(), which does pattern-matching on $list_file.
-    # This will make the pattern-matching the same as it would be on Linux/Windows -
-    #
-    if ($os_type eq "MAC") {
-        $list_file =~ s/^$path_sep//;
-    }
-
-    if ($list_file =~ /\.js$/ || -d $opt_suite_path . $list_file) {
-
-        push (@retval, &expand_test_list_entry($list_file));
-
-    } else {
-
-        open (TESTLIST, $list_file) ||
-          die("Error opening test list file '$list_file': $!\n");
-
-        while (<TESTLIST>) {
-            s/\r*\n*$//;
-            if (!(/\s*\#/)) {
-                # It's not a comment, so process it
-                push (@retval, &expand_test_list_entry($_));
-            }
-        }
-
-        close (TESTLIST);
-
-    }
-
-    return @retval;
-
-}
-
-
-#
-# Currently expect all paths to be RELATIVE to the top-level tests directory.
-# One day, this should be improved to allow absolute paths as well -
-#
-sub expand_test_list_entry {
-    my ($entry) = @_;
-    my @retval;
-
-    if ($entry =~ /\.js$/) {
-        # it's a regular entry, add it to the list
-        if (-f $opt_suite_path . $entry) {
-            push (@retval, $entry);
-        } else {
-            status ("testcase '$entry' not found.");
-        }
-    } elsif ($entry =~ /(.*$path_sep[^\*][^$path_sep]*)$path_sep?\*?$/) {
-        # Entry is in the form suite_dir/test_dir[/*]
-        # so iterate all tests under it
-        my $suite_and_test_dir = $1;
-        my @test_files = &get_js_files ($opt_suite_path .
-                                        $suite_and_test_dir);
-        my $i;
-
-        foreach $i (0 .. $#test_files) {
-            $test_files[$i] = $suite_and_test_dir . $path_sep .
-              $test_files[$i];
-        }
-
-        splice (@retval, $#retval + 1, 0, @test_files);
-
-    } elsif ($entry =~ /([^\*][^$path_sep]*)$path_sep?\*?$/) {
-        # Entry is in the form suite_dir[/*]
-        # so iterate all test dirs and tests under it
-        my $suite = $1;
-        my @test_dirs = &get_subdirs ($opt_suite_path . $suite);
-        my $test_dir;
-
-        foreach $test_dir (@test_dirs) {
-            my @test_files = &get_js_files ($opt_suite_path . $suite .
-                                            $path_sep . $test_dir);
-            my $i;
-
-            foreach $i (0 .. $#test_files) {
-                $test_files[$i] = $suite . $path_sep . $test_dir . $path_sep .
-                  $test_files[$i];
-            }
-
-            splice (@retval, $#retval + 1, 0, @test_files);
-        }
-
-    } else {
-        die ("Don't know what to do with list entry '$entry'.\n");
-    }
-
-    return @retval;
-
-}
-
-#
-# Grovels through $suite_path, searching for *all* test files.  Used when the
-# user doesn't supply a test list.
-#
-sub get_default_test_list {
-    my ($suite_path) = @_;
-    my @suite_list = &get_subdirs($suite_path);
-    my $suite;
-    my @retval;
-
-    foreach $suite (@suite_list) {
-        my @test_dir_list = get_subdirs ($suite_path . $suite);
-        my $test_dir;
-
-        foreach $test_dir (@test_dir_list) {
-            my @test_list = get_js_files ($suite_path . $suite . $path_sep .
-                                          $test_dir);
-            my $test;
-
-            foreach $test (@test_list) {
-                $retval[$#retval + 1] = $suite . $path_sep . $test_dir .
-                  $path_sep . $test;
-            }
-        }
-    }
-
-    return @retval;
-
-}
-
-#
-# generate an output file name based on the date
-#
-sub get_tempfile_name {
-    my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
-      &get_padded_time (localtime);
-    my $rv;
-
-    if ($os_type ne "MAC") {
-        $rv = "results-" . $year . "-" . $mon . "-" . $mday . "-" . $hour .
-          $min . $sec . "-" . $opt_engine_type;
-    } else {
-        $rv = "res-" . $year . $mon . $mday . $hour . $min . $sec . "-" .
-          $opt_engine_type
-    }
-
-    return $rv . ".html";
-}
-
-sub get_padded_time {
-    my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = @_;
-
-    $mon++;
-    $mon = &zero_pad($mon);
-    $year += 1900;
-    $mday= &zero_pad($mday);
-    $sec = &zero_pad($sec);
-    $min = &zero_pad($min);
-    $hour = &zero_pad($hour);
-
-    return ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
-
-}
-
-sub zero_pad {
-    my ($string) = @_;
-
-    $string = ($string < 10) ? "0" . $string : $string;
-    return $string;
-}
-
-sub subtract_arrays {
-    my ($whole_ref, $part_ref) = @_;
-    my @whole = @$whole_ref;
-    my @part = @$part_ref;
-    my $line;
-
-    foreach $line (@part) {
-        @whole = grep (!/$line/, @whole);
-    }
-
-    return @whole;
-
-}
-
-#
-# Convert unix path to mac style.
-#
-sub unix_to_mac {
-    my ($path) = @_;
-    my @path_elements = split ("/", $path);
-    my $rv = "";
-    my $i;
-
-    foreach $i (0 .. $#path_elements) {
-        if ($path_elements[$i] eq ".") {
-            if (!($rv =~ /\:$/)) {
-                $rv .= ":";
-            }
-        } elsif ($path_elements[$i] eq "..") {
-            if (!($rv =~ /\:$/)) {
-                $rv .= "::";
-            } else {
-                $rv .= ":";
-            }
-        } elsif ($path_elements[$i] ne "") {
-            $rv .= $path_elements[$i] . ":";
-        }
-
-    }
-
-    $rv =~ s/\:$//;
-
-    return $rv;
-}
-
-#
-# Convert unix path to win style.
-#
-sub unix_to_win {
-  my ($path) = @_;
-
-  if ($path_sep ne $win_sep) {
-      $path =~ s/$path_sep/$win_sep/g;
-  }
-
-  return $path;
-}
-
-#
-# Windows shells require "/" or "\" as path separator.
-# Find out the one used in the current Windows shell.
-#
-sub get_win_sep {
-  my $path = $ENV{"PATH"} || $ENV{"Path"} || $ENV{"path"};
-  $path =~ /\\|\//;
-  return $&;
-}
-
-#
-# Convert unix path to correct style based on platform.
-#
-sub xp_path {
-    my ($path) = @_;
-
-    if ($os_type eq "MAC") {
-        return &unix_to_mac($path);
-    } elsif($os_type eq "WIN") {
-        return &unix_to_win($path);
-    } else {
-        return $path;
-    }
-}
-
-#
-# given a directory, return an array of all subdirectories
-#
-sub get_subdirs {
-    my ($dir)  = @_;
-    my @subdirs;
-
-    if ($os_type ne "MAC") {
-        if (!($dir =~ /\/$/)) {
-            $dir = $dir . "/";
-        }
-    } else {
-        if (!($dir =~ /\:$/)) {
-            $dir = $dir . ":";
-        }
-    }
-    opendir (DIR, $dir) || die ("couldn't open directory $dir: $!");
-    my @testdir_contents = readdir(DIR);
-    closedir(DIR);
-
-    foreach (@testdir_contents) {
-        if ((-d ($dir . $_)) && ($_ ne 'CVS') && ($_ ne '.') && ($_ ne '..')) {
-            @subdirs[$#subdirs + 1] = $_;
-        }
-    }
-
-    return @subdirs;
-}
-
-#
-# given a directory, return an array of all the js files that are in it.
-#
-sub get_js_files {
-    my ($test_subdir) = @_;
-    my (@js_file_array, @subdir_files);
-
-    opendir (TEST_SUBDIR, $test_subdir) || die ("couldn't open directory " .
-                                                "$test_subdir: $!");
-    @subdir_files = readdir(TEST_SUBDIR);
-    closedir( TEST_SUBDIR );
-
-    foreach (@subdir_files) {
-        if ($_ =~ /\.js$/) {
-            $js_file_array[$#js_file_array+1] = $_;
-        }
-    }
-
-    return @js_file_array;
-}
-
-sub report_failure {
-    my ($test, $message, $bug_number) = @_;
-    my $bug_line = "";
-
-    $failures_reported++;
-
-    $message =~ s/\n+/\n/g;
-    $test =~ s/\:/\//g;
-
-    if ($opt_console_failures) {
-        if ($opt_console_failures_line) {
-            # report_summary_result increments $failures_reported
-            # decrement here to prevent overcounting of failures
-            $failures_reported--;
-            my $linemessage = $message;
-            $linemessage =~ s/[\n\r]+/ /mg;
-            $bug_number = "none" unless $bug_number;
-            &report_summary_result($test, $bug_number, "FAILED", 
-                                   "", 
-                                   "", 
-                                   "",
-                                   $linemessage);
-        } elsif($bug_number) {
-            print STDERR ("*-* Testcase $test failed:\nBug Number $bug_number".
-                          "\n$message\n");
-        } else {
-            print STDERR ("*-* Testcase $test failed:\n$message\n");
-        }
-    }
-
-    $message =~ s/&/&amp;/g;
-    $message =~ s/</&lt;/g;
-    $message =~ s/>/&gt;/g;
-    $message =~ s/\n/<br>\n/g;
-
-    if ($bug_number) {
-        my $bug_url = ($bug_number =~ /^\d+$/) ? "$opt_bug_url$bug_number" : $bug_number;
-        $bug_line = "<a href='$bug_url' target='other_window'>".
-                    "Bug Number $bug_number</a>";
-    }
-
-    if ($opt_lxr_url) {
-        $test =~ /\/?([^\/]+\/[^\/]+\/[^\/]+)$/;
-        $test = $1;
-        $html .= "<dd><b>".
-          "Testcase <a target='other_window' href='$opt_lxr_url$test'>$1</a> " .
-            "failed</b> $bug_line<br>\n";
-    } else {
-        $html .= "<dd><b>".
-          "Testcase $test failed</b> $bug_line<br>\n";
-    }
-
-    $html .= " [ ";
-
-    $html .= "<a href='#tippy_top'>Top of Page</a> ]<br>\n" .
-          "<tt>$message</tt><br>\n";
-
-    @failed_tests[$#failed_tests + 1] = $test;
-
-}
-
-sub dd {
-
-    if ($opt_trace) {
-        print ("-*- ", @_ , "\n");
-    }
-
-}
-
-sub status {
-
-    print ("-#- ", @_ , "\n");
-
-}
-
-sub int_handler {
-    my $resp;
-
-    if ($current_test_pid)
-    {
-        print "User Interrupt: killing process $current_test_pid\n";
-        kill_process($current_test_pid);
-    }
-
-    do {
-        print STDERR ("\n*** User Break: Just [Q]uit, Quit and [R]eport, [C]ontinue ?");
-        $resp = <STDIN>;
-    } until ($resp =~ /[QqRrCc]/);
-
-    if ($resp =~ /[Qq]/) {
-        print ("User Exit.  No results were generated.\n");
-        exit;
-    } elsif ($resp =~ /[Rr]/) {
-        $user_exit = 1;
-    }
-
-}
-
-# XXX: These functions were pulled from
-# lxr.mozilla.org/mozilla/source/tools/tinderbox/build-seamonkey-util.pl
-# need a general reusable library of routines for use in all test programs.
-
-sub kill_process {
-    my ($target_pid) = @_;
-    my $start_time = time;
-
-    # Try to kill and wait 10 seconds, then try a kill -9
-    my $sig;
-    for $sig ('TERM', 'KILL') {
-        print "kill $sig $target_pid\n";
-        kill $sig => $target_pid;
-        my $interval_start = time;
-        while (time - $interval_start < 10) {
-            # the following will work with 'cygwin' perl on win32, but not
-            # with 'MSWin32' (ActiveState) perl
-            my $pid = waitpid($target_pid, POSIX::WNOHANG());
-            if (($pid == $target_pid and POSIX::WIFEXITED($?)) or $pid == -1) {
-                my $secs = time - $start_time;
-                $secs = $secs == 1 ? '1 second' : "$secs seconds";
-                return;
-            }
-            sleep 1;
-        }
-    }
-    die "Unable to kill process: $target_pid";
-}
-
-sub report_summary_result
-{
-    my ($test, $bug_number, $result, $description,
-        $expected, $actual, $reason) = @_;
-
-    $description =~ s/[\n\r]+/ /mg;
-    $expected    =~ s/[\n\r]+/ /mg;
-    $actual      =~ s/[\n\r]+/ /mg;
-    $reason      =~ s/[\n\r]+/ /mg;
-
-    if ($result !~ /PASSED/)
-    {
-        $failures_reported++;
-    }
-
-    print STDERR ("jstest: $test " .
-                  "bug: $bug_number " .
-                  "result: $result " .
-                  "type: shell " . 
-                  "description: $description " .
-                  "expected: $expected " .
-                  "actual: $actual " .
-                  "reason: $reason" .
-                  "\n");
-
-}
deleted file mode 100644
--- a/js/src/tests/runRhinoTests.pl
+++ /dev/null
@@ -1,447 +0,0 @@
-#!/usr/bin/perl5
-#
-# simple script that executes JavaScript tests.  you have to build the
-# stand-alone, js shell executable (which is not the same as the dll that gets
-# built for mozilla).  see the readme at
-# http://lxr.mozilla.org/mozilla/source/js/src/README.html for instructions on
-# how to build the jsshell.
-#
-# this is just a quick-n-dirty script.  for full reporting, you need to run
-# the test driver, which requires java and is currently not available on
-# mozilla.org.
-#
-# this test looks for an executable JavaScript shell in
-# %MOZ_SRC/mozilla/js/src/[platform]-[platform-version]-OPT.OBJ/js,
-# which is the default build location when you build using the instructions
-# at http://lxr.mozilla.org/mozilla/source/js/src/README.html
-#
-#
-# christine@netscape.com
-#
-
-&parse_args;
-&setup_env;
-&main_test_loop;
-&cleanup_env;
-
-#
-# given a main directory, assume that there is a file called 'shell.js'
-# in it.  then, open all the subdirectories, and look for js files.
-# for each test.js that is found, execute the shell, and pass shell.js
-# and the test.js as file arguments.  redirect all process output to a
-# file.
-#
-sub main_test_loop {
-    foreach $suite ( &get_subdirs( $test_dir )) {
-        foreach $subdir (&get_subdirs( $suite, $test_dir )) {
-            @jsfiles = &get_js_files($subdir);
-            execute_js_tests(@jsfiles);
-        }
-    }
-}
-
-#
-# given a directory, return an array of all subdirectories
-#
-sub get_subdirs{
-    local ($dir, $path)  = @_;
-    local @subdirs;
-
-    local $dir_path = $path . $dir;
-    chdir $dir_path;
-
-    opendir ( DIR, ${dir_path} );
-    local @testdir_contents = readdir( DIR );
-    closedir( DIR );
-
-    foreach (@testdir_contents) {
-        if ( (-d $_) && ($_ !~ 'CVS') && ( $_ ne '.') && ($_ ne '..')) {
-            @subdirs[$#subdirs+1] = $_;
-        }
-    }
-    chdir $path;
-    return @subdirs;
-}
-
-#
-# given a directory, return an array of all the js files that are in it.
-#
-sub get_js_files {
-    ( $test_subdir ) = @_;
-    local @js_file_array;
-
-    $current_test_dir = $test_dir  ."/". $suite . "/" .$test_subdir;
-    chdir $current_test_dir;
-
-    opendir ( TEST_SUBDIR, ${current_test_dir} );
-    @subdir_files = readdir( TEST_SUBDIR );
-    closedir( TOP_LEVEL_BUILD_DIR );
-
-    foreach ( @subdir_files ) {
-        if ( $_ =~ /\.js$/ ) {
-            $js_file_array[$#js_file_array+1] = $_;
-        }
-    }
-
-    return @js_file_array;
-}
-
-#
-# given an array of test.js files, execute the shell command and pass
-# the shell.js and test.js files as file arguments.  redirect process
-# output to a file.  if $js_verbose is set (not recommended), write all
-# testcase output to the output file.  if $js_quiet is set, only write
-# failed test case information to the output file.  the default setting
-# is to write a line for each test file, and whether each file passed
-# or failed.
-#
-sub execute_js_tests {
-    (@js_file_array) = @_;
-
-    $js_printed_suitename = 0;
-    if ( !$js_quiet ) {
-        &js_print_suitename;
-    }
-
-    foreach $js_test (@js_file_array) {
-        $js_printed_filename = 0;
-        $js_test_bugnumber = 0;
-        $runtime_error = "";
-
-        local $passed = -1;
-
-        # create the test command
-        $test_command =
-            $shell_command .
-            " -f $test_dir/$suite/shell.js " .
-            " $test_dir/$suite/$subdir/$js_test";
-
-        if ( !$js_quiet ) {
-            &js_print_filename;
-        } else {
-            print '.';
-        }
-
-        $test_path = $test_dir ."/" . $suite ."/". $test_subdir ."/". $js_test;
-
-	local $log = "";
-
-        if ( !-e $test_path ) {
-            &js_print( " FAILED! file not found\n",
-                "<font color=#990000>", "</font><br>\n");
-        } else {
-            open( RUNNING_TEST,  "$test_command" . ' 2>&1 |');
-
-        	while( <RUNNING_TEST> ){
-		$log .= $_;
-    	        if ( $js_verbose && !$js_quiet ) {
-    	            &js_print ($_ ."\n", "", "<br>\n");
-                }
-                if ( $_ =~ /PASSED/ && $passed == -1) {
-                    $passed = 1;
-                }
-                if ( $_ =~ /BUGNUMBER/ ) {
-                    $js_test_bugnumber = $_;
-                }
-                if ( $_ =~ /FAILED/ && $_ =~ /expected/) {
-                    &js_print_suitename;
-                    &js_print_filename;
-                    &js_print_bugnumber;
-
-                    local @msg = split ( "FAILED", $_ );
-                    &js_print ( $passed ? "\n" : "" );
-                    &js_print( "    " . $msg[0], "&nbsp;&nbsp;<tt>" );
-                    &js_print( "FAILED", "<font color=#990000>", "</font>");
-                    &js_print( $msg[1], "", "</tt><br>\n" );
-                    $passed = 0;
-                }
-                if ( $_ =~ /$js_test/ ) {
-                    $runtime_error .= $_;
-                }
-    	    }
-    	    close( RUNNING_TEST );
-
-            #
-            # figure out whether the test passed or failed.  print out an
-            # appropriate level of output based on the value of $js_quiet
-            #
-            if ( $js_test =~ /-n\.js$/ ) {
-                if ( $runtime_error ) {
-                    if ( !$js_quiet ) {
-                        &js_print( " PASSED!\n ",
-                            "<font color=#009900>&nbsp;&nbsp",
-                            "</font><br>" );
-                        if ( $js_errors ) {
-                            &js_print( $runtime_error, "<pre>", "</pre>");
-                        }
-                    }
-                } else {
-                    &js_print_suitename;
-                    &js_print_filename;
-                    &js_print_bugnumber;
-                    &js_print( " FAILED! ", "&nbsp;&nbsp;<font color=#990000>",
-                        "</font>");
-                    &js_print( " Should have resulted in an error\n",
-                        "","<br>" );
-                }
-            } else {
-                if ( $passed == 1 && !$js_quiet) {
-                    &js_print( " PASSED!\n " , "&nbsp;&nbsp;<font color=#009900>",
-                        "</font><br>" );
-                } else {
-                    if ($passed == -1) {
-                        &js_print_suitename;
-                        &js_print_filename;
-                        &js_print_bugnumber;
-                        &js_print( " FAILED!\n " , "&nbsp;&nbsp;<font color=#990000>",
-                            "</font><br>" );
-                        &js_print( " Missing 'PASSED' in output\n", "","<br>" );
-			&js_print( $log, "output:<br><pre>", "</pre>" );
-                    }
-                }
-            }
-        }
-    }
-}
-
-#
-# figure out what os we're on, the default name of the object directory
-#
-sub setup_env {
-    # MOZ_SRC must be set, so we can figure out where the
-    # JavaScript executable is
-    $moz_src = $ENV{"MOZ_SRC"}
-        || die( "You need to set your MOZ_SRC environment variable.\n" );
-    $src_dir = $moz_src . '/mozilla/js/src/';
-
-    # JS_TEST_DIR must be set so we can figure out where the tests are.
-    $test_dir = $ENV{"JS_TEST_DIR"};
-
-    # if it's not set, look for it relative to $moz_src
-    if ( !test_dir ) {
-        $test_dir = $moz_src . '/mozilla/js/tests/';
-    }
-
-    # make sure that the test dir exists
-    if ( ! -e $test_dir ) {
-        die "The JavaScript Test Library could not be found.\n" .
-            "Check the tests out from /mozilla/js/tests or\n" .
-            "Set the value of your JS_TEST_DIR environment variable\n " .
-            "to the location of the test library.\n";
-    }
-
-    # make sure that the test dir ends with a trailing slash
-    $test_dir .= '/';
-
-    chdir $src_dir;
-
-    $shell_command = "java";
-    if ($js_classpath) {
-        $shell_command .= " -classpath " . $js_classpath;
-    }
-    $shell_command .= " org.mozilla.javascript.tools.shell.Main ";
-
-    # set the output file name.  let's base its name on the date and platform,
-    # and give it a sequence number.
-
-    if ( $get_output ) {
-        $js_output = &get_output;
-    }
-    if ($js_output) {
-        print( "Writing results to $js_output\n" );
-        chdir $test_dir;
-        open( JS_OUTPUT, "> ${js_output}" ) ||
-            die "Can't open log file $js_output\n";
-        close JS_OUTPUT;
-    }
-
-    # get the start time
-    $start_time = time;
-
-    # print out some nice stuff
-    $start_date = &get_date;
-    &js_print( "JavaScript tests started: " . $start_date, "<p><tt>", "</tt></p>" );
-
-    &js_print ("Executing all the tests under $test_dir\n against " .
-        "$shell_command\n", "<p><tt>", "</tt></p>" );
-}
-
-#
-# parse arguments.  see usage for what arguments are expected.
-#
-sub parse_args {
-    $i = 0;
-    while( $i < @ARGV ){
-        if ( $ARGV[$i] eq '--threaded' ) {
-            $js_threaded = 1;
-        } elsif ( $ARGV[$i] eq '--d' ) {
-            $js_debug = 1;
-        } elsif ( $ARGV[$i] eq '--14' ) {
-            $js_version = '14';
-        } elsif ( $ARGV[$i] eq '--v' ) {
-            $js_verbose = 1;
-        } elsif ( $ARGV[$i] eq '-f' ) {
-            $js_output = $ARGV[++$i];
-        } elsif ( $ARGV[$i] eq '-c' ) {
-            $js_classpath = $ARGV[++$i];
-        } elsif ( $ARGV[$i] eq '--o' ) {
-            $get_output = 1;
-        } elsif ($ARGV[$i] eq '--e' ) {
-            $js_errors = 1;
-        } elsif ($ARGV[$i] eq '--q' ) {
-            $js_quiet = 1;
-        } elsif ($ARGV[$i] eq '--h' ) {
-            die &usage;
-        } elsif ( $ARGV[$i] eq '-E' ) {
-            $js_exe_full_path = $ARGV[$i+1];
-            $i++;
-        } else {
-            die &usage;
-        }
-        $i++;
-    }
-
-    #
-    # if no output options are provided, show some output and write to file
-    #
-    if ( !$js_verbose && !$js_output && !$get_output ) {
-        $get_output = 1;
-    }
-}
-
-#
-# print the arguments that this script expects
-#
-sub usage {
-    die ("usage: $0\n" .
-        "--q       Quiet mode -- only show information for tests that failed\n".
-        "--e       Show runtime error messages for negative tests\n" .
-        "--v       Verbose output -- show all test cases (not recommended)\n" .
-        "--o       Send output to file whose generated name is based on date\n".
-        "--d       Look for a debug JavaScript executable (default is optimized)\n" .
-        "-f <file> Redirect output to file named <file>\n"
-        );
-}
-
-#
-# if $js_output is set, print to file as well as stdout
-#
-sub js_print {
-    ($string, $start_tag, $end_tag) = @_;
-
-    if ($js_output) {
-        open( JS_OUTPUT, ">> ${js_output}" ) ||
-            die "Can't open log file $js_output\n";
-
-        print JS_OUTPUT "$start_tag $string $end_tag";
-        close JS_OUTPUT;
-    }
-    print $string;
-}
-
-#
-# close open files
-#
-sub cleanup_env {
-    # print out some nice stuff
-    $end_date = &get_date;
-    &js_print( "\nTests complete at $end_date", "<hr><tt>", "</tt>" );
-
-    # print out how long it took to complete
-    $end_time = time;
-
-    $test_seconds = ( $end_time - $start_time );
-
-    &js_print( "Start Date: $start_date\n", "<tt><br>" );
-    &js_print( "End Date:   $end_date\n", "<br>" );
-    &js_print( "Test Time:  $test_seconds seconds\n", "<br>" );
-
-    if ($js_output ) {
-        if ( !$js_verbose) {
-            &js_print( "Results were written to " . $js_output ."\n",
-                "<br>", "</tt>" );
-        }
-        close JS_OUTPUT;
-    }
-}
-
-
-#
-# get the current date and time
-#
-sub get_date {
-    &get_localtime;
-    $now = $year ."/". $mon ."/". $mday ." ". $hour .":".
-        $min .":". $sec ."\n";
-    return $now;
-
-}
-sub get_localtime {
-    ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
-        localtime;
-    $mon++;
-    $mon = &zero_pad($mon);
-    $year= ($year < 2000) ? "19" . $year : $year;
-    $mday= &zero_pad($mday);
-    $sec = &zero_pad($sec);
-    $min = &zero_pad($min);
-    $hour = &zero_pad($hour);
-}
-sub zero_pad {
-    local ($string) = @_;
-    $string = ($string < 10) ? "0" . $string : $string;
-    return $string;
-}
-
-#
-# generate an output file name based on the date
-#
-sub get_output {
-    &get_localtime;
-
-    chdir $test_dir;
-
-    $js_output = $test_dir ."/". $year .'-'. $mon .'-'. $mday ."\.1.html";
-
-    $output_file_found = 0;
-
-    while ( !$output_file_found ) {
-        if ( -e $js_output ) {
-        # get the last sequence number - everything after the dot
-            @seq_no = split( /\./, $js_output, 2 );
-            $js_output = $seq_no[0] .".". (++$seq_no[1]) . "\.html";
-        } else {
-            $output_file_found = 1;
-        }
-    }
-    return $js_output;
-}
-
-sub js_print_suitename {
-    if ( !$js_printed_suitename ) {
-        &js_print( "$suite\\$subdir\n", "<hr><font size+=1><b>",
-            "</font></b><br>" );
-    }
-    $js_printed_suitename = 1;
-}
-
-sub js_print_filename {
-    if ( !$js_printed_filename ) {
-        &js_print( "$js_test\n", "<b>", "</b>" );
-        $js_printed_filename = 1;
-    }
-}
-
-sub js_print_bugnumber {
-    if ( !$js_printed_bugnumber ) {
-        if ( $js_bugnumber =~ /^http/ ) {
-            &js_print( "$js_bugnumber", "<a href=$js_bugnumber>", "</a>" );
-        } else {
-            &js_print( "$js_bugnumber",
-                "<a href=http://scopus.mcom.com/bugsplat/show_bug.cgi?id=" .
-                    $js_bugnumber .">",
-                "</a>" );
-        }
-        $js_printed_bugnumber = 1;
-    }
-}
deleted file mode 100644
--- a/js/src/tests/runtests.pl
+++ /dev/null
@@ -1,495 +0,0 @@
-#!/usr/bin/perl5
-#
-# simple script that executes JavaScript tests.  you have to build the
-# stand-alone, js shell executable (which is not the same as the dll that gets
-# built for mozilla).  see the readme at
-# http://lxr.mozilla.org/mozilla/source/js/src/README.html for instructions on
-# how to build the jsshell.
-#
-# this is just a quick-n-dirty script.  for full reporting, you need to run
-# the test driver, which requires java and is currently not available on
-# mozilla.org.
-#
-# this test looks for an executable JavaScript shell in
-# %MOZ_SRC/mozilla/js/src/[platform]-[platform-version]-OPT.OBJ/js,
-# which is the default build location when you build using the instructions
-# at http://lxr.mozilla.org/mozilla/source/js/src/README.html
-#
-#
-# christine@netscape.com
-#
-
-&parse_args;
-&setup_env;
-&main_test_loop;
-&cleanup_env;
-
-#
-# given a main directory, assume that there is a file called 'shell.js'
-# in it.  then, open all the subdirectories, and look for js files.
-# for each test.js that is found, execute the shell, and pass shell.js
-# and the test.js as file arguments.  redirect all process output to a
-# file.
-#
-sub main_test_loop {
-    foreach $suite ( &get_subdirs( $test_dir )) {
-        foreach $subdir (&get_subdirs( $suite, $test_dir )) {
-            @jsfiles = &get_js_files($subdir);
-            execute_js_tests(@jsfiles);
-        }
-    }
-}
-
-#
-# given a directory, return an array of all subdirectories
-#
-sub get_subdirs{
-    local ($dir, $path)  = @_;
-    local @subdirs;
-
-    local $dir_path = $path . $dir;
-    chdir $dir_path;
-
-    opendir ( DIR, ${dir_path} );
-    local @testdir_contents = readdir( DIR );
-    closedir( DIR );
-
-    foreach (@testdir_contents) {
-        if ( (-d $_) && ($_ !~ 'CVS') && ( $_ ne '.') && ($_ ne '..')) {
-            @subdirs[$#subdirs+1] = $_;
-        }
-    }
-    chdir $path;
-    return @subdirs;
-}
-
-#
-# given a directory, return an array of all the js files that are in it.
-#
-sub get_js_files {
-    ( $test_subdir ) = @_;
-    local @js_file_array;
-
-    $current_test_dir = $test_dir  ."/". $suite . "/" .$test_subdir;
-    chdir $current_test_dir;
-
-    opendir ( TEST_SUBDIR, ${current_test_dir} );
-    @subdir_files = readdir( TEST_SUBDIR );
-    closedir( TOP_LEVEL_BUILD_DIR );
-
-    foreach ( @subdir_files ) {
-        if ( $_ =~ /\.js$/ ) {
-            $js_file_array[$#js_file_array+1] = $_;
-        }
-    }
-
-    return @js_file_array;
-}
-
-#
-# given an array of test.js files, execute the shell command and pass
-# the shell.js and test.js files as file arguments.  redirect process
-# output to a file.  if $js_verbose is set (not recommended), write all
-# testcase output to the output file.  if $js_quiet is set, only write
-# failed test case information to the output file.  the default setting
-# is to write a line for each test file, and whether each file passed
-# or failed.
-#
-sub execute_js_tests {
-    (@js_file_array) = @_;
-
-    $js_printed_suitename = 0;
-    if ( !$js_quiet ) {
-        &js_print_suitename;
-    }
-
-    foreach $js_test (@js_file_array) {
-        $js_printed_filename = 0;
-        $js_test_bugnumber = 0;
-        $runtime_error = "";
-
-        local $passed = -1;
-
-        # create the test command
-        $test_command =
-            $shell_command .
-            " -f $test_dir/$suite/shell.js " .
-            " -f $test_dir/$suite/$subdir/$js_test";
-
-        if ( !$js_quiet ) {
-            &js_print_filename;
-        } else {
-            print '.';
-        }
-
-        $test_path = $test_dir ."/" . $suite ."/". $test_subdir ."/". $js_test;
-
-
-        if ( !-e $test_path ) {
-            &js_print( " FAILED! file not found\n",
-                "<font color=#990000>", "</font><br>\n");
-        } else {
-            open( RUNNING_TEST,  "$test_command" . ' 2>&1 |');
-
-
-			# this is where we want the tests to provide a lot more information
-			# that this script must parse so that we can 
-
-        	while( <RUNNING_TEST> ){
-    	        if ( $js_verbose && !$js_quiet ) {
-    	            &js_print ($_ ."\n", "", "<br>\n");
-                }
-                if ( $_ =~ /BUGNUMBER/ ) {
-                    $js_test_bugnumber = $_;
-                }
-				if ( $_ =~ /PASSED/ && $passed == -1 ) {
-					$passed = 1;
-				}
-                if ( $_ =~ /FAILED/ && $_ =~ /expected/) {
-                    &js_print_suitename;
-                    &js_print_filename;
-                    &js_print_bugnumber;
-
-                    local @msg = split ( "FAILED", $_ );
-                    &js_print ( $passed ? "\n" : "" );
-                    &js_print( "    " . $msg[0], "&nbsp;&nbsp;<tt>" );
-                    &js_print( "FAILED", "<font color=#990000>", "</font>");
-                    &js_print( $msg[1], "", "</tt><br>\n" );
-                    $passed = 0;
-                }
-                if ( $_ =~ /$js_test/ ) {
-                    $runtime_error .= $_;
-                }
-    	    }
-    	    close( RUNNING_TEST );
-
-            #
-            # figure out whether the test passed or failed.  print out an
-            # appropriate level of output based on the value of $js_quiet
-            #
-            if ( $js_test =~ /-n\.js$/ ) {
-                if ( $runtime_error ) {
-                    if ( !$js_quiet ) {
-                        &js_print( " PASSED!\n ",
-                            "<font color=#009900>&nbsp;&nbsp",
-                            "</font><br>" );
-                        if ( $js_errors ) {
-                            &js_print( $runtime_error, "<pre>", "</pre>");
-                        }
-                    }
-                } else {
-                    &js_print_suitename;
-                    &js_print_filename;
-                    &js_print_bugnumber;
-                    &js_print( " FAILED! ", "&nbsp;&nbsp;<font color=#990000>",
-                        "</font>");
-                    &js_print( " Should have resulted in an error\n",
-                        "","<br>" );
-                }
-            } else {
-                if ( $passed == 1 && !$js_quiet) {
-                    &js_print( " PASSED!\n " , "&nbsp;&nbsp;<font color=#009900>",
-                        "</font><br>" );
-                } else {
-					if ($passed == -1) {
-						&js_print_suitename;
-						&js_print_filename;
-						&js_print_bugnumber;
-						&js_print( " FAILED!\n " , "&nbsp;&nbsp;<font color=#990000>",
-						"</font><br>" );
-						&js_print( " Missing 'PASSED' in output\n", "","<br>" );
-						&js_print( $log, "output:<br><pre>", "</pre>" );
-                     }
-				}					
-
-            }
-        }
-    }
-}
-
-#
-# figure out what os we're on, the default name of the object directory
-#
-sub setup_env {
-    # MOZ_SRC must be set, so we can figure out where the
-    # JavaScript executable is
-    $moz_src = $ENV{"MOZ_SRC"}
-        || die( "You need to set your MOZ_SRC environment variable.\n" );
-    $src_dir = $moz_src . '/mozilla/js/src/';
-
-    # JS_TEST_DIR must be set so we can figure out where the tests are.
-    $test_dir = $ENV{"JS_TEST_DIR"};
-
-    # if it's not set, look for it relative to $moz_src
-    if ( !$test_dir ) {
-        $test_dir = $moz_src . '/mozilla/js/tests/';
-    }
-
-    # make sure that the test dir exists
-    if ( ! -e $test_dir ) {
-        die "The JavaScript Test Library could not be found at $test_dir.\n" .
-            "Check the tests out from /mozilla/js/tests or\n" .
-            "Set the value of your JS_TEST_DIR environment variable\n " .
-            "to the location of the test library.\n";
-    }
-
-    # make sure that the test dir ends with a trailing slash
-    $test_dir .= '/';
-
-    chdir $src_dir;
-
-    # figure out which platform we're on, and figure out where the object
-    # directory is
-
-    $machine_os = `uname -s`;
-
-    if ( $machine_os =~ /WIN/ ) {
-        $machine_os = 'WIN';
-        $object_dir = ($js_debug) ? 'Debug' : 'Release';
-        $js_exe = 'jsshell.exe';
-    } else {
-        chop $machine_os;
-        $js_exe = 'js';
-
-        # figure out what the object directory is.  on all platforms,
-        # it's the directory that ends in OBJ.  if $js_debug is set,
-        # look the directory that ends with or DBG.OBJ; otherwise
-        # look for the directory that ends with OPT.OBJ
-
-        opendir ( SRC_DIR_FILES, $src_dir );
-        @src_dir_files = readdir( SRC_DIR_FILES );
-        closedir ( SRC_DIR_FILES );
-
-        $object_pattern = $js_debug ? 'DBG.OBJ' : 'OPT.OBJ';
-
-        foreach (@src_dir_files) {
-            if ( $_ =~ /$object_pattern/ && $_ =~ $machine_os) {
-                $object_dir = $_;
-            }
-        }
-    }
-    if ( ! $object_dir ) {
-        die( "Couldn't find an object directory in $src_dir.\n" );
-    }
-
-    # figure out what the name of the javascript executable should be, and
-    # make sure it's there.  if it's not there, give a helpful message so
-    # the user can figure out what they need to do next.
-
-
-    if ( ! $js_exe_full_path ) {
-        $shell_command = $src_dir . $object_dir .'/'. $js_exe;
-    } else {
-        $shell_command = $js_exe_full_path;
-    }
-
-    if ( !-e $shell_command ) {
-        die ("Could not find JavaScript shell executable $shell_command.\n" .
-            "Check the value of your MOZ_SRC environment variable.\n" .
-            "Currently, MOZ_SRC is set to $ENV{\"MOZ_SRC\"}\n".
-            "See the readme at http://lxr.mozilla.org/mozilla/src/js/src/ " .
-            "for instructions on building the JavaScript shell.\n" );
-    }
-
-    # set the output file name.  let's base its name on the date and platform,
-    # and give it a sequence number.
-
-    if ( $get_output ) {
-        $js_output = &get_output;
-    }
-    if ($js_output) {
-        print( "Writing results to $js_output\n" );
-        chdir $test_dir;
-        open( JS_OUTPUT, "> ${js_output}" ) ||
-            die "Can't open log file $js_output\n";
-        close JS_OUTPUT;
-    }
-
-    # get the start time
-    $start_time = time;
-
-    # print out some nice stuff
-    $start_date = &get_date;
-    &js_print( "JavaScript tests started: " . $start_date, "<p><tt>", "</tt></p>" );
-
-    &js_print ("Executing all the tests under $test_dir\n against " .
-        "$shell_command\n", "<p><tt>", "</tt></p>" );
-}
-
-#
-# parse arguments.  see usage for what arguments are expected.
-#
-sub parse_args {
-    $i = 0;
-    while( $i < @ARGV ){
-        if ( $ARGV[$i] eq '--threaded' ) {
-            $js_threaded = 1;
-        } elsif ( $ARGV[$i] eq '--d' ) {
-            $js_debug = 1;
-        } elsif ( $ARGV[$i] eq '--14' ) {
-            $js_version = '14';
-        } elsif ( $ARGV[$i] eq '--v' ) {
-            $js_verbose = 1;
-        } elsif ( $ARGV[$i] eq '-f' ) {
-            $js_output = $ARGV[++$i];
-        } elsif ( $ARGV[$i] eq '--o' ) {
-            $get_output = 1;
-        } elsif ($ARGV[$i] eq '--e' ) {
-            $js_errors = 1;
-        } elsif ($ARGV[$i] eq '--q' ) {
-            $js_quiet = 1;
-        } elsif ($ARGV[$i] eq '--h' ) {
-            die &usage;
-        } elsif ( $ARGV[$i] eq '-E' ) {
-            $js_exe_full_path = $ARGV[$i+1];
-            $i++;
-        } else {
-            die &usage;
-        }
-        $i++;
-    }
-
-    #
-    # if no output options are provided, show some output and write to file
-    #
-    if ( !$js_verbose && !$js_output && !$get_output ) {
-        $get_output = 1;
-    }
-}
-
-#
-# print the arguments that this script expects
-#
-sub usage {
-    die ("usage: $0\n" .
-        "--q       Quiet mode -- only show information for tests that failed\n".
-        "--e       Show runtime error messages for negative tests\n" .
-        "--v       Verbose output -- show all test cases (not recommended)\n" .
-        "--o       Send output to file whose generated name is based on date\n".
-        "--d       Look for a debug JavaScript executable (default is optimized)\n" .
-        "-f <file> Redirect output to file named <file>\n"
-        );
-}
-
-#
-# if $js_output is set, print to file as well as stdout
-#
-sub js_print {
-    ($string, $start_tag, $end_tag) = @_;
-
-    if ($js_output) {
-        open( JS_OUTPUT, ">> ${js_output}" ) ||
-            die "Can't open log file $js_output\n";
-
-        print JS_OUTPUT "$start_tag $string $end_tag";
-        close JS_OUTPUT;
-    }
-    print $string;
-}
-
-#
-# close open files
-#
-sub cleanup_env {
-    # print out some nice stuff
-    $end_date = &get_date;
-    &js_print( "\nTests complete at $end_date", "<hr><tt>", "</tt>" );
-
-    # print out how long it took to complete
-    $end_time = time;
-
-    $test_seconds = ( $end_time - $start_time );
-
-    &js_print( "Start Date: $start_date\n", "<tt><br>" );
-    &js_print( "End Date:   $end_date\n", "<br>" );
-    &js_print( "Test Time:  $test_seconds seconds\n", "<br>" );
-
-    if ($js_output ) {
-        if ( !$js_verbose) {
-            &js_print( "Results were written to " . $js_output ."\n",
-                "<br>", "</tt>" );
-        }
-        close JS_OUTPUT;
-    }
-}
-
-
-#
-# get the current date and time
-#
-sub get_date {
-    &get_localtime;
-    $now = $year ."/". $mon ."/". $mday ." ". $hour .":".
-        $min .":". $sec ."\n";
-    return $now;
-
-}
-sub get_localtime {
-    ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
-        localtime;
-    $mon++;
-    $mon = &zero_pad($mon);
-    $year= ($year < 2000) ? "19" . $year : $year;
-    $mday= &zero_pad($mday);
-    $sec = &zero_pad($sec);
-    $min = &zero_pad($min);
-    $hour = &zero_pad($hour);
-}
-sub zero_pad {
-    local ($string) = @_;
-    $string = ($string < 10) ? "0" . $string : $string;
-    return $string;
-}
-
-#
-# generate an output file name based on the date
-#
-sub get_output {
-    &get_localtime;
-
-    chdir $test_dir;
-
-    $js_output = $test_dir ."/". $year .'-'. $mon .'-'. $mday ."\.1.html";
-
-    $output_file_found = 0;
-
-    while ( !$output_file_found ) {
-        if ( -e $js_output ) {
-        # get the last sequence number - everything after the dot
-            @seq_no = split( /\./, $js_output, 2 );
-            $js_output = $seq_no[0] .".". (++$seq_no[1]) . "\.html";
-        } else {
-            $output_file_found = 1;
-        }
-    }
-    return $js_output;
-}
-
-sub js_print_suitename {
-    if ( !$js_printed_suitename ) {
-        &js_print( "$suite\\$subdir\n", "<hr><font size+=1><b>",
-            "</font></b><br>" );
-    }
-    $js_printed_suitename = 1;
-}
-
-sub js_print_filename {
-    if ( !$js_printed_filename ) {
-        &js_print( "$js_test\n", "<b>", "</b><br>" );
-        $js_printed_filename = 1;
-    }
-}
-
-sub js_print_bugnumber {
-    if ( !$js_printed_bugnumber ) {
-        if ( $js_bugnumber =~ /^http/ ) {
-            &js_print( "$js_bugnumber", "<a href=$js_bugnumber>", "</a>" );
-        } else {
-            &js_print( "$js_bugnumber",
-                "<a href=http://scopus.mcom.com/bugsplat/show_bug.cgi?id=" .
-                    $js_bugnumber .">",
-                "</a>" );
-        }
-        $js_printed_bugnumber = 1;
-    }
-}
deleted file mode 100755
--- a/js/src/tests/runtests2.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-
-print ("This is no longer the test driver, please use jsDriver.pl instead.");
-