diff --git a/modules/core/test/test_math.cpp b/modules/core/test/test_math.cpp index 6b51d8af9..aeb3f15e6 100644 --- a/modules/core/test/test_math.cpp +++ b/modules/core/test/test_math.cpp @@ -1356,7 +1356,7 @@ void Core_DetTest::get_test_array_types_and_sizes( int test_case_idx, vector> 1; + new_mask = INT_MIN / 2; } for( ; y < height; y++, img += step ) diff --git a/modules/imgproc/test/test_imgwarp_strict.cpp b/modules/imgproc/test/test_imgwarp_strict.cpp index 07c5e0cc8..034d89014 100644 --- a/modules/imgproc/test/test_imgwarp_strict.cpp +++ b/modules/imgproc/test/test_imgwarp_strict.cpp @@ -556,7 +556,6 @@ void CV_Resize_Test::resize_1d(const Mat& _src, Mat& _dst, int dy, const dim& _d xyD[r] = 0; for (int k = 0; k < ksize; ++k) xyD[r] += w[k] * xyS[k * cn + r]; - xyD[r] = xyD[r]; } } } diff --git a/modules/ml/src/em.cpp b/modules/ml/src/em.cpp index 86cbaba24..0bd44f272 100644 --- a/modules/ml/src/em.cpp +++ b/modules/ml/src/em.cpp @@ -135,7 +135,7 @@ Vec2d EM::predict(InputArray _sample, OutputArray _probs) const sample.convertTo(tmp, CV_64FC1); sample = tmp; } - sample.reshape(1, 1); + sample = sample.reshape(1, 1); Mat probs; if( _probs.needed() ) @@ -266,7 +266,7 @@ void EM::setTrainData(int startStep, const Mat& samples, if(weights0 && (startStep == EM::START_E_STEP && covs0)) { weights0->convertTo(weights, CV_64FC1); - weights.reshape(1,1); + weights = weights.reshape(1,1); preprocessProbability(weights); } diff --git a/modules/ts/misc/run.py b/modules/ts/misc/run.py index 194ab4b50..19ab2ab7f 100755 --- a/modules/ts/misc/run.py +++ b/modules/ts/misc/run.py @@ -740,7 +740,15 @@ class TestSuite(object): print >> _stderr, "Run command:", command if self.setUp: self.setUp() - Popen(self.adb + ["shell", "export OPENCV_TEST_DATA_PATH=" + self.options.test_data_path + "&& cd " + andoidcwd + "&& ./" + command], stdout=_stdout, stderr=_stderr).wait() + env = self.options.android_env.copy() + env['OPENCV_TEST_DATA_PATH'] = self.options.test_data_path + if self.options.android_propagate_opencv_env: + for k, v in os.environ.items(): + if k.startswith('OPENCV') and not k in env: + env[k] = v + print >> _stderr, "Android environment variables: \n", '\n'.join([' %s=%s' % (k, v) for k, v in env.items()]) + commandPrefix = ''.join(['export %s=%s && ' % (k, v) for k, v in env.items()]) + Popen(self.adb + ["shell", commandPrefix + "cd " + andoidcwd + "&& ./" + command], stdout=_stdout, stderr=_stderr).wait() if self.tearDown: self.tearDown() # try get log @@ -852,6 +860,8 @@ if __name__ == "__main__": parser.add_option("-a", "--accuracy", dest="accuracy", help="look for accuracy tests instead of performance tests", action="store_true", default=False) parser.add_option("-l", "--longname", dest="useLongNames", action="store_true", help="generate log files with long names", default=False) parser.add_option("", "--android_test_data_path", dest="test_data_path", help="OPENCV_TEST_DATA_PATH for Android run", metavar="PATH", default="/sdcard/opencv_testdata/") + parser.add_option("", "--android_env", dest="android_env_array", help="Environment variable for Android run (NAME=VALUE)", action='append') + parser.add_option("", "--android_propagate_opencv_env", dest="android_propagate_opencv_env", help="Propagate OPENCV* environment variables for Android run", action="store_true", default=False) parser.add_option("", "--configuration", dest="configuration", help="force Debug or Release configuration", metavar="CFG", default="") parser.add_option("", "--serial", dest="adb_serial", help="Android: directs command to the USB device or emulator with the given serial number", metavar="serial number", default="") parser.add_option("", "--package", dest="junit_package", help="Android: run jUnit tests for specified package", metavar="package", default="") @@ -872,6 +882,12 @@ if __name__ == "__main__": print >> sys.stderr, "Usage:", os.path.basename(sys.argv[0]), "[options] [build_path]" exit(1) + options.android_env = {} + if options.android_env_array: + for entry in options.android_env_array: + k, v = entry.split("=", 1) + options.android_env[k] = v + tests = [s.strip() for s in options.tests.split(",") if s] if len(tests) != 1 or len(run_args) != 1: