tests/run-tests.py
branchstable
changeset 926 f4903069a215
parent 923 8212da2b01eb
child 930 730303014491
equal deleted inserted replaced
925:b73d6eb16638 926:f4903069a215
   163         metavar="HG",
   163         metavar="HG",
   164         help="test using specified hg script rather than a "
   164         help="test using specified hg script rather than a "
   165              "temporary installation")
   165              "temporary installation")
   166     parser.add_option("-3", "--py3k-warnings", action="store_true",
   166     parser.add_option("-3", "--py3k-warnings", action="store_true",
   167         help="enable Py3k warnings on Python 2.6+")
   167         help="enable Py3k warnings on Python 2.6+")
       
   168     parser.add_option('--extra-config-opt', action="append",
       
   169                       help='set the given config opt in the test hgrc')
   168 
   170 
   169     for option, default in defaults.items():
   171     for option, default in defaults.items():
   170         defaults[option] = int(os.environ.get(*default))
   172         defaults[option] = int(os.environ.get(*default))
   171     parser.set_defaults(**defaults)
   173     parser.set_defaults(**defaults)
   172     (options, args) = parser.parse_args()
   174     (options, args) = parser.parse_args()
   752         hgrc.write('[extensions]\n')
   754         hgrc.write('[extensions]\n')
   753         hgrc.write('inotify=\n')
   755         hgrc.write('inotify=\n')
   754         hgrc.write('[inotify]\n')
   756         hgrc.write('[inotify]\n')
   755         hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
   757         hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
   756         hgrc.write('appendpid=True\n')
   758         hgrc.write('appendpid=True\n')
       
   759     if options.extra_config_opt:
       
   760         for opt in options.extra_config_opt:
       
   761             section, key = opt.split('.', 1)
       
   762             assert '=' in key, ('extra config opt %s must '
       
   763                                 'have an = for assignment' % opt)
       
   764             hgrc.write('[%s]\n%s\n' % (section, key))
   757     hgrc.close()
   765     hgrc.close()
   758 
   766 
   759     ref = os.path.join(TESTDIR, test+".out")
   767     ref = os.path.join(TESTDIR, test+".out")
   760     err = os.path.join(TESTDIR, test+".err")
   768     err = os.path.join(TESTDIR, test+".err")
   761     if os.path.exists(err):
   769     if os.path.exists(err):