Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
0773ab4d
Commit
0773ab4d
authored
Jan 23, 2013
by
Andrey Kamaev
Committed by
OpenCV Buildbot
Jan 23, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #315 from taka-no-me:java_on
parents
311d7993
2c32536b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
175 additions
and
154 deletions
+175
-154
OpenCVDetectAndroidSDK.cmake
cmake/OpenCVDetectAndroidSDK.cmake
+1
-1
OpenCVModule.cmake
cmake/OpenCVModule.cmake
+1
-0
system.cpp
modules/core/src/system.cpp
+1
-1
CMakeLists.txt
modules/java/CMakeLists.txt
+0
-0
CMakeLists.txt
modules/java/android_test/CMakeLists.txt
+1
-1
build.xml.in
modules/java/build.xml.in
+2
-1
gen_java.py
modules/java/generator/gen_java.py
+2
-15
Mat.cpp
modules/java/generator/src/cpp/Mat.cpp
+1
-22
VideoCapture.cpp
modules/java/generator/src/cpp/VideoCapture.cpp
+2
-9
common.h
modules/java/generator/src/cpp/common.h
+34
-0
converters.cpp
modules/java/generator/src/cpp/converters.cpp
+1
-9
converters.h
modules/java/generator/src/cpp/converters.h
+0
-2
core_manual.cpp
modules/java/generator/src/cpp/core_manual.cpp
+16
-0
core_manual.hpp
modules/java/generator/src/cpp/core_manual.hpp
+7
-0
jni_part.cpp
modules/java/generator/src/cpp/jni_part.cpp
+1
-1
utils.cpp
modules/java/generator/src/cpp/utils.cpp
+5
-15
CMakeLists.txt
modules/java/test/CMakeLists.txt
+41
-44
build.xml
modules/java/test/build.xml
+13
-7
junit-4.11.jar
modules/java/test/lib/junit-4.11.jar
+0
-0
OpenCVTestCase.java
modules/java/test/src/org/opencv/test/OpenCVTestCase.java
+27
-25
OpenCVTestRunner.java
modules/java/test/src/org/opencv/test/OpenCVTestRunner.java
+1
-1
CMakeLists.txt
modules/python/CMakeLists.txt
+4
-0
run.py
modules/ts/misc/run.py
+14
-0
No files found.
cmake/OpenCVDetectAndroidSDK.cmake
View file @
0773ab4d
...
...
@@ -302,7 +302,7 @@ macro(add_android_project target path)
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
android_proj_bin_dir
}
/bin/
${
target
}
-debug.apk"
# needed because ant does not update the timestamp of updated apk
WORKING_DIRECTORY
"
${
android_proj_bin_dir
}
"
MAIN_DEPENDENCY
"
${
android_proj_bin_dir
}
/
${
ANDROID_MANIFEST_FILE
}
"
DEPENDS
"
${
OpenCV_BINARY_DIR
}
/bin/
.
classes.jar.dephelper"
opencv_java
# as we are part of OpenCV we can just force this dependency
DEPENDS
"
${
OpenCV_BINARY_DIR
}
/bin/classes.jar.dephelper"
opencv_java
# as we are part of OpenCV we can just force this dependency
DEPENDS
${
android_proj_file_deps
}
${
JNI_LIB_NAME
}
)
endif
()
...
...
cmake/OpenCVModule.cmake
View file @
0773ab4d
...
...
@@ -461,6 +461,7 @@ macro(ocv_create_module)
OUTPUT_NAME
"
${
the_module
}${
OPENCV_DLLVERSION
}
"
DEBUG_POSTFIX
"
${
OPENCV_DEBUG_POSTFIX
}
"
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
LIBRARY_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
INSTALL_NAME_DIR lib
)
...
...
modules/core/src/system.cpp
View file @
0773ab4d
...
...
@@ -439,7 +439,7 @@ void error( const Exception& exc )
exc
.
func
.
c_str
()
:
"unknown function"
,
exc
.
file
.
c_str
(),
exc
.
line
);
fprintf
(
stderr
,
"%s
\n
"
,
buf
);
fflush
(
stderr
);
# ifdef
ANDROID
# ifdef
__ANDROID__
__android_log_print
(
ANDROID_LOG_ERROR
,
"cv::error()"
,
"%s"
,
buf
);
# endif
}
...
...
modules/java/CMakeLists.txt
View file @
0773ab4d
This diff is collapsed.
Click to expand it.
modules/java/android_test/CMakeLists.txt
View file @
0773ab4d
...
...
@@ -47,7 +47,7 @@ add_custom_command(
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
opencv_test_java_bin_dir
}
/bin/OpenCVTest-debug.apk"
# needed because ant does not update the timestamp of updated apk
WORKING_DIRECTORY
"
${
opencv_test_java_bin_dir
}
"
MAIN_DEPENDENCY
"
${
opencv_test_java_bin_dir
}
/
${
ANDROID_MANIFEST_FILE
}
"
DEPENDS
"
${
OpenCV_BINARY_DIR
}
/bin/.classes.jar
.dephelper"
opencv_java
DEPENDS
"
${
JAR_FILE
}
.dephelper"
opencv_java
DEPENDS
${
opencv_test_java_file_deps
}
)
add_custom_target
(
${
PROJECT_NAME
}
ALL SOURCES
"
${
opencv_test_java_bin_dir
}
/bin/OpenCVTest-debug.apk"
)
...
...
modules/java/
jar/build.xml
→
modules/java/
build.xml.in
View file @
0773ab4d
...
...
@@ -10,6 +10,6 @@
<include name="**/*.java"/>
</javac>
<jar
basedir=
"src"
destfile=
"bin/
opencv-@OPENCV_VERSION@.jar
"
/>
<jar basedir="src" destfile="bin/
@JAR_NAME@
"/>
</target>
</project>
\ No newline at end of file
modules/java/generator/gen_java.py
View file @
0773ab4d
...
...
@@ -871,22 +871,9 @@ public class %(jc)s {
// This file is auto-generated, please don't edit!
//
#include <jni.h>
#include "converters.h"
#if defined DEBUG && defined ANDROID
# include <android/log.h>
# define MODULE_LOG_TAG "OpenCV.
%(m)
s"
# define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, MODULE_LOG_TAG, __VA_ARGS__))
#else //DEBUG
# define LOGD(...)
#endif //DEBUG
#ifdef _MSC_VER
# pragma warning(disable:4800 4244)
#endif
#define LOG_TAG "org.opencv.
%(m)
s"
#include "common.h"
#include "opencv2/
%(m)
s/
%(m)
s.hpp"
using namespace cv;
...
...
modules/java/generator/src/cpp/Mat.cpp
View file @
0773ab4d
#include <jni.h>
#include "converters.h"
#ifdef ANDROID
#include <android/log.h>
#define LOG_TAG "org.opencv.core.Mat"
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
#ifdef DEBUG
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
#else //!DEBUG
#define LOGD(...)
#endif //DEBUG
#else
#define LOGE(...)
#define LOGD(...)
#endif
#ifdef _MSC_VER
# pragma warning(disable:4800)
#endif
#include "common.h"
#include "opencv2/core/core.hpp"
using
namespace
cv
;
...
...
modules/java/generator/src/cpp/VideoCapture.cpp
View file @
0773ab4d
#include <jni.h>
#if defined DEBUG && defined ANDROID
#include <android/log.h>
#define MODULE_LOG_TAG "OpenCV.highgui"
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, MODULE_LOG_TAG, __VA_ARGS__))
#else
#define LOGD(...)
#endif
#define LOG_TAG "org.opencv.highgui.VideoCapture"
#include "common.h"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_HIGHGUI
...
...
modules/java/generator/src/cpp/common.h
0 → 100644
View file @
0773ab4d
#ifndef __JAVA_COMMON_H__
#define __JAVA_COMMON_H__
#if !defined(__ppc__)
// to suppress warning from jni.h on OS X
# define TARGET_RT_MAC_CFM 0
#endif
#include <jni.h>
#ifdef __ANDROID__
# include <android/log.h>
# define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
# ifdef DEBUG
# define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
# else
# define LOGD(...)
# endif
#else
# define LOGE(...)
# define LOGD(...)
#endif
#include "converters.h"
#include "core_manual.hpp"
#include "features2d_manual.hpp"
#ifdef _MSC_VER
# pragma warning(disable:4800 4244)
#endif
#endif //__JAVA_COMMON_H__
\ No newline at end of file
modules/java/generator/src/cpp/converters.cpp
View file @
0773ab4d
#include "converters.h"
#if defined DEBUG && defined ANDROID
#include <android/log.h>
#define MODULE_LOG_TAG "OpenCV.converters"
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, MODULE_LOG_TAG, __VA_ARGS__))
#else //DEBUG
#define LOGD(...)
#endif //DEBUG
#include "common.h"
using
namespace
cv
;
...
...
modules/java/generator/src/cpp/converters.h
View file @
0773ab4d
#include <jni.h>
#include "opencv2/opencv_modules.hpp"
#include "opencv2/core/core.hpp"
#include "features2d_manual.hpp"
...
...
modules/java/generator/src/cpp/core_manual.cpp
0 → 100644
View file @
0773ab4d
#define LOG_TAG "org.opencv.core.Core"
#include "common.h"
static
int
quietCallback
(
int
,
const
char
*
,
const
char
*
,
const
char
*
,
int
,
void
*
)
{
return
0
;
}
void
cv
::
setErrorVerbosity
(
bool
verbose
)
{
if
(
verbose
)
cv
::
redirectError
(
0
);
else
cv
::
redirectError
((
cv
::
ErrorCallback
)
quietCallback
);
}
\ No newline at end of file
modules/java/generator/src/cpp/core_manual.hpp
View file @
0773ab4d
...
...
@@ -2,6 +2,13 @@
#include "opencv2/core/core.hpp"
namespace
cv
{
CV_EXPORTS_W
void
setErrorVerbosity
(
bool
verbose
);
}
#if 0
namespace cv
...
...
modules/java/generator/src/cpp/jni_part.cpp
View file @
0773ab4d
#include
<jni.h>
#include
"common.h"
#include "opencv2/opencv_modules.hpp"
...
...
modules/java/generator/src/cpp/utils.cpp
View file @
0773ab4d
#include <jni.h>
#define LOG_TAG "org.opencv.android.Utils"
#include "common.h"
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#ifdef ANDROID
#ifdef __ANDROID__
#include <android/bitmap.h>
#include <android/log.h>
#define LOG_TAG "org.opencv.android.Utils"
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
#ifdef DEBUG
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
#else //!DEBUG
#define LOGD(...)
#endif //DEBUG
using
namespace
cv
;
extern
"C"
{
/*
...
...
@@ -168,4 +158,4 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap
}
// extern "C"
#endif //ANDROID
\ No newline at end of file
#endif //__ANDROID__
\ No newline at end of file
modules/java/
java_
test/CMakeLists.txt
→
modules/java/test/CMakeLists.txt
View file @
0773ab4d
ocv_check_dependencies
(
opencv_java
${
OPENCV_MODULE_opencv_java_OPT_DEPS
}
${
OPENCV_MODULE_opencv_java_REQ_DEPS
}
)
if
(
NOT OCV_DEPENDENCIES_FOUND
OR NOT ANT_EXECUTABLE
)
if
(
NOT OCV_DEPENDENCIES_FOUND
)
return
()
endif
()
# TODO: This has the same name as the Android test project. That project should
# probably be renamed.
project
(
opencv_test_java
)
set
(
opencv_test_java_bin_dir
"
${
CMAKE_CURRENT_BINARY_DIR
}
/.build"
)
set
(
android_source_dir
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../android_test"
)
set
(
java_source_dir
${
CMAKE_CURRENT_SOURCE_DIR
}
)
# get project sources
file
(
GLOB_RECURSE opencv_test_java_files RELATIVE
"
${
android_source_dir
}
"
"
${
android_source_dir
}
/res/*"
"
${
android_source_dir
}
/src/*"
)
ocv_list_filterout
(
opencv_test_java_files
".svn"
)
ocv_list_filterout
(
opencv_test_java_files
".*#.*"
)
file
(
GLOB_RECURSE opencv_test_java_files RELATIVE
"
${
android_source_dir
}
"
"
${
android_source_dir
}
/res/*"
"
${
android_source_dir
}
/src/*.java"
)
# These are the files that need to be updated for pure Java.
ocv_list_filterout
(
opencv_test_java_files
".*OpenCVTestCase.*"
)
ocv_list_filterout
(
opencv_test_java_files
".*OpenCVTestRunner.*"
)
ocv_list_filterout
(
opencv_test_java_files
"OpenCVTest(Case|Runner).java"
)
# These files aren't for desktop Java.
ocv_list_filterout
(
opencv_test_java_files
"
.*android.*
"
)
ocv_list_filterout
(
opencv_test_java_files
"
/android/
"
)
# These are files updated for pure Java.
file
(
GLOB_RECURSE modified_files RELATIVE
"
${
java_source_dir
}
"
"
${
java_source_dir
}
/src/*"
)
ocv_list_filterout
(
modified_files
".svn"
)
ocv_list_filterout
(
modified_files
".*#.*"
)
# These are extra jars needed to run the tests.
file
(
GLOB_RECURSE lib_files RELATIVE
"
${
java_source_dir
}
"
"
${
java_source_dir
}
/lib/*"
)
ocv_list_filterout
(
lib_files
".svn"
)
ocv_list_filterout
(
lib_files
".*#.*"
)
file
(
GLOB_RECURSE lib_files RELATIVE
"
${
java_source_dir
}
"
"
${
java_source_dir
}
/lib/*.jar"
)
# copy sources out from the build tree
set
(
opencv_test_java_file_deps
""
)
foreach
(
f
${
opencv_test_java_files
}
)
add_custom_command
(
OUTPUT
"
${
opencv_test_java_bin_dir
}
/
${
f
}
"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
android_source_dir
}
/
${
f
}
"
"
${
opencv_test_java_bin
_dir
}
/
${
f
}
"
MAIN_DEPENDENCY
"
${
android_source_dir
}
/
${
f
}
"
COMMENT
"Copying
${
f
}
"
)
add_custom_command
(
OUTPUT
"
${
opencv_test_java_bin_dir
}
/
${
f
}
"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
android_source_dir
}
/
${
f
}
"
"
${
opencv_test_java_bin_dir
}
/
${
f
}
"
DEPENDS
"
${
android_source
_dir
}
/
${
f
}
"
COMMENT
"Copying
${
f
}
"
)
list
(
APPEND opencv_test_java_file_deps
"
${
android_source_dir
}
/
${
f
}
"
"
${
opencv_test_java_bin_dir
}
/
${
f
}
"
)
endforeach
()
# Overwrite select Android sources with Java-specific sources.
# Also, copy over the libs we'll need for testing.
foreach
(
f
${
modified_files
}
${
lib_files
}
)
add_custom_command
(
OUTPUT
"
${
opencv_test_java_bin_dir
}
/
${
f
}
"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
java_source_dir
}
/
${
f
}
"
"
${
opencv_test_java_bin
_dir
}
/
${
f
}
"
MAIN_DEPENDENCY
"
${
java_source_dir
}
/
${
f
}
"
COMMENT
"Copying
${
f
}
"
)
list
(
APPEND opencv_test_java_file_deps
"
${
java_source_dir
}
/
${
f
}
"
)
add_custom_command
(
OUTPUT
"
${
opencv_test_java_bin_dir
}
/
${
f
}
"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
java_source_dir
}
/
${
f
}
"
"
${
opencv_test_java_bin_dir
}
/
${
f
}
"
DEPENDS
"
${
java_source
_dir
}
/
${
f
}
"
COMMENT
"Copying
${
f
}
"
)
list
(
APPEND opencv_test_java_file_deps
"
${
java_source_dir
}
/
${
f
}
"
"
${
opencv_test_java_bin_dir
}
/
${
f
}
"
)
endforeach
()
# Copy the OpenCV jar after it has been generated.
add_custom_command
(
OUTPUT
"
${
opencv_test_java_bin_dir
}
/bin/
${
JAR_NAME
}
"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
CMAKE_BINARY_DIR
}
/bin/
${
JAR_NAME
}
"
"
${
opencv_test_java_bin_dir
}
/bin/
${
JAR_NAME
}
"
COMMENT
"Copying the OpenCV jar"
)
add_custom_target
(
copy_opencv_jar ALL SOURCES
"
${
opencv_test_java_bin_dir
}
/bin/
${
JAR_NAME
}
"
)
# ${the_module} is the target for the Java jar.
add_dependencies
(
copy_opencv_jar
${
the_module
}
)
add_custom_command
(
OUTPUT
"
${
opencv_test_java_bin_dir
}
/bin/
${
JAR_NAME
}
"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
JAR_FILE
}
"
"
${
opencv_test_java_bin_dir
}
/bin/
${
JAR_NAME
}
"
DEPENDS
"
${
JAR_FILE
}
"
COMMENT
"Copying the OpenCV jar"
)
# Copy the ant build file.
file
(
COPY
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/build.xml"
DESTINATION
"
${
opencv_test_java_bin_dir
}
"
)
add_custom_command
(
OUTPUT
"
${
opencv_test_java_bin_dir
}
/build.xml"
COMMAND
${
CMAKE_COMMAND
}
-E copy
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/build.xml"
"
${
opencv_test_java_bin_dir
}
/build.xml"
DEPENDS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/build.xml"
COMMENT
"Copying build.xml"
)
# Create a script for running the Java tests and place it in build/bin.
if
(
WIN32
)
file
(
WRITE
"
${
CMAKE_BINARY_DIR
}
/bin/opencv_test_java.cmd"
"cd
${
opencv_test_java_bin_dir
}
\n
set PATH=
${
EXECUTABLE_OUTPUT_PATH
}
/Release;%PATH%
\n
ant -DjavaLibraryPath=
${
EXECUTABLE_OUTPUT_PATH
}
/Release buildAndTest"
)
file
(
WRITE
"
${
CMAKE_BINARY_DIR
}
/bin/opencv_test_java_D.cmd"
"cd
${
opencv_test_java_bin_dir
}
\n
set PATH=
${
EXECUTABLE_OUTPUT_PATH
}
/Debug;%PATH%
\n
ant -DjavaLibraryPath=
${
EXECUTABLE_OUTPUT_PATH
}
/Debug buildAndTest"
)
else
()
file
(
WRITE
"
${
CMAKE_BINARY_DIR
}
/bin/opencv_test_java.sh"
"cd
${
opencv_test_java_bin_dir
}
;
\n
ant -DjavaLibraryPath=
${
LIBRARY_OUTPUT_PATH
}
buildAndTest;
\n
cd -"
)
endif
()
#if(WIN32)
#file(WRITE "${CMAKE_BINARY_DIR}/bin/opencv_test_java.cmd" "cd ${opencv_test_java_bin_dir}\nset PATH=${EXECUTABLE_OUTPUT_PATH}/Release;%PATH%\nant -DjavaLibraryPath=${EXECUTABLE_OUTPUT_PATH}/Release buildAndTest")
#file(WRITE "${CMAKE_BINARY_DIR}/bin/opencv_test_java_D.cmd" "cd ${opencv_test_java_bin_dir}\nset PATH=${EXECUTABLE_OUTPUT_PATH}/Debug;%PATH%\nant -DjavaLibraryPath=${EXECUTABLE_OUTPUT_PATH}/Debug buildAndTest")
#else()
#file(WRITE "${CMAKE_BINARY_DIR}/bin/opencv_test_java.sh" "cd ${opencv_test_java_bin_dir};\nant -DjavaLibraryPath=${LIBRARY_OUTPUT_PATH} buildAndTest;\ncd -")
#endif()
add_custom_command
(
OUTPUT
"
${
opencv_test_java_bin_dir
}
/build/jar/opencv-test.jar"
COMMAND
"
${
ANT_EXECUTABLE
}
"
build
WORKING_DIRECTORY
"
${
opencv_test_java_bin_dir
}
"
DEPENDS
${
opencv_test_java_file_deps
}
"
${
opencv_test_java_bin_dir
}
/build.xml"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/build.xml"
"
${
JAR_FILE
}
"
"
${
opencv_test_java_bin_dir
}
/bin/
${
JAR_NAME
}
"
COMMENT
"Build Java tests"
)
add_custom_target
(
${
PROJECT_NAME
}
ALL SOURCES
${
opencv_test_java_file_deps
}
)
add_dependencies
(
opencv_tests
${
PROJECT_NAME
}
)
add_custom_target
(
${
PROJECT_NAME
}
ALL SOURCES
"
${
opencv_test_java_bin_dir
}
/build/jar/opencv-test.jar"
)
add_dependencies
(
${
PROJECT_NAME
}
${
the_module
}
)
modules/java/
java_
test/build.xml
→
modules/java/test/build.xml
View file @
0773ab4d
...
...
@@ -16,7 +16,7 @@
<target
name=
"compile"
>
<mkdir
dir=
"build/classes"
/>
<javac
sourcepath=
""
srcdir=
"src"
destdir=
"build/classes"
>
<javac
sourcepath=
""
srcdir=
"src"
destdir=
"build/classes"
includeantruntime=
"false"
>
<include
name=
"**/*.java"
/>
<classpath
refid=
"master-classpath"
/>
</javac>
...
...
@@ -26,30 +26,36 @@
<mkdir
dir=
"build/jar"
/>
<jar
destfile=
"build/jar/opencv-test.jar"
basedir=
"build/classes"
>
<manifest>
<attribute
name=
"Main-Class"
value=
"org.opencv.test.OpenCVTestRunner"
/>
<attribute
name=
"Main-Class"
value=
"org.opencv.test.OpenCVTestRunner"
/>
</manifest>
</jar>
</target>
<target
name=
"test"
>
<mkdir
dir=
"testResults"
/>
<junit
printsummary=
"
fals
e"
haltonfailure=
"false"
haltonerror=
"false"
showoutput=
"false"
logfailedtests=
"true"
maxmemory=
"256m"
>
<junit
printsummary=
"
tru
e"
haltonfailure=
"false"
haltonerror=
"false"
showoutput=
"false"
logfailedtests=
"true"
maxmemory=
"256m"
>
<sysproperty
key=
"java.library.path"
path=
"${javaLibraryPath}"
/>
<env
key=
"PATH"
path=
"${javaLibraryPath}"
/>
<classpath
refid=
"master-classpath"
/>
<classpath>
<pathelement
location=
"build/classes"
/>
<pathelement
location=
"build/classes"
/>
</classpath>
<formatter
type=
"xml"
/>
<batchtest
fork=
"yes"
todir=
"testResults"
>
<zipfileset
src=
"build/jar/opencv-test.jar"
includes=
"**/*.class"
excludes=
"**/OpenCVTest*"
>
<exclude
name=
"**/*$*.class"
/>
</zipfileset>
<zipfileset
src=
"build/jar/opencv-test.jar"
includes=
"**/*.class"
excludes=
"**/OpenCVTest*"
>
<exclude
name=
"**/*$*.class"
/>
</zipfileset>
</batchtest>
</junit>
</target>
<target
name=
"build"
>
<antcall
target=
"compile"
/>
<antcall
target=
"jar"
/>
</target>
<target
name=
"buildAndTest"
>
<antcall
target=
"compile"
/>
<antcall
target=
"jar"
/>
...
...
modules/java/
java_
test/lib/junit-4.11.jar
→
modules/java/test/lib/junit-4.11.jar
View file @
0773ab4d
File moved
modules/java/
java_
test/src/org/opencv/test/OpenCVTestCase.java
→
modules/java/test/src/org/opencv/test/OpenCVTestCase.java
View file @
0773ab4d
...
...
@@ -96,31 +96,33 @@ public class OpenCVTestCase extends TestCase {
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
try
{
System
.
loadLibrary
(
"opencv_java"
);
}
catch
(
SecurityException
e
)
{
System
.
out
.
println
(
e
.
toString
());
System
.
exit
(-
1
);
}
catch
(
UnsatisfiedLinkError
e
)
{
System
.
out
.
println
(
e
.
toString
());
System
.
exit
(-
1
);
}
String
pwd
;
try
{
pwd
=
new
File
(
"."
).
getCanonicalPath
()
+
File
.
separator
;
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
e
);
return
;
}
OpenCVTestRunner
.
LENA_PATH
=
pwd
+
"res/drawable/lena.jpg"
;
OpenCVTestRunner
.
CHESS_PATH
=
pwd
+
"res/drawable/chessboard.jpg"
;
OpenCVTestRunner
.
LBPCASCADE_FRONTALFACE_PATH
=
pwd
+
"res/raw/lbpcascade_frontalface.xml"
;
assert
(
new
File
(
OpenCVTestRunner
.
LENA_PATH
).
exists
());
assert
(
new
File
(
OpenCVTestRunner
.
CHESS_PATH
).
exists
());
assert
(
new
File
(
OpenCVTestRunner
.
LBPCASCADE_FRONTALFACE_PATH
).
exists
());
try
{
System
.
loadLibrary
(
"opencv_java"
);
}
catch
(
SecurityException
e
)
{
System
.
out
.
println
(
e
.
toString
());
System
.
exit
(-
1
);
}
catch
(
UnsatisfiedLinkError
e
)
{
System
.
out
.
println
(
e
.
toString
());
System
.
exit
(-
1
);
}
Core
.
setErrorVerbosity
(
false
);
String
pwd
;
try
{
pwd
=
new
File
(
"."
).
getCanonicalPath
()
+
File
.
separator
;
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
e
);
return
;
}
OpenCVTestRunner
.
LENA_PATH
=
pwd
+
"res/drawable/lena.jpg"
;
OpenCVTestRunner
.
CHESS_PATH
=
pwd
+
"res/drawable/chessboard.jpg"
;
OpenCVTestRunner
.
LBPCASCADE_FRONTALFACE_PATH
=
pwd
+
"res/raw/lbpcascade_frontalface.xml"
;
assert
(
new
File
(
OpenCVTestRunner
.
LENA_PATH
).
exists
());
assert
(
new
File
(
OpenCVTestRunner
.
CHESS_PATH
).
exists
());
assert
(
new
File
(
OpenCVTestRunner
.
LBPCASCADE_FRONTALFACE_PATH
).
exists
());
dst
=
new
Mat
();
assertTrue
(
dst
.
empty
());
...
...
modules/java/
java_
test/src/org/opencv/test/OpenCVTestRunner.java
→
modules/java/test/src/org/opencv/test/OpenCVTestRunner.java
View file @
0773ab4d
...
...
@@ -39,6 +39,6 @@ public class OpenCVTestRunner {
public
static
String
getOutputFileName
(
String
name
)
{
return
getTempFileName
(
name
);
return
getTempFileName
(
name
);
}
}
modules/python/CMakeLists.txt
View file @
0773ab4d
...
...
@@ -80,6 +80,10 @@ set_target_properties(${the_module} PROPERTIES
OUTPUT_NAME cv2
SUFFIX
${
CVPY_SUFFIX
}
)
if
(
ENABLE_SOLUTION_FOLDERS
)
set_target_properties
(
${
the_module
}
PROPERTIES FOLDER
"bindings"
)
endif
()
if
(
CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-unused-function"
)
endif
()
...
...
modules/ts/misc/run.py
View file @
0773ab4d
...
...
@@ -69,6 +69,8 @@ parse_patterns = (
{
'name'
:
"ndk_path"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^(?:ANDROID_NDK|ANDROID_STANDALONE_TOOLCHAIN)?:PATH=(.*)$"
)},
{
'name'
:
"android_abi"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^ANDROID_ABI:STRING=(.*)$"
)},
{
'name'
:
"android_executable"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^ANDROID_EXECUTABLE:FILEPATH=(.*android.*)$"
)},
{
'name'
:
"ant_executable"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^ANT_EXECUTABLE:FILEPATH=(.*ant.*)$"
)},
{
'name'
:
"java_test_binary_dir"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^opencv_test_java_BINARY_DIR:STATIC=(.*)$"
)},
{
'name'
:
"is_x64"
,
'default'
:
"OFF"
,
'pattern'
:
re
.
compile
(
"^CUDA_64_BIT_DEVICE_CODE:BOOL=(ON)$"
)},
#ugly(
{
'name'
:
"cmake_generator"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_GENERATOR:INTERNAL=(.+)$"
)},
{
'name'
:
"cxx_compiler"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_COMPILER:FILEPATH=(.+)$"
)},
...
...
@@ -431,6 +433,8 @@ class TestSuite(object):
if
self
.
tests_dir
and
os
.
path
.
isdir
(
self
.
tests_dir
):
files
=
glob
.
glob
(
os
.
path
.
join
(
self
.
tests_dir
,
self
.
nameprefix
+
"*"
))
files
=
[
f
for
f
in
files
if
self
.
isTest
(
f
)]
if
self
.
ant_executable
and
self
.
java_test_binary_dir
:
files
.
append
(
"java"
)
return
files
return
[]
...
...
@@ -740,6 +744,16 @@ class TestSuite(object):
if
os
.
path
.
isfile
(
hostlogpath
):
return
hostlogpath
return
None
elif
path
==
"java"
:
cmd
=
[
self
.
ant_executable
,
"-DjavaLibraryPath="
+
self
.
tests_dir
,
"buildAndTest"
]
print
>>
_stderr
,
"Run command:"
,
" "
.
join
(
cmd
)
try
:
Popen
(
cmd
,
stdout
=
_stdout
,
stderr
=
_stderr
,
cwd
=
self
.
java_test_binary_dir
+
"/.build"
)
.
wait
()
except
OSError
:
pass
return
None
else
:
cmd
=
[
exe
]
if
self
.
options
.
help
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment