summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/cases/gcc.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/gcc.py')
-rw-r--r--meta/lib/oeqa/runtime/cases/gcc.py76
1 files changed, 76 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/gcc.py b/meta/lib/oeqa/runtime/cases/gcc.py
new file mode 100644
index 0000000000..064fa49af1
--- /dev/null
+++ b/meta/lib/oeqa/runtime/cases/gcc.py
@@ -0,0 +1,76 @@
1import os
2
3from oeqa.runtime.case import OERuntimeTestCase
4from oeqa.core.decorator.depends import OETestDepends
5from oeqa.core.decorator.oeid import OETestID
6from oeqa.core.decorator.data import skipIfNotFeature
7
8class GccCompileTest(OERuntimeTestCase):
9
10 @classmethod
11 def setUpClass(cls):
12 dst = '/tmp/'
13 src = os.path.join(cls.tc.files_dir, 'test.c')
14 #dst = '/tmp/test.c'
15 cls.tc.target.copyTo(src, dst)
16
17 src = os.path.join(cls.tc.runtime_files_dir, 'testmakefile')
18 #dst = '/tmp/testmakefile'
19 cls.tc.target.copyTo(src, dst)
20
21 src = os.path.join(cls.tc.files_dir, 'test.cpp')
22 #dst = '/tmp/test.cpp'
23 cls.tc.target.copyTo(src, dst)
24
25 @classmethod
26 def tearDownClass(cls):
27 files = '/tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile'
28 cls.tc.target.run('rm %s' % files)
29
30 @OETestID(203)
31 @skipIfNotFeature('tools-sdk',
32 'Test requires tools-sdk to be in IMAGE_FEATURES')
33 @OETestDepends(['ssh.SSHTest.test_ssh'])
34 def test_gcc_compile(self):
35 status, output = self.target.run('gcc /tmp/test.c -o /tmp/test -lm')
36 msg = 'gcc compile failed, output: %s' % output
37 self.assertEqual(status, 0, msg=msg)
38
39 status, output = self.target.run('/tmp/test')
40 msg = 'running compiled file failed, output: %s' % output
41 self.assertEqual(status, 0, msg=msg)
42
43 @OETestID(200)
44 @skipIfNotFeature('tools-sdk',
45 'Test requires tools-sdk to be in IMAGE_FEATURES')
46 @OETestDepends(['ssh.SSHTest.test_ssh'])
47 def test_gpp_compile(self):
48 status, output = self.target.run('g++ /tmp/test.c -o /tmp/test -lm')
49 msg = 'g++ compile failed, output: %s' % output
50 self.assertEqual(status, 0, msg=msg)
51
52 status, output = self.target.run('/tmp/test')
53 msg = 'running compiled file failed, output: %s' % output
54 self.assertEqual(status, 0, msg=msg)
55
56 @OETestID(1142)
57 @skipIfNotFeature('tools-sdk',
58 'Test requires tools-sdk to be in IMAGE_FEATURES')
59 @OETestDepends(['ssh.SSHTest.test_ssh'])
60 def test_gpp2_compile(self):
61 status, output = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm')
62 msg = 'g++ compile failed, output: %s' % output
63 self.assertEqual(status, 0, msg=msg)
64
65 status, output = self.target.run('/tmp/test')
66 msg = 'running compiled file failed, output: %s' % output
67 self.assertEqual(status, 0, msg=msg)
68
69 @OETestID(204)
70 @skipIfNotFeature('tools-sdk',
71 'Test requires tools-sdk to be in IMAGE_FEATURES')
72 @OETestDepends(['ssh.SSHTest.test_ssh'])
73 def test_make(self):
74 status, output = self.target.run('cd /tmp; make -f testmakefile')
75 msg = 'running make failed, output %s' % output
76 self.assertEqual(status, 0, msg=msg)