aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/runtime/mytest.py25
-rw-r--r--meta/recipes-test/hello-dut/files/hello.c8
-rw-r--r--meta/recipes-test/hello-dut/hello-dut_0.1.bb15
-rw-r--r--meta/recipes-test/hello-native/files/hello.c9
-rw-r--r--meta/recipes-test/hello-native/hello_0.1.bb16
-rw-r--r--meta/recipes-test/hello-test/files/hello.c9
-rw-r--r--meta/recipes-test/hello-test/hello-test_0.1.bb16
7 files changed, 98 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/mytest.py b/meta/lib/oeqa/runtime/mytest.py
new file mode 100644
index 00000000000..6afb79e19c9
--- /dev/null
+++ b/meta/lib/oeqa/runtime/mytest.py
@@ -0,0 +1,25 @@
+import os
+from time import sleep
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import TestNeedsBin
+
+class mytest(oeRuntimeTest):
+
+############### A simple test for the DUT ######################
+
+ @TestNeedsBin(("hello-dut","rm"),
+ ("hello-test","rm"),
+ ("hello-test","rpm","rm"),
+ ("hello-dut","rpm"),
+ ("hello","native")
+ )
+ def test_hello_on_DUT_3(self):
+ (status, output) = self.target.run("hello")
+ self.a=5
+ print("For hello: " + str(output) + "\n")
+ (status1,output1) = self.target.run("hello-test")
+ print("For hello-test: " + str(output1) + "\n")
+ self.assertEqual(status, 0, "failed for hello")
+ self.assertEqual(status1, 0, "failed for hello-test")
+
+
diff --git a/meta/recipes-test/hello-dut/files/hello.c b/meta/recipes-test/hello-dut/files/hello.c
new file mode 100644
index 00000000000..fb89415c9ff
--- /dev/null
+++ b/meta/recipes-test/hello-dut/files/hello.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int main(int argc, char** argv)
+{
+ printf("Hello world on DUT \n");
+ return 0;
+
+}
diff --git a/meta/recipes-test/hello-dut/hello-dut_0.1.bb b/meta/recipes-test/hello-dut/hello-dut_0.1.bb
new file mode 100644
index 00000000000..832b62fa872
--- /dev/null
+++ b/meta/recipes-test/hello-dut/hello-dut_0.1.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Hello world recipe"
+DESCRIPTION = "test application"
+LICENSE = "CLOSED"
+SRC_URI = "file://hello.c \
+"
+S = "${WORKDIR}"
+do_compile() {
+ ${CC} hello.c -o hello
+}
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 0755 hello ${D}/${bindir}
+}
+
diff --git a/meta/recipes-test/hello-native/files/hello.c b/meta/recipes-test/hello-native/files/hello.c
new file mode 100644
index 00000000000..ed30d69d15f
--- /dev/null
+++ b/meta/recipes-test/hello-native/files/hello.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int main(int argc, char** argv)
+{
+ printf("Hello world on host machine \n");
+
+ return 0;
+
+}
diff --git a/meta/recipes-test/hello-native/hello_0.1.bb b/meta/recipes-test/hello-native/hello_0.1.bb
new file mode 100644
index 00000000000..42659b92a89
--- /dev/null
+++ b/meta/recipes-test/hello-native/hello_0.1.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Hello world recipe"
+DESCRIPTION = "test application"
+LICENSE = "CLOSED"
+SRC_URI = "file://hello.c \
+"
+S = "${WORKDIR}"
+do_compile() {
+ ${CC} hello.c -o hello
+}
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 0755 hello ${D}/${bindir}
+}
+
+BBCLASSEXTEND = "nativesdk native"
diff --git a/meta/recipes-test/hello-test/files/hello.c b/meta/recipes-test/hello-test/files/hello.c
new file mode 100644
index 00000000000..405aed1c706
--- /dev/null
+++ b/meta/recipes-test/hello-test/files/hello.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int main(int argc, char** argv)
+{
+ printf("Hello test \n");
+
+ return 0;
+
+}
diff --git a/meta/recipes-test/hello-test/hello-test_0.1.bb b/meta/recipes-test/hello-test/hello-test_0.1.bb
new file mode 100644
index 00000000000..9832eb0f132
--- /dev/null
+++ b/meta/recipes-test/hello-test/hello-test_0.1.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Hello world recipe"
+DESCRIPTION = "test application"
+LICENSE = "CLOSED"
+SRC_URI = "file://hello.c \
+"
+S = "${WORKDIR}"
+do_compile() {
+ ${CC} hello.c -o hello-test
+}
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 0755 hello-test ${D}/${bindir}
+}
+
+BBCLASSEXTEND = "nativesdk native"