summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk/gcc.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/sdk/gcc.py')
-rw-r--r--meta/lib/oeqa/sdk/gcc.py36
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 @@
1import unittest
2import os
3import shutil
4from oeqa.oetest import oeSDKTest, skipModule
5from oeqa.utils.decorators import *
6
7def 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
13class 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)