summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/gcc.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/runtime/gcc.py')
-rw-r--r--meta/lib/oeqa/runtime/gcc.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/gcc.py b/meta/lib/oeqa/runtime/gcc.py
new file mode 100644
index 0000000000..a7f62e1758
--- /dev/null
+++ b/meta/lib/oeqa/runtime/gcc.py
@@ -0,0 +1,46 @@
1import unittest
2import os
3from oeqa.oetest import oeRuntimeTest, skipModule
4from oeqa.utils.decorators import *
5
6def setUpModule():
7 if not oeRuntimeTest.hasFeature("tools-sdk"):
8 skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
9
10
11class GccCompileTest(oeRuntimeTest):
12
13 @classmethod
14 def setUpClass(self):
15 oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.c"), "/tmp/test.c")
16 oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "testmakefile"), "/tmp/testmakefile")
17 oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.cpp"), "/tmp/test.cpp")
18
19 @testcase(203)
20 def test_gcc_compile(self):
21 (status, output) = self.target.run('gcc /tmp/test.c -o /tmp/test -lm')
22 self.assertEqual(status, 0, msg="gcc compile failed, output: %s" % output)
23 (status, output) = self.target.run('/tmp/test')
24 self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
25
26 @testcase(200)
27 def test_gpp_compile(self):
28 (status, output) = self.target.run('g++ /tmp/test.c -o /tmp/test -lm')
29 self.assertEqual(status, 0, msg="g++ compile failed, output: %s" % output)
30 (status, output) = self.target.run('/tmp/test')
31 self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
32
33 def test_gpp2_compile(self):
34 (status, output) = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm')
35 self.assertEqual(status, 0, msg="g++ compile failed, output: %s" % output)
36 (status, output) = self.target.run('/tmp/test')
37 self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
38
39 @testcase(204)
40 def test_make(self):
41 (status, output) = self.target.run('cd /tmp; make -f testmakefile')
42 self.assertEqual(status, 0, msg="running make failed, output %s" % output)
43
44 @classmethod
45 def tearDownClass(self):
46 oeRuntimeTest.tc.target.run("rm /tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile")