comparison tests/run-tests.py @ 12677:9848a94e2ad6

run-tests.py: do not install hg when the tests do no exist
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sat, 09 Oct 2010 16:25:28 -0500
parents d08bb64888bc
children 61642a4679e9
comparison
equal deleted inserted replaced
12676:ef500b2f100b 12677:9848a94e2ad6
981 if not options.child: 981 if not options.child:
982 os.umask(022) 982 os.umask(022)
983 983
984 checktools() 984 checktools()
985 985
986 if len(args) == 0:
987 args = os.listdir(".")
988 args.sort()
989
990 tests = []
991 skipped = []
992 for test in args:
993 if (test.startswith("test-") and '~' not in test and
994 ('.' not in test or test.endswith('.py') or
995 test.endswith('.bat') or test.endswith('.t'))):
996 if not os.path.exists(test):
997 skipped.append(test)
998 else:
999 tests.append(test)
1000 if not tests:
1001 for test in skipped:
1002 print 'Skipped %s: does not exist' % test
1003 print "# Ran 0 tests, %d skipped, 0 failed." % len(skipped)
1004 return
1005 tests = tests + skipped
1006
986 # Reset some environment variables to well-known values so that 1007 # Reset some environment variables to well-known values so that
987 # the tests produce repeatable output. 1008 # the tests produce repeatable output.
988 os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C' 1009 os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C'
989 os.environ['TZ'] = 'GMT' 1010 os.environ['TZ'] = 'GMT'
990 os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>" 1011 os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>"
1067 pypath.append(oldpypath) 1088 pypath.append(oldpypath)
1068 os.environ[IMPL_PATH] = os.pathsep.join(pypath) 1089 os.environ[IMPL_PATH] = os.pathsep.join(pypath)
1069 1090
1070 COVERAGE_FILE = os.path.join(TESTDIR, ".coverage") 1091 COVERAGE_FILE = os.path.join(TESTDIR, ".coverage")
1071 1092
1072 if len(args) == 0:
1073 args = os.listdir(".")
1074 args.sort()
1075
1076 tests = []
1077 for test in args:
1078 if (test.startswith("test-") and '~' not in test and
1079 ('.' not in test or test.endswith('.py') or
1080 test.endswith('.bat') or test.endswith('.t'))):
1081 tests.append(test)
1082 if not tests:
1083 print "# Ran 0 tests, 0 skipped, 0 failed."
1084 return
1085
1086 vlog("# Using TESTDIR", TESTDIR) 1093 vlog("# Using TESTDIR", TESTDIR)
1087 vlog("# Using HGTMP", HGTMP) 1094 vlog("# Using HGTMP", HGTMP)
1088 vlog("# Using PATH", os.environ["PATH"]) 1095 vlog("# Using PATH", os.environ["PATH"])
1089 vlog("# Using", IMPL_PATH, os.environ[IMPL_PATH]) 1096 vlog("# Using", IMPL_PATH, os.environ[IMPL_PATH])
1090 1097