139 # keep these sorted |
139 # keep these sorted |
140 parser.add_option("--blacklist", action="append", |
140 parser.add_option("--blacklist", action="append", |
141 help="skip tests listed in the specified blacklist file") |
141 help="skip tests listed in the specified blacklist file") |
142 parser.add_option("--whitelist", action="append", |
142 parser.add_option("--whitelist", action="append", |
143 help="always run tests listed in the specified whitelist file") |
143 help="always run tests listed in the specified whitelist file") |
|
144 parser.add_option("--changed", type="string", |
|
145 help="run tests that are changed in parent rev or working directory") |
144 parser.add_option("-C", "--annotate", action="store_true", |
146 parser.add_option("-C", "--annotate", action="store_true", |
145 help="output files annotated with coverage") |
147 help="output files annotated with coverage") |
146 parser.add_option("-c", "--cover", action="store_true", |
148 parser.add_option("-c", "--cover", action="store_true", |
147 help="print a test coverage report") |
149 help="print a test coverage report") |
148 parser.add_option("-d", "--debug", action="store_true", |
150 parser.add_option("-d", "--debug", action="store_true", |
1179 os.umask(022) |
1181 os.umask(022) |
1180 |
1182 |
1181 checktools() |
1183 checktools() |
1182 |
1184 |
1183 if not args: |
1185 if not args: |
1184 args = os.listdir(".") |
1186 if options.changed: |
|
1187 proc = Popen4('hg st --rev "%s" -man0 .' % options.changed, |
|
1188 None, 0) |
|
1189 stdout, stderr = proc.communicate() |
|
1190 args = stdout.strip('\0').split('\0') |
|
1191 else: |
|
1192 args = os.listdir(".") |
1185 |
1193 |
1186 tests = [t for t in args |
1194 tests = [t for t in args |
1187 if t.startswith("test-") |
1195 if t.startswith("test-") |
1188 and (t.endswith(".py") or t.endswith(".t"))] |
1196 and (t.endswith(".py") or t.endswith(".t"))] |
1189 |
1197 |