tests/run-tests.py
branchstable
changeset 1292 aa3c5b7a290e
parent 1290 d56f50372ba5
child 1293 6e9bfd51bc6f
equal deleted inserted replaced
1290:d56f50372ba5 1292:aa3c5b7a290e
   458     installerrs = os.path.join("tests", "install.err")
   458     installerrs = os.path.join("tests", "install.err")
   459     compiler = ''
   459     compiler = ''
   460     if options.compiler:
   460     if options.compiler:
   461         compiler = '--compiler ' + options.compiler
   461         compiler = '--compiler ' + options.compiler
   462     pure = options.pure and "--pure" or ""
   462     pure = options.pure and "--pure" or ""
       
   463     py3 = ''
       
   464     if sys.version_info[0] == 3:
       
   465         py3 = '--c2to3'
   463 
   466 
   464     # Run installer in hg root
   467     # Run installer in hg root
   465     script = os.path.realpath(sys.argv[0])
   468     script = os.path.realpath(sys.argv[0])
   466     hgroot = os.path.dirname(os.path.dirname(script))
   469     hgroot = os.path.dirname(os.path.dirname(script))
   467     os.chdir(hgroot)
   470     os.chdir(hgroot)
   470         # The --home="" trick works only on OS where os.sep == '/'
   473         # The --home="" trick works only on OS where os.sep == '/'
   471         # because of a distutils convert_path() fast-path. Avoid it at
   474         # because of a distutils convert_path() fast-path. Avoid it at
   472         # least on Windows for now, deal with .pydistutils.cfg bugs
   475         # least on Windows for now, deal with .pydistutils.cfg bugs
   473         # when they happen.
   476         # when they happen.
   474         nohome = ''
   477         nohome = ''
   475     cmd = ('%(exe)s setup.py %(pure)s clean --all'
   478     cmd = ('%(exe)s setup.py %(py3)s %(pure)s clean --all'
   476            ' build %(compiler)s --build-base="%(base)s"'
   479            ' build %(compiler)s --build-base="%(base)s"'
   477            ' install --force --prefix="%(prefix)s" --install-lib="%(libdir)s"'
   480            ' install --force --prefix="%(prefix)s" --install-lib="%(libdir)s"'
   478            ' --install-scripts="%(bindir)s" %(nohome)s >%(logfile)s 2>&1'
   481            ' --install-scripts="%(bindir)s" %(nohome)s >%(logfile)s 2>&1'
   479            % dict(exe=sys.executable, pure=pure, compiler=compiler,
   482            % dict(exe=sys.executable, py3=py3, pure=pure, compiler=compiler,
   480                   base=os.path.join(HGTMP, "build"),
   483                   base=os.path.join(HGTMP, "build"),
   481                   prefix=INST, libdir=PYTHONDIR, bindir=BINDIR,
   484                   prefix=INST, libdir=PYTHONDIR, bindir=BINDIR,
   482                   nohome=nohome, logfile=installerrs))
   485                   nohome=nohome, logfile=installerrs))
   483     vlog("# Running", cmd)
   486     vlog("# Running", cmd)
   484     if os.system(cmd) == 0:
   487     if os.system(cmd) == 0: