Closed Bug 384502 Opened 17 years ago Closed 17 years ago

ability to start runtests.pl in a certain directory

Categories

(Testing :: Mochitest, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: myk, Assigned: myk)

Details

Attachments

(1 file)

Right now the instructions in the MochiTest FAQ on devmo say that to run one test you should "skip the --autorun argument, and then click on the test you want to run."  But finding the test in the list every time you want to run it can be painful, especially if you're doing it over and over again as you develop a set of tests.

It should be possible to specify a test path (either to a specific test or to a directory of them) on the command line and go directly to that path when the application starts.  Here's a patch that does this.

Besides adding the command-line parameter, I also fixed what I think is a bug in server.js where it appends a slash to a directory name if necessary but then appends a child filename to the slashless version.  This makes it possible to specify --test-path=foo/bar (<-- no slash at the end), where bar is a directory containing tests, and have the links on the page of tests still work.
Attachment #268434 - Flags: review?(sayrer)
Attachment #268434 - Flags: review?(sayrer) → review+
(In reply to comment #0)
> Besides adding the command-line parameter, I also fixed what I think is a bug
> in server.js where it appends a slash to a directory name if necessary but then
> appends a child filename to the slashless version.  This makes it possible to
> specify --test-path=foo/bar (<-- no slash at the end), where bar is a directory
> containing tests, and have the links on the page of tests still work.

That's a nice hackaround in the index generator to make the links work, but it's more a bug in the server that for /foo it serves the same content as for /foo/; the server really should respond with a redirect to /foo/ instead.  One of these days I'll get around to fixing it.
Checked in to trunk:

Checking in runtests.pl.in;
/cvsroot/mozilla/testing/mochitest/runtests.pl.in,v  <--  runtests.pl.in
new revision: 1.20; previous revision: 1.19
done
Checking in server.js;
/cvsroot/mozilla/testing/mochitest/server.js,v  <--  server.js
new revision: 1.9; previous revision: 1.8
done

I also updated the MochiTest FAQ entry "How do I run just one test?" with info on using the new command line flag to run a single test or a group of tests:

http://developer.mozilla.org/en/docs/Mochitest#How_do_I_run_just_one_test_or_group_of_tests.3F
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Component: Testing → Mochitest
Product: Core → Testing
QA Contact: testing → mochitest
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: