/usr/share/pyshared/atheist/plugins/manual-repeat-runner.py is in atheist 0.20110402-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | # -*- mode:python; coding:utf-8 -*-
import sys
import time
import optparse
from multiprocessing import Process
import atheist
from atheist.gvar import Log
from pyarco.UI import cls
class ManualRepeatRunner(atheist.Runner, atheist.Plugin):
@classmethod
def get_options(cls, config, parser):
return [optparse.Option('--again', action='store_true',
help='Repeat tests when user press ENTER')]
@classmethod
def config(cls, config, parser):
if not config.again:
return
config.RunnerClass = cls
def subprocess(self):
def simple_runner():
try:
atheist.Runner(self.mng).run()
except atheist.ExecutionError, e:
Log.error(e)
p = Process(target=simple_runner)
p.start()
p.join()
def run(self):
while 1:
cls()
print time.asctime()
self.subprocess()
if self.mng.aborted:
break
try:
raw_input("\n-- Press ENTER to run tests again... ")
except EOFError:
self.mng.abort()
break
return 0
|