From: zjh <[email protected]> Signed-off-by: zjh <[email protected]> --- meta/lib/base/baserunner.py | 60 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 meta/lib/base/baserunner.py
diff --git a/meta/lib/base/baserunner.py b/meta/lib/base/baserunner.py new file mode 100755 index 0000000..56b838e --- /dev/null +++ b/meta/lib/base/baserunner.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# Copyright (C) 2013 Intel Corporation +# +# Released under the MIT license (see COPYING.MIT) + +# Base unittest module used by testrunner +# This provides the common test runner functionalities including manifest input, +# xunit output, timeout, tag filtering. + +"""Base testrunner""" + +from __future__ import absolute_import +import os +import sys +import time +import unittest +import shutil + +class TestContext(object): + '''test context which inject into testcase''' + def __init__(self): + self.target = None + +class FakeOptions(object): + '''This class just use for configure's defualt arg. + Usually, we use this object in a non comandline environment.''' + timeout = 0 + def __getattr__(self, name): + return None + +class TestRunnerBase(object): + '''test runner base ''' + def __init__(self, context=None): + self.tclist = [] + self.runner = None + self.context = context if context else TestContext() + self.test_result = None + self.run_time = None + + + def configure(self, options=FakeOptions()): + '''configure before testing''' + pass + + def result(self): + '''output test result ''' + pass + + def loadtest(self, names=None): + '''load test suite''' + pass + + def runtest(self, testsuite): + '''run test suite''' + pass + + def start(self, testsuite): + '''start testing''' + pass + -- 2.1.4 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
