From ae03111791f45036e7c24378b06b997f8c7cb0a7 Mon Sep 17 00:00:00 2001 From: Lucian Musat Date: Fri, 27 Jun 2014 17:32:13 +0300 Subject: Added testcase decorator to use in logging. Added class decorator LogResults that outputs test results in separate log file. (From OE-Core rev: 7e2b73f1ccfe2968ef780fef2edfaa31c3dae853) Signed-off-by: Lucian Musat Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/base.py | 2 ++ meta/lib/oeqa/selftest/bblayers.py | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'meta/lib/oeqa/selftest') diff --git a/meta/lib/oeqa/selftest/base.py b/meta/lib/oeqa/selftest/base.py index fc880e9d26..80b9b4b312 100644 --- a/meta/lib/oeqa/selftest/base.py +++ b/meta/lib/oeqa/selftest/base.py @@ -15,7 +15,9 @@ import errno import oeqa.utils.ftools as ftools from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer +from oeqa.utils.decorators import LogResults +@LogResults class oeSelfTest(unittest.TestCase): log = logging.getLogger("selftest.base") diff --git a/meta/lib/oeqa/selftest/bblayers.py b/meta/lib/oeqa/selftest/bblayers.py index 52aa4f8112..1ead8e8671 100644 --- a/meta/lib/oeqa/selftest/bblayers.py +++ b/meta/lib/oeqa/selftest/bblayers.py @@ -7,25 +7,31 @@ import shutil import oeqa.utils.ftools as ftools from oeqa.selftest.base import oeSelfTest from oeqa.utils.commands import runCmd +from oeqa.utils.decorators import testcase class BitbakeLayers(oeSelfTest): + @testcase(756) def test_bitbakelayers_showcrossdepends(self): result = runCmd('bitbake-layers show-cross-depends') self.assertTrue('aspell' in result.output) + @testcase(83) def test_bitbakelayers_showlayers(self): result = runCmd('bitbake-layers show_layers') self.assertTrue('meta-selftest' in result.output) + @testcase(93) def test_bitbakelayers_showappends(self): result = runCmd('bitbake-layers show_appends') self.assertTrue('xcursor-transparent-theme_0.1.1.bbappend' in result.output, msg='xcursor-transparent-theme_0.1.1.bbappend file was not recognised') + @testcase(90) def test_bitbakelayers_showoverlayed(self): result = runCmd('bitbake-layers show_overlayed') self.assertTrue('aspell' in result.output, msg='xcursor-transparent-theme_0.1.1.bbappend file was not recognised') + @testcase(95) def test_bitbakelayers_flatten(self): self.assertFalse(os.path.isdir(os.path.join(self.builddir, 'test'))) result = runCmd('bitbake-layers flatten test') -- cgit v1.2.3-54-g00ecf