Mercurial > hg
comparison tests/run-tests.py @ 17966:ae20cde050c2
run-tests: add a --compiler option
Without this option, it is not possible to run the test suite on Windows
using mingw's gcc as the compiler.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Tue, 27 Nov 2012 11:18:33 -0800 |
parents | 0167da3cbc44 |
children | 0e2850a6fcdd |
comparison
equal
deleted
inserted
replaced
17965:0167da3cbc44 | 17966:ae20cde050c2 |
---|---|
161 parser.add_option("-n", "--nodiff", action="store_true", | 161 parser.add_option("-n", "--nodiff", action="store_true", |
162 help="skip showing test changes") | 162 help="skip showing test changes") |
163 parser.add_option("-p", "--port", type="int", | 163 parser.add_option("-p", "--port", type="int", |
164 help="port on which servers should listen" | 164 help="port on which servers should listen" |
165 " (default: $%s or %d)" % defaults['port']) | 165 " (default: $%s or %d)" % defaults['port']) |
166 parser.add_option("--compiler", type="string", | |
167 help="compiler to build with") | |
166 parser.add_option("--pure", action="store_true", | 168 parser.add_option("--pure", action="store_true", |
167 help="use pure Python code instead of C extensions") | 169 help="use pure Python code instead of C extensions") |
168 parser.add_option("-R", "--restart", action="store_true", | 170 parser.add_option("-R", "--restart", action="store_true", |
169 help="restart at last error") | 171 help="restart at last error") |
170 parser.add_option("-r", "--retest", action="store_true", | 172 parser.add_option("-r", "--retest", action="store_true", |
369 shutil.copymode(sys.executable, mypython) | 371 shutil.copymode(sys.executable, mypython) |
370 | 372 |
371 def installhg(options): | 373 def installhg(options): |
372 vlog("# Performing temporary installation of HG") | 374 vlog("# Performing temporary installation of HG") |
373 installerrs = os.path.join("tests", "install.err") | 375 installerrs = os.path.join("tests", "install.err") |
376 compiler = '' | |
377 if options.compiler: | |
378 compiler = '--compiler ' + options.compiler | |
374 pure = options.pure and "--pure" or "" | 379 pure = options.pure and "--pure" or "" |
375 | 380 |
376 # Run installer in hg root | 381 # Run installer in hg root |
377 script = os.path.realpath(sys.argv[0]) | 382 script = os.path.realpath(sys.argv[0]) |
378 hgroot = os.path.dirname(os.path.dirname(script)) | 383 hgroot = os.path.dirname(os.path.dirname(script)) |
383 # because of a distutils convert_path() fast-path. Avoid it at | 388 # because of a distutils convert_path() fast-path. Avoid it at |
384 # least on Windows for now, deal with .pydistutils.cfg bugs | 389 # least on Windows for now, deal with .pydistutils.cfg bugs |
385 # when they happen. | 390 # when they happen. |
386 nohome = '' | 391 nohome = '' |
387 cmd = ('%(exe)s setup.py %(pure)s clean --all' | 392 cmd = ('%(exe)s setup.py %(pure)s clean --all' |
388 ' build --build-base="%(base)s"' | 393 ' build %(compiler)s --build-base="%(base)s"' |
389 ' install --force --prefix="%(prefix)s" --install-lib="%(libdir)s"' | 394 ' install --force --prefix="%(prefix)s" --install-lib="%(libdir)s"' |
390 ' --install-scripts="%(bindir)s" %(nohome)s >%(logfile)s 2>&1' | 395 ' --install-scripts="%(bindir)s" %(nohome)s >%(logfile)s 2>&1' |
391 % dict(exe=sys.executable, pure=pure, | 396 % dict(exe=sys.executable, pure=pure, compiler=compiler, |
392 base=os.path.join(HGTMP, "build"), | 397 base=os.path.join(HGTMP, "build"), |
393 prefix=INST, libdir=PYTHONDIR, bindir=BINDIR, | 398 prefix=INST, libdir=PYTHONDIR, bindir=BINDIR, |
394 nohome=nohome, logfile=installerrs)) | 399 nohome=nohome, logfile=installerrs)) |
395 vlog("# Running", cmd) | 400 vlog("# Running", cmd) |
396 if os.system(cmd) == 0: | 401 if os.system(cmd) == 0: |