From 0550b2c1fea4255e8bc9b2297e463dec79405d72 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Tue, 19 May 2015 18:17:28 +0300 Subject: [PATCH 1/3] check that current directory has write access --- cmake/templates/opencv_run_all_tests_unix.sh.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/templates/opencv_run_all_tests_unix.sh.in b/cmake/templates/opencv_run_all_tests_unix.sh.in index 7b946af13..a21bb03fd 100644 --- a/cmake/templates/opencv_run_all_tests_unix.sh.in +++ b/cmake/templates/opencv_run_all_tests_unix.sh.in @@ -55,6 +55,15 @@ OPENCV_TEST_PATH=@CMAKE_INSTALL_PREFIX@/@OPENCV_TEST_INSTALL_PATH@ OPENCV_PYTHON_TESTS=@OPENCV_PYTHON_TESTS_LIST@ export OPENCV_TEST_DATA_PATH=@CMAKE_INSTALL_PREFIX@/share/OpenCV/testdata +CUR_DIR=`pwd` +if [ -d "$CUR_DIR" -a -w "$CUR_DIR" ]; then + echo "${TEXT_CYAN}CUR_DIR : $CUR_DIR${TEXT_RESET}" +else + echo "${TEXT_RED}Error: Do not have permissions to write to $CUR_DIR${TEXT_RESET}" + echo "${TEXT_RED}Please run the script from directory with write access${TEXT_RESET}" + exit 1 +fi + # Run tests SUMMARY_STATUS=0 From 5d66b1130b78cf30697ae12da4072bcfc8f91aec Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Tue, 19 May 2015 18:22:30 +0300 Subject: [PATCH 2/3] save tests console output to separate log files --- cmake/templates/opencv_run_all_tests_unix.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/templates/opencv_run_all_tests_unix.sh.in b/cmake/templates/opencv_run_all_tests_unix.sh.in index a21bb03fd..9789a6b7f 100644 --- a/cmake/templates/opencv_run_all_tests_unix.sh.in +++ b/cmake/templates/opencv_run_all_tests_unix.sh.in @@ -88,7 +88,7 @@ do fi echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RUN : $cmd" - $cmd | sed -r "$seg_reg" + eval "$cmd" | tee "$test_name.log" | sed -r "$seg_reg" ret=${PIPESTATUS[0]} echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RETURN_CODE : $ret" @@ -114,7 +114,7 @@ do seg_reg="s/^/${TEXT_CYAN}[$test_name]${TEXT_RESET} /" # append test name echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RUN : $cmd" - eval "$cmd" | sed -r "$seg_reg" + eval "$cmd" | tee "$test_name.log" | sed -r "$seg_reg" ret=${PIPESTATUS[0]} echo "${TEXT_CYAN}[$test_name]${TEXT_RESET} RETURN_CODE : $ret" From 21d8b588a2c8c2f076c29239191d41c5e8ffc7fe Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Tue, 19 May 2015 18:23:10 +0300 Subject: [PATCH 3/3] exclude dates from report names --- cmake/templates/opencv_run_all_tests_unix.sh.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmake/templates/opencv_run_all_tests_unix.sh.in b/cmake/templates/opencv_run_all_tests_unix.sh.in index 9789a6b7f..f92d7c613 100644 --- a/cmake/templates/opencv_run_all_tests_unix.sh.in +++ b/cmake/templates/opencv_run_all_tests_unix.sh.in @@ -73,9 +73,8 @@ PASSED_TESTS="" for t in "$OPENCV_TEST_PATH/"opencv_test_* "$OPENCV_TEST_PATH/"opencv_perf_*; do test_name=`basename "$t"` - report="$test_name-`date --rfc-3339=date`.xml" - cmd="$t --perf_min_samples=1 --perf_force_samples=1 --gtest_output=xml:\"$report\"" + cmd="$t --perf_min_samples=1 --perf_force_samples=1 --gtest_output=xml:$test_name.xml" seg_reg="s/^/${TEXT_CYAN}[$test_name]${TEXT_RESET} /" # append test name if [ $COLOR_OUTPUT -eq 1 ]; then @@ -107,9 +106,8 @@ done for t in $OPENCV_PYTHON_TESTS; do test_name=`basename "$t"` - report="$test_name-`date --rfc-3339=date`.xml" - cmd="py.test --junitxml $report \"$OPENCV_TEST_PATH\"/$t" + cmd="py.test --junitxml $test_name.xml \"$OPENCV_TEST_PATH\"/$t" seg_reg="s/^/${TEXT_CYAN}[$test_name]${TEXT_RESET} /" # append test name