Bug 351968 - Don't copy xpcshell tests and other data to $(DIST) -- a step toward being able to --enable-tests on Mozilla tinderboxen. r=bsmedberg
git-svn-id: svn://10.0.0.236/trunk@219219 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -49,33 +49,6 @@ XPIDLSRCS = \
|
||||
nsIHttpServer.idl \
|
||||
$(NULL)
|
||||
|
||||
XPCSHELL_TESTS = test
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_UNIT_FILES := $(wildcard $(srcdir)/test/*.js)
|
||||
|
||||
_SERVER_SCRIPT_FILES = \
|
||||
httpd.js \
|
||||
$(NULL)
|
||||
|
||||
# copy the server to the xpcshell test harness directory
|
||||
libs:: $(_SERVER_SCRIPT_FILES)
|
||||
$(INSTALL) $^ $(DIST)/bin/test-harness/xpcshell-simple
|
||||
|
||||
#
|
||||
# Server tests don't go in with necko's tests because:
|
||||
#
|
||||
# - we then have to think about file name conflicts in two different locations
|
||||
# - head_*.js files in separate locations are both run, even when this is not
|
||||
# desired (e.g., we must either always import httpd.js [slowing down test
|
||||
# processing even for tests which don't need it] or we must manually import
|
||||
# it in every test that uses it [which would be extremely annoying for the
|
||||
# server tests which all want it])
|
||||
# - httpd.js doesn't clutter the global scope too much, but it does become a
|
||||
# concern (consider Cc/Ci/Cr in particular, which as constants cannot be
|
||||
# safely redefined)
|
||||
#
|
||||
libs:: $(_UNIT_FILES)
|
||||
$(INSTALL) $^ $(DIST)/bin/httpserver_tests
|
||||
|
||||
check::
|
||||
$(RUN_TEST_PROGRAM) $(DIST)/bin/test_all.sh $(DIST)/bin/httpserver_tests
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
do_import_script("test-harness/xpcshell-simple/httpd.js");
|
||||
do_import_script("netwerk/test/httpserver/httpd.js");
|
||||
|
||||
/**
|
||||
* Constructs a new nsHttpServer instance. This function is intended to
|
||||
|
||||
@@ -173,15 +173,11 @@ var listener =
|
||||
},
|
||||
onStopRequest: function(request, cx, status)
|
||||
{
|
||||
var dirServ;
|
||||
switch (currPathIndex)
|
||||
{
|
||||
case 0:
|
||||
// now set a base path
|
||||
dirServ = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties);
|
||||
serverBasePath = dirServ.get("CurProcD", Ci.nsILocalFile);
|
||||
serverBasePath.append("httpserver_tests");
|
||||
serverBasePath = testsDirectory.clone();
|
||||
srv.registerDirectory("/", serverBasePath);
|
||||
break;
|
||||
|
||||
@@ -204,10 +200,7 @@ var listener =
|
||||
|
||||
case 5:
|
||||
// set the base path again
|
||||
dirServ = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties);
|
||||
serverBasePath = dirServ.get("CurProcD", Ci.nsILocalFile);
|
||||
serverBasePath.append("httpserver_tests");
|
||||
serverBasePath = testsDirectory.clone();
|
||||
srv.registerDirectory("/", serverBasePath);
|
||||
break;
|
||||
|
||||
@@ -230,10 +223,7 @@ var listener =
|
||||
|
||||
case 9:
|
||||
// register /foo/ as a base path
|
||||
dirServ = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties);
|
||||
serverBasePath = dirServ.get("CurProcD", Ci.nsILocalFile);
|
||||
serverBasePath.append("httpserver_tests");
|
||||
serverBasePath = testsDirectory.clone();
|
||||
srv.registerDirectory("/foo/", serverBasePath);
|
||||
break;
|
||||
|
||||
@@ -292,9 +282,18 @@ function performNextTest()
|
||||
|
||||
var srv;
|
||||
var serverBasePath;
|
||||
var testsDirectory;
|
||||
|
||||
function run_test()
|
||||
{
|
||||
testsDirectory = Cc["@mozilla.org/file/local;1"]
|
||||
.createInstance(Ci.nsILocalFile);
|
||||
testsDirectory.initWithPath(do_get_topsrcdir());
|
||||
testsDirectory.append("netwerk");
|
||||
testsDirectory.append("test");
|
||||
testsDirectory.append("httpserver");
|
||||
testsDirectory.append("test");
|
||||
|
||||
srv = createServer();
|
||||
srv.start(4444);
|
||||
|
||||
|
||||
@@ -104,10 +104,14 @@ var srv, serverBasePath;
|
||||
function run_test()
|
||||
{
|
||||
srv = createServer();
|
||||
var dirServ = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties);
|
||||
serverBasePath = dirServ.get("CurProcD", Ci.nsILocalFile);
|
||||
serverBasePath.append("httpserver_tests");
|
||||
serverBasePath = Cc["@mozilla.org/file/local;1"]
|
||||
.createInstance(Ci.nsILocalFile);
|
||||
serverBasePath.initWithPath(do_get_topsrcdir());
|
||||
serverBasePath.append("netwerk");
|
||||
serverBasePath.append("test");
|
||||
serverBasePath.append("httpserver");
|
||||
serverBasePath.append("test");
|
||||
serverBasePath.QueryInterface(Ci.nsIFile);
|
||||
srv.registerDirectory("/", serverBasePath);
|
||||
srv.setIndexHandler(myIndexHandler);
|
||||
srv.start(4444);
|
||||
|
||||
Reference in New Issue
Block a user