Skip to content

Commit f0c8b93

Browse files
committed
Public CI OpenCV Shell Scripts
Added shell script for OpenVC testcases Added Readme for OpenVC Testcases Signed-off-by: Abhishek Bajaj <[email protected]>
1 parent dd035c5 commit f0c8b93

File tree

1 file changed

+34
-13
lines changed
  • Runner/suites/Multimedia/OpenCV

1 file changed

+34
-13
lines changed

Runner/suites/Multimedia/OpenCV/run.sh

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,58 @@
1+
#!/bin/sh
2+
13
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
24
# SPDX-License-Identifier: BSD-3-Clause-Clear
35

4-
#!/bin/sh
5-
# Import test suite definitions
6-
. $(pwd)/init_env
7-
TESTNAME="Opencv_core"
6+
# --------- Robustly source init_env and functestlib.sh ----------
7+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8+
INIT_ENV=""
9+
SEARCH="$SCRIPT_DIR"
10+
while [ "$SEARCH" != "/" ]; do
11+
if [ -f "$SEARCH/init_env" ]; then
12+
INIT_ENV="$SEARCH/init_env"
13+
break
14+
fi
15+
SEARCH=$(dirname "$SEARCH")
16+
done
17+
18+
if [ -z "$INIT_ENV" ]; then
19+
echo "[ERROR] Could not find init_env (starting at $SCRIPT_DIR)" >&2
20+
exit 1
21+
fi
822

9-
# Import test functions
10-
. $TOOLS/functestlib.sh
23+
if [ -z "$__INIT_ENV_LOADED" ]; then
24+
# shellcheck disable=SC1090
25+
. "$INIT_ENV"
26+
fi
27+
# shellcheck disable=SC1090,SC1091
28+
. "$TOOLS/functestlib.sh"
29+
# ---------------------------------------------------------------
1130

31+
TESTNAME="Opencv_core"
1232
test_path=$(find_test_case_by_name "$TESTNAME")
33+
cd "$test_path" || exit 1
34+
1335
log_info "-----------------------------------------------------------------------------------------"
1436
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
1537

1638

1739
log_info "Checking if dependency binary is available"
18-
check_dependencies opencv_test_core
40+
check_dependencies opencv_test_core grep chmod
1941

2042
# Navigate to the directory where the fastrpc_test application is located
21-
cd /usr/bin/
22-
chmod 777 opencv_test_core
43+
chmod 777 /usr/bin/opencv_test_core
2344

2445
# Execute the command and capture the output
25-
export OPENCV_OPENCL_RUNTIME=disabled && /usr/bin/opencv_perf_core --gtest_filter=Core_AddMixed/ArithmMixedTest.accuracy/0 > /data/opencv_core_result.txt
46+
export OPENCV_OPENCL_RUNTIME=disabled && /usr/bin/opencv_test_core --gtest_filter=Core_AddMixed/ArithmMixedTest.accuracy/0 > opencv_core_result.txt
2647

2748
# Check the log file for the string "SUCCESS" to determine if the test passed
28-
if grep -q "PASSED" /data/opencv_core_result.txt; then
49+
if grep -q "PASSED" opencv_core_result.txt; then
2950
log_pass "$TESTNAME : Test Passed"
30-
echo "$TESTNAME PASS" > $test_path/$TESTNAME.res
51+
echo "$TESTNAME PASS" > "$test_path/$TESTNAME.res"
3152

3253
else
3354
log_fail "$TESTNAME : Test Failed"
34-
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
55+
echo "$TESTNAME FAIL" > "$test_path/$TESTNAME.res"
3556
fi
3657

3758
# Print the completion of the test case

0 commit comments

Comments
 (0)