##// END OF EJS Templates
run-tests: pull hgrc creation out as function
Matt Mackall -
r19242:d25fc326 default
parent child Browse files
Show More
@@ -327,6 +327,31 b' def findprogram(program):'
327 return name
327 return name
328 return None
328 return None
329
329
330 def createhgrc(path, options):
331 # create a fresh hgrc
332 hgrc = open(path, 'w+')
333 hgrc.write('[ui]\n')
334 hgrc.write('slash = True\n')
335 hgrc.write('interactive = False\n')
336 hgrc.write('[defaults]\n')
337 hgrc.write('backout = -d "0 0"\n')
338 hgrc.write('commit = -d "0 0"\n')
339 hgrc.write('tag = -d "0 0"\n')
340 if options.inotify:
341 hgrc.write('[extensions]\n')
342 hgrc.write('inotify=\n')
343 hgrc.write('[inotify]\n')
344 hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
345 hgrc.write('appendpid=True\n')
346 if options.extra_config_opt:
347 for opt in options.extra_config_opt:
348 section, key = opt.split('.', 1)
349 assert '=' in key, ('extra config opt %s must '
350 'have an = for assignment' % opt)
351 hgrc.write('[%s]\n%s\n' % (section, key))
352 hgrc.close()
353
354
330 def checktools():
355 def checktools():
331 # Before we go any further, check for pre-requisite tools
356 # Before we go any further, check for pre-requisite tools
332 # stuff from coreutils (cat, rm, etc) are not tested
357 # stuff from coreutils (cat, rm, etc) are not tested
@@ -875,28 +900,7 b' def runone(options, test):'
875
900
876 vlog("# Test", test)
901 vlog("# Test", test)
877
902
878 # create a fresh hgrc
903 createhgrc(HGRCPATH, options)
879 hgrc = open(HGRCPATH, 'w+')
880 hgrc.write('[ui]\n')
881 hgrc.write('slash = True\n')
882 hgrc.write('interactive = False\n')
883 hgrc.write('[defaults]\n')
884 hgrc.write('backout = -d "0 0"\n')
885 hgrc.write('commit = -d "0 0"\n')
886 hgrc.write('tag = -d "0 0"\n')
887 if options.inotify:
888 hgrc.write('[extensions]\n')
889 hgrc.write('inotify=\n')
890 hgrc.write('[inotify]\n')
891 hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
892 hgrc.write('appendpid=True\n')
893 if options.extra_config_opt:
894 for opt in options.extra_config_opt:
895 section, key = opt.split('.', 1)
896 assert '=' in key, ('extra config opt %s must '
897 'have an = for assignment' % opt)
898 hgrc.write('[%s]\n%s\n' % (section, key))
899 hgrc.close()
900
904
901 err = os.path.join(TESTDIR, test+".err")
905 err = os.path.join(TESTDIR, test+".err")
902 if os.path.exists(err):
906 if os.path.exists(err):
General Comments 0
You need to be logged in to leave comments. Login now