Enable sanity tests: - test libxcam library can compile libxcam soft sample application - test libxcam soft sample app can perform image remap
Signed-off-by: Yeoh Ee Peng <[email protected]> --- lib/oeqa/runtime/cases/libxcam.py | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 lib/oeqa/runtime/cases/libxcam.py diff --git a/lib/oeqa/runtime/cases/libxcam.py b/lib/oeqa/runtime/cases/libxcam.py new file mode 100644 index 0000000..6ff714d --- /dev/null +++ b/lib/oeqa/runtime/cases/libxcam.py @@ -0,0 +1,53 @@ +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.runtime.decorator.package import OEHasPackage +from oeqa.core.decorator.depends import OETestDepends +import os +script_path = os.path.dirname(os.path.realpath(__file__)) +files_path = os.path.join(script_path, '../files/') + +class LibxcamTest(OERuntimeTestCase): + libxcam_test_files = {'soft_case': 'test-soft-image.cpp'} + yuv_file = 'vtest.yuv' + soft_test_app_file = 'test-soft' + libxcam_src_file_dir = '/usr/bin/libxcam/test-src/' + libxcam_file_dir = '/tmp/' + + @classmethod + def tearDownClass(cls): + cls.tc.target.run("rm %s%s" % (cls.libxcam_file_dir, cls.yuv_file)) + cls.tc.target.run('rm %s%s' % (cls.libxcam_file_dir, cls.soft_test_app_file)) + + @OEHasPackage(['gstreamer1.0-plugins-base']) + @OEHasPackage(['gstreamer1.0-plugins-good']) + @OEHasPackage(['gstreamer1.0-vaapi']) + @OEHasPackage(['intel-vaapi-driver']) + def test_libxcam_can_generate_yuv_file_with_gstreamer(self): + (status, output) = self.target.run('gst-inspect-1.0 vaapi') + self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) + + (status, output) = self.target.run('gst-launch-1.0 -ev videotestsrc num-buffers=60 ! ' + 'timeoverlay ! filesink location=%s%s' % + (self.libxcam_file_dir, self.yuv_file)) + self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) + + @OEHasPackage(['libxcam']) + @OEHasPackage(['libxcam-dev']) + @OEHasPackage(['libxcam-test']) + def test_libxcam_can_compile_soft_test_app(self): + (status, output) = self.target.run('c++ %s%s -o %s%s ' + '-I /usr/include/xcam/ -lxcam_soft -lxcam_core -lpthread' % + (self.libxcam_src_file_dir, + self.libxcam_test_files['soft_case'], + self.libxcam_file_dir, + self.soft_test_app_file)) + self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) + + @OETestDepends(['libxcam.LibxcamTest.test_libxcam_can_compile_soft_test_app']) + @OETestDepends(['libxcam.LibxcamTest.test_libxcam_can_generate_yuv_file_with_gstreamer']) + def test_libxcam_can_execute_soft_image_improve_app(self): + (status, output) = self.target.run('%s%s --type remap --input0 %s%s --output soft_out.nv12 --save false' % + (self.libxcam_file_dir, + self.soft_test_app_file, + self.libxcam_file_dir, + self.yuv_file)) + self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) -- 2.7.4
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#6444): https://lists.yoctoproject.org/g/meta-intel/message/6444 Mute This Topic: https://lists.yoctoproject.org/mt/72557598/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
