[gnome-continuous-yocto/gnomeostree-3.28-rocko: 2241/8267] /oeqa/sdkext Adds verification for devtool on eSDK.



commit 1da953d631ab1574c6a9242f2c8ff9cd6b74bcd0
Author: Francisco Pedraza <francisco j pedraza gonzalez intel com>
Date:   Wed Aug 24 15:50:07 2016 -0500

    /oeqa/sdkext Adds verification for devtool on eSDK.
    
    The covered funcions are, build make, build esdk package, build cmake
    extend autotools recipe creation, kernel module,
    node.js installation and recipe creation.
    
    (From OE-Core rev: 574a5d4cf3e79815aecc4d198545119d3bbfb023)
    
    Signed-off-by: Francisco Pedraza <francisco j pedraza gonzalez intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 meta/lib/oeqa/sdkext/devtool.py                    |   90 ++++++++++++++++++--
 .../oeqa/sdkext/files/myapp_cmake/CMakeLists.txt   |   11 +++
 meta/lib/oeqa/sdkext/files/myapp_cmake/myapp.c     |    9 ++
 3 files changed, 103 insertions(+), 7 deletions(-)
---
diff --git a/meta/lib/oeqa/sdkext/devtool.py b/meta/lib/oeqa/sdkext/devtool.py
index c5bb310..ba12799 100644
--- a/meta/lib/oeqa/sdkext/devtool.py
+++ b/meta/lib/oeqa/sdkext/devtool.py
@@ -1,32 +1,108 @@
 import shutil
-
+import subprocess
+import urllib.request
 from oeqa.oetest import oeSDKExtTest
 from oeqa.utils.decorators import *
 
 class DevtoolTest(oeSDKExtTest):
-
     @classmethod
     def setUpClass(self):
         self.myapp_src = os.path.join(self.tc.sdkextfilesdir, "myapp")
         self.myapp_dst = os.path.join(self.tc.sdktestdir, "myapp")
         shutil.copytree(self.myapp_src, self.myapp_dst)
 
+        self.myapp_cmake_src = os.path.join(self.tc.sdkextfilesdir, "myapp_cmake")
+        self.myapp_cmake_dst = os.path.join(self.tc.sdktestdir, "myapp_cmake")
+        shutil.copytree(self.myapp_cmake_src, self.myapp_cmake_dst)
+
+    def _test_devtool_build(self, directory):
+        self._run('devtool add myapp %s' % directory)
+        try:
+            self._run('devtool build myapp')
+        except Exception as e:
+            print(e.output)
+            self._run('devtool reset myapp')
+            raise e
+        self._run('devtool reset myapp')
+
+    def _test_devtool_build_package(self, directory):
+        self._run('devtool add myapp %s' % directory)
+        try:
+            self._run('devtool package myapp')
+        except Exception as e:
+            print(e.output)
+            self._run('devtool reset myapp')
+            raise e
+        self._run('devtool reset myapp')
+
     def test_devtool_location(self):
         output = self._run('which devtool')
         self.assertEqual(output.startswith(self.tc.sdktestdir), True, \
             msg="Seems that devtool isn't the eSDK one: %s" % output)
-
+    
     @skipUnlessPassed('test_devtool_location')
     def test_devtool_add_reset(self):
         self._run('devtool add myapp %s' % self.myapp_dst)
         self._run('devtool reset myapp')
+    
+    @testcase(1473)
+    @skipUnlessPassed('test_devtool_location')
+    def test_devtool_build_make(self):
+        self._test_devtool_build(self.myapp_dst)
+    
+    @testcase(1474)
+    @skipUnlessPassed('test_devtool_location')
+    def test_devtool_build_esdk_package(self):
+        self._test_devtool_build_package(self.myapp_dst)
 
+    @testcase(1479)
     @skipUnlessPassed('test_devtool_location')
-    def test_devtool_build(self):
-        self._run('devtool add myapp %s' % self.myapp_dst)
-        self._run('devtool build myapp')
-        self._run('devtool reset myapp')
+    def test_devtool_build_cmake(self):
+        self._test_devtool_build(self.myapp_cmake_dst)
+    
+    @testcase(1482)
+    @skipUnlessPassed('test_devtool_location')
+    def test_extend_autotools_recipe_creation(self):
+        req = 'https://github.com/rdfa/librdfa'
+        recipe = "bbexample"
+        self._run('devtool add %s %s' % (recipe, req) )
+        try:
+            self._run('devtool build %s' % recipe)
+        except Exception as e:
+            print(e.output)
+            self._run('devtool reset %s' % recipe)
+            raise e
+        self._run('devtool reset %s' % recipe)
+
+    @testcase(1484)
+    @skipUnlessPassed('test_devtool_location')
+    def test_devtool_kernelmodule(self):
+        docfile = 'https://github.com/umlaeute/v4l2loopback.git'
+        recipe = 'v4l2loopback-driver'
+        self._run('devtool add %s %s' % (recipe, docfile) )
+        try:
+            self._run('devtool build %s' % recipe)
+        except Exception as e:
+            print(e.output)
+            self._run('devtool reset %s' % recipe)
+            raise e
+        self._run('devtool reset %s' % recipe)
+
+    @testcase(1478)
+    @skipUnlessPassed('test_devtool_location')
+    def test_recipes_for_nodejs(self):
+        package_nodejs = "npm://registry.npmjs.org;name=forever;version=0.15.1"
+        self._run('devtool add %s ' % package_nodejs)
+        try:
+            self._run('devtool build %s ' % package_nodejs)
+        except Exception as e:
+            print(e.output)
+            self._run('devtool reset %s' % package_nodejs)
+            raise e
+        self._run('devtool reset %s '% package_nodejs)
+
 
     @classmethod
     def tearDownClass(self):
         shutil.rmtree(self.myapp_dst)
+        shutil.rmtree(self.myapp_cmake_dst)
diff --git a/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt 
b/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt
new file mode 100644
index 0000000..19d773d
--- /dev/null
+++ b/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required (VERSION 2.6)
+project (myapp)
+# The version number.
+set (myapp_VERSION_MAJOR 1)
+set (myapp_VERSION_MINOR 0)
+
+# add the executable
+add_executable (myapp myapp.c)
+
+install(TARGETS myapp
+        RUNTIME DESTINATION bin)
diff --git a/meta/lib/oeqa/sdkext/files/myapp_cmake/myapp.c b/meta/lib/oeqa/sdkext/files/myapp_cmake/myapp.c
new file mode 100644
index 0000000..f0b63f0
--- /dev/null
+++ b/meta/lib/oeqa/sdkext/files/myapp_cmake/myapp.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+       printf("Hello world\n");
+
+       return 0;
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]