1 #!/bin/sh 2 3 BASE_DIR=`dirname $0` 4 OPENCV_TEST_PATH=$BASE_DIR/@TEST_PATH@ 5 OPENCV_TEST_DATA_PATH=$BASE_DIR/sdk/etc/testdata/ 6 7 if [ $# -ne 1 ]; then 8 echo "Device architecture is not preset in command line" 9 echo "Tests are available for architectures: `ls -m ${OPENCV_TEST_PATH}`" 10 echo "Usage: $0 <target_device_arch>" 11 return 1 12 else 13 TARGET_ARCH=$1 14 fi 15 16 if [ -z `which adb` ]; then 17 echo "adb command was not found in PATH" 18 return 1 19 fi 20 21 adb push $OPENCV_TEST_DATA_PATH /sdcard/opencv_testdata 22 23 adb shell "mkdir -p /data/local/tmp/opencv_test" 24 SUMMARY_STATUS=0 25 for t in "$OPENCV_TEST_PATH/$TARGET_ARCH/"opencv_test_* "$OPENCV_TEST_PATH/$TARGET_ARCH/"opencv_perf_*; 26 do 27 test_name=`basename "$t"` 28 report="$test_name-`date --rfc-3339=date`.xml" 29 adb push $t /data/local/tmp/opencv_test/ 30 adb shell "export OPENCV_TEST_DATA_PATH=/sdcard/opencv_testdata && /data/local/tmp/opencv_test/$test_name --perf_min_samples=1 --perf_force_samples=1 --gtest_output=xml:/data/local/tmp/opencv_test/$report" 31 adb pull "/data/local/tmp/opencv_test/$report" $report 32 TEST_STATUS=0 33 if [ -e $report ]; then 34 if [ `grep -c "<fail" $report` -ne 0 ]; then 35 TEST_STATUS=2 36 fi 37 else 38 TEST_STATUS=3 39 fi 40 if [ $TEST_STATUS -ne 0 ]; then 41 SUMMARY_STATUS=$TEST_STATUS 42 fi 43 done 44 45 if [ $SUMMARY_STATUS -eq 0 ]; then 46 echo "All OpenCV tests finished successfully" 47 else 48 echo "OpenCV tests finished with status $SUMMARY_STATUS" 49 fi 50 51 return $SUMMARY_STATUS