aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/gcc.py
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2013-06-28 11:55:50 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-07-09 10:49:20 +0100
commitccbce75335971abf5098a492755e92ca60cf67bd (patch)
treeb47260dc570b0805109c9e2533dde41c214ab286 /meta/lib/oeqa/runtime/gcc.py
parentdd3dc2804395f050df74fa936e65ce5e911442eb (diff)
downloadopenembedded-core-contrib-ccbce75335971abf5098a492755e92ca60cf67bd.tar.gz
lib/oeqa/runtime: add gcc test
gcc compile test and support files. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Diffstat (limited to 'meta/lib/oeqa/runtime/gcc.py')
-rw-r--r--meta/lib/oeqa/runtime/gcc.py36
1 files changed, 36 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..b63badd3e4
--- /dev/null
+++ b/meta/lib/oeqa/runtime/gcc.py
@@ -0,0 +1,36 @@
+import unittest
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("tools-sdk"):
+ skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+
+class GccCompileTest(oeRuntimeTest):
+
+ @classmethod
+ def setUpClass(self):
+ oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.c"), "/tmp/test.c")
+ oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "testmakefile"), "/tmp/testmakefile")
+
+ def test_gcc_compile(self):
+ (status, output) = self.target.run('gcc /tmp/test.c -o /tmp/test -lm')
+ self.assertEqual(status, 0, msg="gcc compile failed, output: %s" % output)
+ (status, output) = self.target.run('/tmp/test')
+ self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
+
+ def test_gpp_compile(self):
+ (status, output) = self.target.run('g++ /tmp/test.c -o /tmp/test -lm')
+ self.assertEqual(status, 0, msg="g++ compile failed, output: %s" % output)
+ (status, output) = self.target.run('/tmp/test')
+ self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
+
+ def test_make(self):
+ (status, output) = self.target.run('cd /tmp; make -f testmakefile')
+ self.assertEqual(status, 0, msg="running make failed, output %s" % output)
+
+ @classmethod
+ def tearDownClass(self):
+ oeRuntimeTest.tc.target.run("rm /tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile")