[Test] Add plugin dependency and cmake build check.
authorsewon.oh <sewon.oh@samsung.com>
Thu, 28 Jun 2018 09:22:16 +0000 (18:22 +0900)
committer임근식/동작제어Lab(SR)/Principal Engineer/삼성전자 <geunsik.lim@samsung.com>
Fri, 29 Jun 2018 03:53:24 +0000 (12:53 +0900)
- testAPI.sh: using find and gst-inspect-1.0 to check dependency

Signed-off-by: Sewon Oh <sewon.oh@samsung.com>
tests/testAPI.sh

index b9ef568..0dc8156 100644 (file)
@@ -1,6 +1,11 @@
 #!/usr/bin/env bash
+
 if [[ $# -eq 0 ]]; then
        dirpath="$( cd "$( dirname "$0")" && pwd )"
+       find "$dirpath/../build/gst/tensor_converter" "$dirpath/../build/gst/tensor_filter" "$dirpath/../build/gst/tensor_decoder" 1>/dev/null || {
+               echo "[ERROR] Before unit testing, you should build with cmake first."
+               exit 1
+       }
        PATH_TO_PLUGIN="$dirpath/../build/gst/tensor_converter:$dirpath/../build/gst/tensor_filter:$dirpath/../build/gst/tensor_decoder"
 else
        PATH_TO_PLUGIN="$1"
@@ -31,6 +36,12 @@ function checkDependency {
 checkDependency gst-launch-1.0
 checkDependency cmp
 
+gst-inspect-1.0 pngdec 1>/dev/null || {
+       echo "The plugin 'pngdec' is currently not installed. You can install it by typing:"
+       echo "sudo apt install gstreamer1.0-plugins-good"
+       exit 1
+}
+
 ##
 # @brief execute gst-launch based test case
 # @param 1 the whole parameters