imagetest-qemu: Allow the task to run after any rootfs is created and also standalone
authorRichard Purdie <rpurdie@linux.intel.com>
Sun, 28 Nov 2010 14:45:31 +0000 (14:45 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 7 Dec 2010 12:31:09 +0000 (12:31 +0000)
One bitbake invocation can cause multiple images to be generated. We should test
each one and we cna do this by running after the rootfs task. Running the tests
standlone is also still possible with a new separate standlone task.

Acked-by: Scott Garman <scott.a.garman@intel.com>
Acked-by: Jiajun Xu <jiajun.xu@intel.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
meta/classes/imagetest-qemu.bbclass

index 07bdf01..4b3ddfc 100644 (file)
@@ -1,8 +1,3 @@
-addtask qemuimagetest before do_build
-# after do_rootfs
-do_qemuimagetest[nostamp] = "1"
-do_qemuimagetest[depends] += "qemu-native:do_populate_sysroot"
-
 # Test related variables
 # By default, TEST_DIR is created under WORKDIR
 TEST_DIR ?= "${WORKDIR}/qemuimagetest"
@@ -12,6 +7,20 @@ TEST_TMP ?= "${TEST_DIR}/tmp"
 TEST_SCEN ?= "sanity"
 
 python do_qemuimagetest() {
+    qemuimagetest_main(d)
+}
+addtask qemuimagetest before do_build after do_rootfs
+do_qemuimagetest[nostamp] = "1"
+do_qemuimagetest[depends] += "qemu-native:do_populate_sysroot"
+
+python do_qemuimagetest_standalone() {
+    qemuimagetest_main(d)
+}
+addtask qemuimagetest_standalone
+do_qemuimagetest_standalone[nostamp] = "1"
+do_qemuimagetest_standalone[depends] += "qemu-native:do_populate_sysroot"
+
+def qemuimagetest_main(d):
     import sys
     import re
     import os
@@ -142,4 +151,4 @@ python do_qemuimagetest() {
 
     if ret != 0:
         raise bb.build.FuncFailed("Some testcases fail, pls. check test result and test log!!!")
-}
+