run-tests: on windows, put correct python at front of PATH
The older approach of trying to copy the python executable into the test
directory was doomed to fail.
There remains one weakness with this approach: if you've run "make local",
tests may pick up the wrong extension DLLs from inside the source tree. I
don't know why this happens.
A reasonable workaround for now is to test either using --local or with
a working directory that does not contain built DLLs.
[ original upstream message ]
#!/usr/bin/env python"""Test the running system for features availability. Exit with zeroif all features are there, non-zero otherwise. If a feature name isprefixed with "no-", the absence of feature is tested."""importoptparseimportsysimporthghavechecks=hghave.checksdeflist_features():forname,featureinchecks.iteritems():desc=feature[1]printname+':',descdeftest_features():failed=0forname,featureinchecks.iteritems():check,_=featuretry:check()exceptException,e:print"feature %s failed: %s"%(name,e)failed+=1returnfailedparser=optparse.OptionParser("%prog [options] [features]")parser.add_option("--test-features",action="store_true",help="test available features")parser.add_option("--list-features",action="store_true",help="list available features")parser.add_option("-q","--quiet",action="store_true",help="check features silently")if__name__=='__main__':options,args=parser.parse_args()ifoptions.list_features:list_features()sys.exit(0)ifoptions.test_features:sys.exit(test_features())quiet=options.quietfailures=0deferror(msg):globalfailuresifnotquiet:sys.stderr.write(msg+'\n')failures+=1forfeatureinargs:negate=feature.startswith('no-')ifnegate:feature=feature[3:]iffeaturenotinchecks:error('skipped: unknown feature: '+feature)continuecheck,desc=checks[feature]try:available=check()exceptException,e:error('hghave check failed: '+feature)continueifnotnegateandnotavailable:error('skipped: missing feature: '+desc)elifnegateandavailable:error('skipped: system supports %s'%desc)iffailures!=0:sys.exit(1)