summaryrefslogtreecommitdiff
path: root/yocto-poky/meta/lib/oeqa/sdk
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2015-09-15 22:41:29 +0300
committerPatrick Williams <patrick@stwcx.xyz>2015-09-15 22:41:29 +0300
commit21f9b84b4b729fbd7acbd465e7a3f726e4d20f91 (patch)
treeeb2d091d427ca0813b445509d59cc8e27e8ad25f /yocto-poky/meta/lib/oeqa/sdk
parent101cef31e2bf54c678501155cd2106251acbd076 (diff)
parentc124f4f2e04dca16a428a76c89677328bc7bf908 (diff)
downloadopenbmc-21f9b84b4b729fbd7acbd465e7a3f726e4d20f91.tar.xz
Merge commit 'c124f4f2e04dca16a428a76c89677328bc7bf908' as 'yocto-poky'
Diffstat (limited to 'yocto-poky/meta/lib/oeqa/sdk')
-rw-r--r--yocto-poky/meta/lib/oeqa/sdk/__init__.py3
-rw-r--r--yocto-poky/meta/lib/oeqa/sdk/buildcvs.py25
-rw-r--r--yocto-poky/meta/lib/oeqa/sdk/buildiptables.py26
-rw-r--r--yocto-poky/meta/lib/oeqa/sdk/buildsudoku.py26
-rw-r--r--yocto-poky/meta/lib/oeqa/sdk/gcc.py36
-rw-r--r--yocto-poky/meta/lib/oeqa/sdk/perl.py28
-rw-r--r--yocto-poky/meta/lib/oeqa/sdk/python.py32
7 files changed, 176 insertions, 0 deletions
diff --git a/yocto-poky/meta/lib/oeqa/sdk/__init__.py b/yocto-poky/meta/lib/oeqa/sdk/__init__.py
new file mode 100644
index 000000000..4cf3fa76b
--- /dev/null
+++ b/yocto-poky/meta/lib/oeqa/sdk/__init__.py
@@ -0,0 +1,3 @@
+# Enable other layers to have tests in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/yocto-poky/meta/lib/oeqa/sdk/buildcvs.py b/yocto-poky/meta/lib/oeqa/sdk/buildcvs.py
new file mode 100644
index 000000000..c7146fa4a
--- /dev/null
+++ b/yocto-poky/meta/lib/oeqa/sdk/buildcvs.py
@@ -0,0 +1,25 @@
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import SDKBuildProject
+
+class BuildCvsTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/cvs/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
+ "http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/cvs-1.12.13.tar.bz2")
+ self.project.download_archive()
+
+ def test_cvs(self):
+ self.assertEqual(self.project.run_configure(), 0,
+ msg="Running configure failed")
+
+ self.assertEqual(self.project.run_make(), 0,
+ msg="Running make failed")
+
+ self.assertEqual(self.project.run_install(), 0,
+ msg="Running make install failed")
+
+ @classmethod
+ def tearDownClass(self):
+ self.project.clean()
diff --git a/yocto-poky/meta/lib/oeqa/sdk/buildiptables.py b/yocto-poky/meta/lib/oeqa/sdk/buildiptables.py
new file mode 100644
index 000000000..062e5316e
--- /dev/null
+++ b/yocto-poky/meta/lib/oeqa/sdk/buildiptables.py
@@ -0,0 +1,26 @@
+from oeqa.oetest import oeSDKTest
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import SDKBuildProject
+
+
+class BuildIptablesTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/iptables/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
+ "http://netfilter.org/projects/iptables/files/iptables-1.4.13.tar.bz2")
+ self.project.download_archive()
+
+ def test_iptables(self):
+ self.assertEqual(self.project.run_configure(), 0,
+ msg="Running configure failed")
+
+ self.assertEqual(self.project.run_make(), 0,
+ msg="Running make failed")
+
+ self.assertEqual(self.project.run_install(), 0,
+ msg="Running make install failed")
+
+ @classmethod
+ def tearDownClass(self):
+ self.project.clean()
diff --git a/yocto-poky/meta/lib/oeqa/sdk/buildsudoku.py b/yocto-poky/meta/lib/oeqa/sdk/buildsudoku.py
new file mode 100644
index 000000000..dea77c659
--- /dev/null
+++ b/yocto-poky/meta/lib/oeqa/sdk/buildsudoku.py
@@ -0,0 +1,26 @@
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import SDKBuildProject
+
+def setUpModule():
+ if not oeSDKTest.hasPackage("gtk\+"):
+ skipModule("Image doesn't have gtk+ in manifest")
+
+class SudokuTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/sudoku/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
+ "http://downloads.sourceforge.net/project/sudoku-savant/sudoku-savant/sudoku-savant-1.3/sudoku-savant-1.3.tar.bz2")
+ self.project.download_archive()
+
+ def test_sudoku(self):
+ self.assertEqual(self.project.run_configure(), 0,
+ msg="Running configure failed")
+
+ self.assertEqual(self.project.run_make(), 0,
+ msg="Running make failed")
+
+ @classmethod
+ def tearDownClass(self):
+ self.project.clean()
diff --git a/yocto-poky/meta/lib/oeqa/sdk/gcc.py b/yocto-poky/meta/lib/oeqa/sdk/gcc.py
new file mode 100644
index 000000000..67994b9b5
--- /dev/null
+++ b/yocto-poky/meta/lib/oeqa/sdk/gcc.py
@@ -0,0 +1,36 @@
+import unittest
+import os
+import shutil
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ machine = oeSDKTest.tc.d.getVar("MACHINE", True)
+ if not oeSDKTest.hasHostPackage("packagegroup-cross-canadian-" + machine):
+ skipModule("SDK doesn't contain a cross-canadian toolchain")
+
+
+class GccCompileTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ for f in ['test.c', 'test.cpp', 'testmakefile']:
+ shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
+
+ def test_gcc_compile(self):
+ self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
+
+ def test_gpp_compile(self):
+ self._run('$CXX %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
+
+ def test_gpp2_compile(self):
+ self._run('$CXX %s/test.cpp -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
+
+ def test_make(self):
+ self._run('cd %s; make -f testmakefile' % self.tc.sdktestdir)
+
+ @classmethod
+ def tearDownClass(self):
+ files = [self.tc.sdktestdir + f for f in ['test.c', 'test.cpp', 'test.o', 'test', 'testmakefile']]
+ for f in files:
+ bb.utils.remove(f)
diff --git a/yocto-poky/meta/lib/oeqa/sdk/perl.py b/yocto-poky/meta/lib/oeqa/sdk/perl.py
new file mode 100644
index 000000000..45f422ef0
--- /dev/null
+++ b/yocto-poky/meta/lib/oeqa/sdk/perl.py
@@ -0,0 +1,28 @@
+import unittest
+import os
+import shutil
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeSDKTest.hasHostPackage("nativesdk-perl"):
+ skipModule("No perl package in the SDK")
+
+
+class PerlTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ for f in ['test.pl']:
+ shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
+ self.testfile = self.tc.sdktestdir + "test.pl"
+
+ def test_perl_exists(self):
+ self._run('which perl')
+
+ def test_perl_works(self):
+ self._run('perl %s/test.pl' % self.tc.sdktestdir)
+
+ @classmethod
+ def tearDownClass(self):
+ bb.utils.remove("%s/test.pl" % self.tc.sdktestdir)
diff --git a/yocto-poky/meta/lib/oeqa/sdk/python.py b/yocto-poky/meta/lib/oeqa/sdk/python.py
new file mode 100644
index 000000000..896fab4df
--- /dev/null
+++ b/yocto-poky/meta/lib/oeqa/sdk/python.py
@@ -0,0 +1,32 @@
+import unittest
+import os
+import shutil
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeSDKTest.hasHostPackage("nativesdk-python"):
+ skipModule("No python package in the SDK")
+
+
+class PythonTest(oeSDKTest):
+
+ @classmethod
+ def setUpClass(self):
+ for f in ['test.py']:
+ shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
+
+ def test_python_exists(self):
+ self._run('which python')
+
+ def test_python_stdout(self):
+ output = self._run('python %s/test.py' % self.tc.sdktestdir)
+ self.assertEqual(output.strip(), "the value of a is 0.01", msg="Incorrect output: %s" % output)
+
+ def test_python_testfile(self):
+ self._run('ls /tmp/testfile.python')
+
+ @classmethod
+ def tearDownClass(self):
+ bb.utils.remove("%s/test.py" % self.tc.sdktestdir)
+ bb.utils.remove("/tmp/testfile.python")