Bug 414532 - "Mochitest broken on Cygwin" [p=honzab@allpeers.com (Honza Bambas) r=Waldo (test-only stuff)]

This commit is contained in:
reed@reedloden.com 2008-02-06 13:30:24 -08:00
Родитель e11128bb88
Коммит 8ee2d3aea9
3 изменённых файлов: 36 добавлений и 3 удалений

Просмотреть файл

@ -96,6 +96,10 @@ else
TEST_DRIVER_PPARGS += -DIS_MAC=0
endif
ifeq ($(host_os), cygwin)
TEST_DRIVER_PPARGS += -DIS_CYGWIN=1
endif
runtests.pl: runtests.pl.in
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
$(TEST_DRIVER_PPARGS) $(DEFINES) $(ACDEFINES) $^ > $@

Просмотреть файл

@ -278,11 +278,24 @@ sub usage_and_exit {
# MAKE A WINDOWS PATH #
#######################
#ifdef IS_CYGWIN
sub winPathFromDir {
my ($path) = abs_path(@_);
# XXXsayrer need to test for cygwin here.
# we can shell out to the cygpath utility to do this for us
# Use external cygpath command to get the windows-like path
$path = `cygpath -w $path`;
# Just remove the traling CR char
chop($path);
return $path;
}
#else
# Non-cygwin version
sub winPathFromDir {
my ($path) = abs_path(@_);
# This is a windows mingw32 build, we need to translate the
# given path to the "actual" windows path.
@ -322,6 +335,9 @@ sub winPathFromDir {
return $bestmatch . "\\" . join "\\", @dirs;
}
# End of non-cygwin version
#endif
##################
# SERVER STARTUP #
##################

Просмотреть файл

@ -52,6 +52,7 @@ import sys
import time
from urllib import quote_plus as encodeURIComponent
import urllib2
import commands
# Path to the test script on the server
@ -118,6 +119,12 @@ PROFILE_DIRECTORY = os.path.abspath("./mochitesttestingprofile")
#expand DIST_BIN = "./" + __XPC_BIN_PATH__
#expand IS_WIN32 = len("__WIN32__") != 0
#expand IS_MAC = __IS_MAC__ != 0
#ifdef IS_CYGWIN
#expand IS_CYGWIN = __IS_CYGWIN__ == 1
#else
IS_CYGWIN = False
#endif
UNIXISH = not IS_WIN32 and not IS_MAC
@ -588,7 +595,13 @@ def runTests(testURL, browserEnv, options):
args = []
if IS_MAC:
args.append("-foreground")
args.extend(("-no-remote", "-profile", PROFILE_DIRECTORY + "/", testURL))
if IS_CYGWIN:
profileDirectory = commands.getoutput("cygpath -w \"" + PROFILE_DIRECTORY + "/\"")
else:
profileDirectory = PROFILE_DIRECTORY + "/"
args.extend(("-no-remote", "-profile", profileDirectory, testURL))
proc = Process(cmd, args, env = env)
print "Application pid: " + str(proc.pid)