Show More
@@ -351,9 +351,10 b' class Test(object):' | |||
|
351 | 351 | path = os.path.join(runner.testdir, test) |
|
352 | 352 | errpath = os.path.join(runner.testdir, '%s.err' % test) |
|
353 | 353 | |
|
354 | self.name = test | |
|
355 | ||
|
354 | 356 | self._runner = runner |
|
355 | 357 | self._testdir = runner.testdir |
|
356 | self._test = test | |
|
357 | 358 | self._path = path |
|
358 | 359 | self._options = runner.options |
|
359 | 360 | self._count = count |
@@ -392,16 +393,16 b' class Test(object):' | |||
|
392 | 393 | return self.skip("Doesn't exist") |
|
393 | 394 | |
|
394 | 395 | options = self._options |
|
395 |
if not (options.whitelisted and self. |
|
|
396 |
if options.blacklist and self. |
|
|
396 | if not (options.whitelisted and self.name in options.whitelisted): | |
|
397 | if options.blacklist and self.name in options.blacklist: | |
|
397 | 398 | return self.skip('blacklisted') |
|
398 | 399 | |
|
399 |
if options.retest and not os.path.exists('%s.err' % self. |
|
|
400 | if options.retest and not os.path.exists('%s.err' % self.name): | |
|
400 | 401 | return self.ignore('not retesting') |
|
401 | 402 | |
|
402 | 403 | if options.keywords: |
|
403 |
f = open(self. |
|
|
404 |
t = f.read().lower() + self. |
|
|
404 | f = open(self.name) | |
|
405 | t = f.read().lower() + self.name.lower() | |
|
405 | 406 | f.close() |
|
406 | 407 | for k in options.keywords.lower().split(): |
|
407 | 408 | if k in t: |
@@ -409,7 +410,7 b' class Test(object):' | |||
|
409 | 410 | else: |
|
410 | 411 | return self.ignore("doesn't match keyword") |
|
411 | 412 | |
|
412 |
if not os.path.basename(self. |
|
|
413 | if not os.path.basename(self.name.lower()).startswith('test-'): | |
|
413 | 414 | return self.skip('not a test file') |
|
414 | 415 | |
|
415 | 416 | # Remove any previous output files. |
@@ -423,7 +424,7 b' class Test(object):' | |||
|
423 | 424 | self._daemonpids.append(env['DAEMON_PIDS']) |
|
424 | 425 | self._createhgrc(env['HGRCPATH']) |
|
425 | 426 | |
|
426 |
vlog('# Test', self. |
|
|
427 | vlog('# Test', self.name) | |
|
427 | 428 | |
|
428 | 429 | starttime = time.time() |
|
429 | 430 | try: |
@@ -431,7 +432,7 b' class Test(object):' | |||
|
431 | 432 | duration = time.time() - starttime |
|
432 | 433 | except KeyboardInterrupt: |
|
433 | 434 | duration = time.time() - starttime |
|
434 |
log('INTERRUPTED: %s (after %d seconds)' % (self. |
|
|
435 | log('INTERRUPTED: %s (after %d seconds)' % (self.name, duration)) | |
|
435 | 436 | raise |
|
436 | 437 | except Exception, e: |
|
437 | 438 | return self.fail('Exception during execution: %s' % e, 255) |
@@ -506,7 +507,7 b' class Test(object):' | |||
|
506 | 507 | sys.stdout.flush() |
|
507 | 508 | iolock.release() |
|
508 | 509 | |
|
509 |
self._runner.times.append((self. |
|
|
510 | self._runner.times.append((self.name, duration)) | |
|
510 | 511 | |
|
511 | 512 | return res |
|
512 | 513 | |
@@ -587,12 +588,12 b' class Test(object):' | |||
|
587 | 588 | hgrc.close() |
|
588 | 589 | |
|
589 | 590 | def success(self): |
|
590 |
return '.', self. |
|
|
591 | return '.', self.name, '' | |
|
591 | 592 | |
|
592 | 593 | def fail(self, msg, ret): |
|
593 | 594 | warned = ret is False |
|
594 | 595 | if not self._options.nodiff: |
|
595 |
log("\n%s: %s %s" % (warned and 'Warning' or 'ERROR', self. |
|
|
596 | log("\n%s: %s %s" % (warned and 'Warning' or 'ERROR', self.name, | |
|
596 | 597 | msg)) |
|
597 | 598 | if (not ret and self._options.interactive and |
|
598 | 599 | os.path.exists(self._errpath)): |
@@ -601,23 +602,23 b' class Test(object):' | |||
|
601 | 602 | answer = sys.stdin.readline().strip() |
|
602 | 603 | iolock.release() |
|
603 | 604 | if answer.lower() in ('y', 'yes'): |
|
604 |
if self. |
|
|
605 | if self.name.endswith('.t'): | |
|
605 | 606 | rename(self._errpath, self._path) |
|
606 | 607 | else: |
|
607 | 608 | rename(self._errpath, '%s.out' % self._path) |
|
608 | 609 | |
|
609 |
return '.', self. |
|
|
610 | return '.', self.name, '' | |
|
610 | 611 | |
|
611 |
return warned and '~' or '!', self. |
|
|
612 | return warned and '~' or '!', self.name, msg | |
|
612 | 613 | |
|
613 | 614 | def skip(self, msg): |
|
614 | 615 | if self._options.verbose: |
|
615 | 616 | log("\nSkipping %s: %s" % (self._path, msg)) |
|
616 | 617 | |
|
617 |
return 's', self. |
|
|
618 | return 's', self.name, msg | |
|
618 | 619 | |
|
619 | 620 | def ignore(self, msg): |
|
620 |
return 'i', self. |
|
|
621 | return 'i', self.name, msg | |
|
621 | 622 | |
|
622 | 623 | class PythonTest(Test): |
|
623 | 624 | """A Python-based test.""" |
General Comments 0
You need to be logged in to leave comments.
Login now