summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdkext
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/sdkext')
-rw-r--r--meta/lib/oeqa/sdkext/devtool.py90
-rw-r--r--meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt11
-rw-r--r--meta/lib/oeqa/sdkext/files/myapp_cmake/myapp.c9
3 files changed, 103 insertions, 7 deletions
diff --git a/meta/lib/oeqa/sdkext/devtool.py b/meta/lib/oeqa/sdkext/devtool.py
index c5bb3102a6..ba12799094 100644
--- a/meta/lib/oeqa/sdkext/devtool.py
+++ b/meta/lib/oeqa/sdkext/devtool.py
@@ -1,32 +1,108 @@
1import shutil 1import shutil
2 2import subprocess
3import urllib.request
3from oeqa.oetest import oeSDKExtTest 4from oeqa.oetest import oeSDKExtTest
4from oeqa.utils.decorators import * 5from oeqa.utils.decorators import *
5 6
6class DevtoolTest(oeSDKExtTest): 7class DevtoolTest(oeSDKExtTest):
7
8 @classmethod 8 @classmethod
9 def setUpClass(self): 9 def setUpClass(self):
10 self.myapp_src = os.path.join(self.tc.sdkextfilesdir, "myapp") 10 self.myapp_src = os.path.join(self.tc.sdkextfilesdir, "myapp")
11 self.myapp_dst = os.path.join(self.tc.sdktestdir, "myapp") 11 self.myapp_dst = os.path.join(self.tc.sdktestdir, "myapp")
12 shutil.copytree(self.myapp_src, self.myapp_dst) 12 shutil.copytree(self.myapp_src, self.myapp_dst)
13 13
14 self.myapp_cmake_src = os.path.join(self.tc.sdkextfilesdir, "myapp_cmake")
15 self.myapp_cmake_dst = os.path.join(self.tc.sdktestdir, "myapp_cmake")
16 shutil.copytree(self.myapp_cmake_src, self.myapp_cmake_dst)
17
18 def _test_devtool_build(self, directory):
19 self._run('devtool add myapp %s' % directory)
20 try:
21 self._run('devtool build myapp')
22 except Exception as e:
23 print(e.output)
24 self._run('devtool reset myapp')
25 raise e
26 self._run('devtool reset myapp')
27
28 def _test_devtool_build_package(self, directory):
29 self._run('devtool add myapp %s' % directory)
30 try:
31 self._run('devtool package myapp')
32 except Exception as e:
33 print(e.output)
34 self._run('devtool reset myapp')
35 raise e
36 self._run('devtool reset myapp')
37
14 def test_devtool_location(self): 38 def test_devtool_location(self):
15 output = self._run('which devtool') 39 output = self._run('which devtool')
16 self.assertEqual(output.startswith(self.tc.sdktestdir), True, \ 40 self.assertEqual(output.startswith(self.tc.sdktestdir), True, \
17 msg="Seems that devtool isn't the eSDK one: %s" % output) 41 msg="Seems that devtool isn't the eSDK one: %s" % output)
18 42
19 @skipUnlessPassed('test_devtool_location') 43 @skipUnlessPassed('test_devtool_location')
20 def test_devtool_add_reset(self): 44 def test_devtool_add_reset(self):
21 self._run('devtool add myapp %s' % self.myapp_dst) 45 self._run('devtool add myapp %s' % self.myapp_dst)
22 self._run('devtool reset myapp') 46 self._run('devtool reset myapp')
47
48 @testcase(1473)
49 @skipUnlessPassed('test_devtool_location')
50 def test_devtool_build_make(self):
51 self._test_devtool_build(self.myapp_dst)
52
53 @testcase(1474)
54 @skipUnlessPassed('test_devtool_location')
55 def test_devtool_build_esdk_package(self):
56 self._test_devtool_build_package(self.myapp_dst)
23 57
58 @testcase(1479)
24 @skipUnlessPassed('test_devtool_location') 59 @skipUnlessPassed('test_devtool_location')
25 def test_devtool_build(self): 60 def test_devtool_build_cmake(self):
26 self._run('devtool add myapp %s' % self.myapp_dst) 61 self._test_devtool_build(self.myapp_cmake_dst)
27 self._run('devtool build myapp') 62
28 self._run('devtool reset myapp') 63 @testcase(1482)
64 @skipUnlessPassed('test_devtool_location')
65 def test_extend_autotools_recipe_creation(self):
66 req = 'https://github.com/rdfa/librdfa'
67 recipe = "bbexample"
68 self._run('devtool add %s %s' % (recipe, req) )
69 try:
70 self._run('devtool build %s' % recipe)
71 except Exception as e:
72 print(e.output)
73 self._run('devtool reset %s' % recipe)
74 raise e
75 self._run('devtool reset %s' % recipe)
76
77 @testcase(1484)
78 @skipUnlessPassed('test_devtool_location')
79 def test_devtool_kernelmodule(self):
80 docfile = 'https://github.com/umlaeute/v4l2loopback.git'
81 recipe = 'v4l2loopback-driver'
82 self._run('devtool add %s %s' % (recipe, docfile) )
83 try:
84 self._run('devtool build %s' % recipe)
85 except Exception as e:
86 print(e.output)
87 self._run('devtool reset %s' % recipe)
88 raise e
89 self._run('devtool reset %s' % recipe)
90
91 @testcase(1478)
92 @skipUnlessPassed('test_devtool_location')
93 def test_recipes_for_nodejs(self):
94 package_nodejs = "npm://registry.npmjs.org;name=forever;version=0.15.1"
95 self._run('devtool add %s ' % package_nodejs)
96 try:
97 self._run('devtool build %s ' % package_nodejs)
98 except Exception as e:
99 print(e.output)
100 self._run('devtool reset %s' % package_nodejs)
101 raise e
102 self._run('devtool reset %s '% package_nodejs)
103
29 104
30 @classmethod 105 @classmethod
31 def tearDownClass(self): 106 def tearDownClass(self):
32 shutil.rmtree(self.myapp_dst) 107 shutil.rmtree(self.myapp_dst)
108 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 0000000000..19d773dd63
--- /dev/null
+++ b/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt
@@ -0,0 +1,11 @@
1cmake_minimum_required (VERSION 2.6)
2project (myapp)
3# The version number.
4set (myapp_VERSION_MAJOR 1)
5set (myapp_VERSION_MINOR 0)
6
7# add the executable
8add_executable (myapp myapp.c)
9
10install(TARGETS myapp
11 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 0000000000..f0b63f03f3
--- /dev/null
+++ b/meta/lib/oeqa/sdkext/files/myapp_cmake/myapp.c
@@ -0,0 +1,9 @@
1#include <stdio.h>
2
3int
4main(int argc, char *argv[])
5{
6 printf("Hello world\n");
7
8 return 0;
9}