diff options
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/gcc.py')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/gcc.py | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/meta/lib/oeqa/runtime/cases/gcc.py b/meta/lib/oeqa/runtime/cases/gcc.py index 911083156f..17b1483e8d 100644 --- a/meta/lib/oeqa/runtime/cases/gcc.py +++ b/meta/lib/oeqa/runtime/cases/gcc.py @@ -1,14 +1,19 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + import os from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends -from oeqa.core.decorator.oeid import OETestID -from oeqa.core.decorator.data import skipIfNotFeature +from oeqa.runtime.decorator.package import OEHasPackage class GccCompileTest(OERuntimeTestCase): @classmethod - def setUpClass(cls): + def setUp(cls): dst = '/tmp/' src = os.path.join(cls.tc.files_dir, 'test.c') cls.tc.target.copyTo(src, dst) @@ -20,14 +25,12 @@ class GccCompileTest(OERuntimeTestCase): cls.tc.target.copyTo(src, dst) @classmethod - def tearDownClass(cls): + def tearDown(cls): files = '/tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile' cls.tc.target.run('rm %s' % files) - @OETestID(203) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['gcc']) def test_gcc_compile(self): status, output = self.target.run('gcc /tmp/test.c -o /tmp/test -lm') msg = 'gcc compile failed, output: %s' % output @@ -37,10 +40,8 @@ class GccCompileTest(OERuntimeTestCase): msg = 'running compiled file failed, output: %s' % output self.assertEqual(status, 0, msg=msg) - @OETestID(200) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['g++']) def test_gpp_compile(self): status, output = self.target.run('g++ /tmp/test.c -o /tmp/test -lm') msg = 'g++ compile failed, output: %s' % output @@ -50,10 +51,8 @@ class GccCompileTest(OERuntimeTestCase): msg = 'running compiled file failed, output: %s' % output self.assertEqual(status, 0, msg=msg) - @OETestID(1142) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['g++']) def test_gpp2_compile(self): status, output = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm') msg = 'g++ compile failed, output: %s' % output @@ -63,10 +62,9 @@ class GccCompileTest(OERuntimeTestCase): msg = 'running compiled file failed, output: %s' % output self.assertEqual(status, 0, msg=msg) - @OETestID(204) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['gcc']) + @OEHasPackage(['make']) def test_make(self): status, output = self.target.run('cd /tmp; make -f testmakefile') msg = 'running make failed, output %s' % output |