mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +01:00
Fix ClassLoader and SharedLibrary test for android (#2209)
This commit is contained in:
parent
1178bb4760
commit
63b95fd4aa
@ -27,7 +27,7 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
if(ANDROID)
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;${CMAKE_BINARY_DIR}/bin/TestApp" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;${CMAKE_BINARY_DIR}/bin/TestApp;${CMAKE_BINARY_DIR}/bin/TestLibrary.so" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/${TESTUNIT} -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake)
|
||||
else()
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all)
|
||||
set_tests_properties(${LIBNAME} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=.") # The SharedLibaryTest has to look for shared libraries in the working directory
|
||||
|
@ -204,12 +204,9 @@ CppUnit::Test* ClassLoaderTest::suite()
|
||||
{
|
||||
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ClassLoaderTest");
|
||||
|
||||
#if (POCO_OS != POCO_OS_ANDROID)
|
||||
// FIXME exclude from android build temporarly to fix the bug. See issue https://github.com/pocoproject/poco/issues/2209
|
||||
CppUnit_addTest(pSuite, ClassLoaderTest, testClassLoader1);
|
||||
CppUnit_addTest(pSuite, ClassLoaderTest, testClassLoader2);
|
||||
CppUnit_addTest(pSuite, ClassLoaderTest, testClassLoader3);
|
||||
#endif
|
||||
|
||||
return pSuite;
|
||||
}
|
||||
|
@ -141,12 +141,9 @@ CppUnit::Test* SharedLibraryTest::suite()
|
||||
{
|
||||
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SharedLibraryTest");
|
||||
|
||||
#if (POCO_OS != POCO_OS_ANDROID)
|
||||
// FIXME exclude from android build temporarly to fix the bug. See issue https://github.com/pocoproject/poco/issues/2209
|
||||
CppUnit_addTest(pSuite, SharedLibraryTest, testSharedLibrary1);
|
||||
CppUnit_addTest(pSuite, SharedLibraryTest, testSharedLibrary2);
|
||||
CppUnit_addTest(pSuite, SharedLibraryTest, testSharedLibrary3);
|
||||
#endif
|
||||
|
||||
return pSuite;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ message(STATUS "Push ${UNITTEST} to android ...")
|
||||
execute_process(COMMAND ${ANDROID_NDK}/../platform-tools/adb push ${UNITTEST} /data/local/tmp/ OUTPUT_QUIET)
|
||||
message(STATUS "Execute ${UNITTEST_FILENAME} ${TEST_PARAMETER} on android ...")
|
||||
execute_process(
|
||||
COMMAND ${ANDROID_NDK}/../platform-tools/adb shell "cd /data/local/tmp;su root sh -c 'LD_LIBRARY_PATH=/data/local/tmp/lib TMPDIR=/data/local/tmp HOME=/data/local/tmp ./${UNITTEST_FILENAME} ${TEST_PARAMETER};echo exit code $?'"
|
||||
COMMAND ${ANDROID_NDK}/../platform-tools/adb shell "cd /data/local/tmp;su root sh -c 'LD_LIBRARY_PATH=/data/local/tmp:/data/local/tmp/lib:/data/local/tmp/data TMPDIR=/data/local/tmp HOME=/data/local/tmp ./${UNITTEST_FILENAME} ${TEST_PARAMETER};echo exit code $?'"
|
||||
RESULT_VARIABLE _RESULT
|
||||
OUTPUT_VARIABLE _OUT
|
||||
ERROR_VARIABLE _ERR
|
||||
|
Loading…
Reference in New Issue
Block a user