diff options
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/gcc.py')
-rw-r--r-- | meta/lib/oeqa/sdk/cases/gcc.py | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/meta/lib/oeqa/sdk/cases/gcc.py b/meta/lib/oeqa/sdk/cases/gcc.py index f3f4341a20..e06af4c247 100644 --- a/meta/lib/oeqa/sdk/cases/gcc.py +++ b/meta/lib/oeqa/sdk/cases/gcc.py | |||
@@ -1,36 +1,43 @@ | |||
1 | import unittest | ||
2 | import os | 1 | import os |
3 | import shutil | 2 | import shutil |
4 | from oeqa.oetest import oeSDKTest, skipModule | 3 | import unittest |
5 | from oeqa.utils.decorators import * | ||
6 | |||
7 | def setUpModule(): | ||
8 | machine = oeSDKTest.tc.d.getVar("MACHINE") | ||
9 | if not oeSDKTest.hasHostPackage("packagegroup-cross-canadian-" + machine): | ||
10 | skipModule("SDK doesn't contain a cross-canadian toolchain") | ||
11 | 4 | ||
5 | from oeqa.core.utils.path import remove_safe | ||
6 | from oeqa.sdk.case import OESDKTestCase | ||
12 | 7 | ||
13 | class GccCompileTest(oeSDKTest): | 8 | class GccCompileTest(OESDKTestCase): |
9 | td_vars = ['MACHINE'] | ||
14 | 10 | ||
15 | @classmethod | 11 | @classmethod |
16 | def setUpClass(self): | 12 | def setUpClass(self): |
17 | for f in ['test.c', 'test.cpp', 'testsdkmakefile']: | 13 | files = {'test.c' : self.tc.files_dir, 'test.cpp' : self.tc.files_dir, |
18 | shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f) | 14 | 'testsdkmakefile' : self.tc.sdk_files_dir} |
15 | for f in files: | ||
16 | shutil.copyfile(os.path.join(files[f], f), | ||
17 | os.path.join(self.tc.sdk_dir, f)) | ||
18 | |||
19 | def setUp(self): | ||
20 | machine = self.td.get("MACHINE") | ||
21 | if not self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine): | ||
22 | raise unittest.SkipTest("%s class: SDK doesn't contain a cross-canadian toolchain", | ||
23 | self.__name__) | ||
19 | 24 | ||
20 | def test_gcc_compile(self): | 25 | def test_gcc_compile(self): |
21 | self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir)) | 26 | self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir)) |
22 | 27 | ||
23 | def test_gpp_compile(self): | 28 | def test_gpp_compile(self): |
24 | self._run('$CXX %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir)) | 29 | self._run('$CXX %s/test.c -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir)) |
25 | 30 | ||
26 | def test_gpp2_compile(self): | 31 | def test_gpp2_compile(self): |
27 | self._run('$CXX %s/test.cpp -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir)) | 32 | self._run('$CXX %s/test.cpp -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir)) |
28 | 33 | ||
29 | def test_make(self): | 34 | def test_make(self): |
30 | self._run('cd %s; make -f testsdkmakefile' % self.tc.sdktestdir) | 35 | self._run('cd %s; make -f testsdkmakefile' % self.tc.sdk_dir) |
31 | 36 | ||
32 | @classmethod | 37 | @classmethod |
33 | def tearDownClass(self): | 38 | def tearDownClass(self): |
34 | files = [self.tc.sdktestdir + f for f in ['test.c', 'test.cpp', 'test.o', 'test', 'testsdkmakefile']] | 39 | files = [os.path.join(self.tc.sdk_dir, f) \ |
40 | for f in ['test.c', 'test.cpp', 'test.o', 'test', | ||
41 | 'testsdkmakefile']] | ||
35 | for f in files: | 42 | for f in files: |
36 | bb.utils.remove(f) | 43 | remove_safe(f) |