Commit 0773ab4d authored by Andrey Kamaev's avatar Andrey Kamaev Committed by OpenCV Buildbot

Merge pull request #315 from taka-no-me:java_on

parents 311d7993 2c32536b
...@@ -302,7 +302,7 @@ macro(add_android_project target path) ...@@ -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 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}" WORKING_DIRECTORY "${android_proj_bin_dir}"
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}" 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}) DEPENDS ${android_proj_file_deps} ${JNI_LIB_NAME})
endif() endif()
......
...@@ -461,6 +461,7 @@ macro(ocv_create_module) ...@@ -461,6 +461,7 @@ macro(ocv_create_module)
OUTPUT_NAME "${the_module}${OPENCV_DLLVERSION}" OUTPUT_NAME "${the_module}${OPENCV_DLLVERSION}"
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
INSTALL_NAME_DIR lib INSTALL_NAME_DIR lib
) )
......
...@@ -439,7 +439,7 @@ void error( const Exception& exc ) ...@@ -439,7 +439,7 @@ void error( const Exception& exc )
exc.func.c_str() : "unknown function", exc.file.c_str(), exc.line ); exc.func.c_str() : "unknown function", exc.file.c_str(), exc.line );
fprintf( stderr, "%s\n", buf ); fprintf( stderr, "%s\n", buf );
fflush( stderr ); fflush( stderr );
# ifdef ANDROID # ifdef __ANDROID__
__android_log_print(ANDROID_LOG_ERROR, "cv::error()", "%s", buf); __android_log_print(ANDROID_LOG_ERROR, "cv::error()", "%s", buf);
# endif # endif
} }
......
This diff is collapsed.
...@@ -47,7 +47,7 @@ add_custom_command( ...@@ -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 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}" WORKING_DIRECTORY "${opencv_test_java_bin_dir}"
MAIN_DEPENDENCY "${opencv_test_java_bin_dir}/${ANDROID_MANIFEST_FILE}" 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}) DEPENDS ${opencv_test_java_file_deps})
add_custom_target(${PROJECT_NAME} ALL SOURCES "${opencv_test_java_bin_dir}/bin/OpenCVTest-debug.apk" ) add_custom_target(${PROJECT_NAME} ALL SOURCES "${opencv_test_java_bin_dir}/bin/OpenCVTest-debug.apk" )
......
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
<include name="**/*.java"/> <include name="**/*.java"/>
</javac> </javac>
<jar basedir="src" destfile="bin/opencv-@OPENCV_VERSION@.jar"/> <jar basedir="src" destfile="bin/@JAR_NAME@"/>
</target> </target>
</project> </project>
\ No newline at end of file
...@@ -871,22 +871,9 @@ public class %(jc)s { ...@@ -871,22 +871,9 @@ public class %(jc)s {
// This file is auto-generated, please don't edit! // This file is auto-generated, please don't edit!
// //
#include <jni.h> #define LOG_TAG "org.opencv.%(m)s"
#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
#include "common.h"
#include "opencv2/%(m)s/%(m)s.hpp" #include "opencv2/%(m)s/%(m)s.hpp"
using namespace cv; using namespace cv;
......
#include <jni.h>
#include "converters.h"
#ifdef ANDROID
#include <android/log.h>
#define LOG_TAG "org.opencv.core.Mat" #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" #include "opencv2/core/core.hpp"
using namespace cv; using namespace cv;
......
#include <jni.h> #define LOG_TAG "org.opencv.highgui.VideoCapture"
#include "common.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
#include "opencv2/opencv_modules.hpp" #include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_HIGHGUI #ifdef HAVE_OPENCV_HIGHGUI
......
#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
#include "converters.h" #include "common.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
using namespace cv; using namespace cv;
......
#include <jni.h>
#include "opencv2/opencv_modules.hpp" #include "opencv2/opencv_modules.hpp"
#include "opencv2/core/core.hpp" #include "opencv2/core/core.hpp"
#include "features2d_manual.hpp" #include "features2d_manual.hpp"
......
#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
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
#include "opencv2/core/core.hpp" #include "opencv2/core/core.hpp"
namespace cv
{
CV_EXPORTS_W void setErrorVerbosity(bool verbose);
}
#if 0 #if 0
namespace cv namespace cv
......
#include <jni.h> #include "common.h"
#include "opencv2/opencv_modules.hpp" #include "opencv2/opencv_modules.hpp"
......
#include <jni.h> #define LOG_TAG "org.opencv.android.Utils"
#include "common.h"
#include "opencv2/core/core.hpp" #include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp" #include "opencv2/imgproc/imgproc.hpp"
#ifdef ANDROID #ifdef __ANDROID__
#include <android/bitmap.h> #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; using namespace cv;
extern "C" { extern "C" {
/* /*
...@@ -168,4 +158,4 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap ...@@ -168,4 +158,4 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap
} // extern "C" } // extern "C"
#endif //ANDROID #endif //__ANDROID__
\ No newline at end of file \ No newline at end of file
ocv_check_dependencies(opencv_java ${OPENCV_MODULE_opencv_java_OPT_DEPS} ${OPENCV_MODULE_opencv_java_REQ_DEPS}) 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() return()
endif() endif()
# TODO: This has the same name as the Android test project. That project should
# probably be renamed.
project(opencv_test_java) project(opencv_test_java)
set(opencv_test_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build") set(opencv_test_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build")
set(android_source_dir "${CMAKE_CURRENT_SOURCE_DIR}/../android_test") set(android_source_dir "${CMAKE_CURRENT_SOURCE_DIR}/../android_test")
set(java_source_dir ${CMAKE_CURRENT_SOURCE_DIR}) set(java_source_dir ${CMAKE_CURRENT_SOURCE_DIR})
# get project sources # get project sources
file(GLOB_RECURSE opencv_test_java_files RELATIVE "${android_source_dir}" "${android_source_dir}/res/*" "${android_source_dir}/src/*") file(GLOB_RECURSE opencv_test_java_files RELATIVE "${android_source_dir}" "${android_source_dir}/res/*" "${android_source_dir}/src/*.java")
ocv_list_filterout(opencv_test_java_files ".svn")
ocv_list_filterout(opencv_test_java_files ".*#.*")
# These are the files that need to be updated for pure 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 "OpenCVTest(Case|Runner).java")
ocv_list_filterout(opencv_test_java_files ".*OpenCVTestRunner.*")
# These files aren't for desktop 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. # These are files updated for pure Java.
file(GLOB_RECURSE modified_files RELATIVE "${java_source_dir}" "${java_source_dir}/src/*") 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. # These are extra jars needed to run the tests.
file(GLOB_RECURSE lib_files RELATIVE "${java_source_dir}" "${java_source_dir}/lib/*") file(GLOB_RECURSE lib_files RELATIVE "${java_source_dir}" "${java_source_dir}/lib/*.jar")
ocv_list_filterout(lib_files ".svn")
ocv_list_filterout(lib_files ".*#.*")
# copy sources out from the build tree # copy sources out from the build tree
set(opencv_test_java_file_deps "") set(opencv_test_java_file_deps "")
foreach(f ${opencv_test_java_files}) foreach(f ${opencv_test_java_files})
add_custom_command( add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/${f}"
OUTPUT "${opencv_test_java_bin_dir}/${f}"
COMMAND ${CMAKE_COMMAND} -E copy "${android_source_dir}/${f}" "${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}" DEPENDS "${android_source_dir}/${f}"
COMMENT "Copying ${f}") COMMENT "Copying ${f}"
)
list(APPEND opencv_test_java_file_deps "${android_source_dir}/${f}" "${opencv_test_java_bin_dir}/${f}") list(APPEND opencv_test_java_file_deps "${android_source_dir}/${f}" "${opencv_test_java_bin_dir}/${f}")
endforeach() endforeach()
# Overwrite select Android sources with Java-specific sources. # Overwrite select Android sources with Java-specific sources.
# Also, copy over the libs we'll need for testing. # Also, copy over the libs we'll need for testing.
foreach(f ${modified_files} ${lib_files}) foreach(f ${modified_files} ${lib_files})
add_custom_command( add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/${f}"
OUTPUT "${opencv_test_java_bin_dir}/${f}"
COMMAND ${CMAKE_COMMAND} -E copy "${java_source_dir}/${f}" "${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}" DEPENDS "${java_source_dir}/${f}"
COMMENT "Copying ${f}") COMMENT "Copying ${f}"
list(APPEND opencv_test_java_file_deps "${java_source_dir}/${f}") )
list(APPEND opencv_test_java_file_deps "${java_source_dir}/${f}" "${opencv_test_java_bin_dir}/${f}")
endforeach() endforeach()
# Copy the OpenCV jar after it has been generated. # Copy the OpenCV jar after it has been generated.
add_custom_command( add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/bin/${JAR_NAME}"
OUTPUT "${opencv_test_java_bin_dir}/bin/${JAR_NAME}" COMMAND ${CMAKE_COMMAND} -E copy "${JAR_FILE}" "${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}" DEPENDS "${JAR_FILE}"
COMMENT "Copying the OpenCV jar") 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})
# Copy the ant build file. add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/build.xml"
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/build.xml" DESTINATION "${opencv_test_java_bin_dir}") 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. # Create a script for running the Java tests and place it in build/bin.
if(WIN32) #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.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") #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() #else()
file(WRITE "${CMAKE_BINARY_DIR}/bin/opencv_test_java.sh" "cd ${opencv_test_java_bin_dir};\nant -DjavaLibraryPath=${LIBRARY_OUTPUT_PATH} buildAndTest;\ncd -") #file(WRITE "${CMAKE_BINARY_DIR}/bin/opencv_test_java.sh" "cd ${opencv_test_java_bin_dir};\nant -DjavaLibraryPath=${LIBRARY_OUTPUT_PATH} buildAndTest;\ncd -")
endif() #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_custom_target(${PROJECT_NAME} ALL SOURCES "${opencv_test_java_bin_dir}/build/jar/opencv-test.jar")
add_dependencies(opencv_tests ${PROJECT_NAME}) add_dependencies(${PROJECT_NAME} ${the_module})
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<target name="compile"> <target name="compile">
<mkdir dir="build/classes"/> <mkdir dir="build/classes"/>
<javac sourcepath="" srcdir="src" destdir="build/classes" > <javac sourcepath="" srcdir="src" destdir="build/classes" includeantruntime="false" >
<include name="**/*.java"/> <include name="**/*.java"/>
<classpath refid="master-classpath"/> <classpath refid="master-classpath"/>
</javac> </javac>
...@@ -33,8 +33,9 @@ ...@@ -33,8 +33,9 @@
<target name="test"> <target name="test">
<mkdir dir="testResults"/> <mkdir dir="testResults"/>
<junit printsummary="false" haltonfailure="false" haltonerror="false" showoutput="false" logfailedtests="true" maxmemory="256m"> <junit printsummary="true" haltonfailure="false" haltonerror="false" showoutput="false" logfailedtests="true" maxmemory="256m">
<sysproperty key="java.library.path" path="${javaLibraryPath}"/> <sysproperty key="java.library.path" path="${javaLibraryPath}"/>
<env key="PATH" path="${javaLibraryPath}"/>
<classpath refid="master-classpath"/> <classpath refid="master-classpath"/>
<classpath> <classpath>
<pathelement location="build/classes"/> <pathelement location="build/classes"/>
...@@ -50,6 +51,11 @@ ...@@ -50,6 +51,11 @@
</junit> </junit>
</target> </target>
<target name="build">
<antcall target="compile"/>
<antcall target="jar"/>
</target>
<target name="buildAndTest"> <target name="buildAndTest">
<antcall target="compile"/> <antcall target="compile"/>
<antcall target="jar"/> <antcall target="jar"/>
......
...@@ -106,6 +106,8 @@ public class OpenCVTestCase extends TestCase { ...@@ -106,6 +106,8 @@ public class OpenCVTestCase extends TestCase {
System.exit(-1); System.exit(-1);
} }
Core.setErrorVerbosity(false);
String pwd; String pwd;
try { try {
pwd = new File(".").getCanonicalPath() + File.separator; pwd = new File(".").getCanonicalPath() + File.separator;
......
...@@ -80,6 +80,10 @@ set_target_properties(${the_module} PROPERTIES ...@@ -80,6 +80,10 @@ set_target_properties(${the_module} PROPERTIES
OUTPUT_NAME cv2 OUTPUT_NAME cv2
SUFFIX ${CVPY_SUFFIX}) 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) if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
endif() endif()
......
...@@ -69,6 +69,8 @@ parse_patterns = ( ...@@ -69,6 +69,8 @@ parse_patterns = (
{'name': "ndk_path", 'default': None, 'pattern': re.compile("^(?:ANDROID_NDK|ANDROID_STANDALONE_TOOLCHAIN)?:PATH=(.*)$")}, {'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_abi", 'default': None, 'pattern': re.compile("^ANDROID_ABI:STRING=(.*)$")},
{'name': "android_executable", 'default': None, 'pattern': re.compile("^ANDROID_EXECUTABLE:FILEPATH=(.*android.*)$")}, {'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': "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': "cmake_generator", 'default': None, 'pattern': re.compile("^CMAKE_GENERATOR:INTERNAL=(.+)$")},
{'name': "cxx_compiler", 'default': None, 'pattern': re.compile("^CMAKE_CXX_COMPILER:FILEPATH=(.+)$")}, {'name': "cxx_compiler", 'default': None, 'pattern': re.compile("^CMAKE_CXX_COMPILER:FILEPATH=(.+)$")},
...@@ -431,6 +433,8 @@ class TestSuite(object): ...@@ -431,6 +433,8 @@ class TestSuite(object):
if self.tests_dir and os.path.isdir(self.tests_dir): if self.tests_dir and os.path.isdir(self.tests_dir):
files = glob.glob(os.path.join(self.tests_dir, self.nameprefix + "*")) files = glob.glob(os.path.join(self.tests_dir, self.nameprefix + "*"))
files = [f for f in files if self.isTest(f)] 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 files
return [] return []
...@@ -740,6 +744,16 @@ class TestSuite(object): ...@@ -740,6 +744,16 @@ class TestSuite(object):
if os.path.isfile(hostlogpath): if os.path.isfile(hostlogpath):
return hostlogpath return hostlogpath
return None 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: else:
cmd = [exe] cmd = [exe]
if self.options.help: if self.options.help:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment