diff options
Diffstat (limited to 'meta/lib/oeqa/sdk/gcc.py')
| -rw-r--r-- | meta/lib/oeqa/sdk/gcc.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdk/gcc.py b/meta/lib/oeqa/sdk/gcc.py new file mode 100644 index 0000000000..67994b9b5a --- /dev/null +++ b/meta/lib/oeqa/sdk/gcc.py | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | import unittest | ||
| 2 | import os | ||
| 3 | import shutil | ||
| 4 | from oeqa.oetest import oeSDKTest, skipModule | ||
| 5 | from oeqa.utils.decorators import * | ||
| 6 | |||
| 7 | def setUpModule(): | ||
| 8 | machine = oeSDKTest.tc.d.getVar("MACHINE", True) | ||
| 9 | if not oeSDKTest.hasHostPackage("packagegroup-cross-canadian-" + machine): | ||
| 10 | skipModule("SDK doesn't contain a cross-canadian toolchain") | ||
| 11 | |||
| 12 | |||
| 13 | class GccCompileTest(oeSDKTest): | ||
| 14 | |||
| 15 | @classmethod | ||
| 16 | def setUpClass(self): | ||
| 17 | for f in ['test.c', 'test.cpp', 'testmakefile']: | ||
| 18 | shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f) | ||
| 19 | |||
| 20 | def test_gcc_compile(self): | ||
| 21 | self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir)) | ||
| 22 | |||
| 23 | def test_gpp_compile(self): | ||
| 24 | self._run('$CXX %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir)) | ||
| 25 | |||
| 26 | def test_gpp2_compile(self): | ||
| 27 | self._run('$CXX %s/test.cpp -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir)) | ||
| 28 | |||
| 29 | def test_make(self): | ||
| 30 | self._run('cd %s; make -f testmakefile' % self.tc.sdktestdir) | ||
| 31 | |||
| 32 | @classmethod | ||
| 33 | def tearDownClass(self): | ||
| 34 | files = [self.tc.sdktestdir + f for f in ['test.c', 'test.cpp', 'test.o', 'test', 'testmakefile']] | ||
| 35 | for f in files: | ||
| 36 | bb.utils.remove(f) | ||
