From 40309537ee396bd0d6c00e9b4246a5d0187720b9 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Thu, 1 Oct 2015 16:22:55 +0300 Subject: [PATCH 1/2] Moving routing integration tests to routing directory. --- omim.pro | 2 +- .../routing_integration_tests}/jni/Android.mk | 0 .../routing_integration_tests}/jni/Application.mk | 0 .../routing_integration_tests}/jni/test.cpp | 0 .../routing_integration_tests}/jni/test.hpp | 0 .../routing_integration_tests}/online_cross_tests.cpp | 2 +- .../routing_integration_tests}/osrm_route_test.cpp | 4 ++-- .../routing_integration_tests}/osrm_turn_test.cpp | 2 +- .../routing_integration_tests}/pedestrian_route_test.cpp | 2 +- .../routing_integration_tests/routing_integration_tests.pro | 6 +++--- .../routing_integration_tests}/routing_test_tools.cpp | 2 +- .../routing_integration_tests}/routing_test_tools.hpp | 0 12 files changed, 10 insertions(+), 10 deletions(-) rename {integration_tests => routing/routing_integration_tests}/jni/Android.mk (100%) rename {integration_tests => routing/routing_integration_tests}/jni/Application.mk (100%) rename {integration_tests => routing/routing_integration_tests}/jni/test.cpp (100%) rename {integration_tests => routing/routing_integration_tests}/jni/test.hpp (100%) rename {integration_tests => routing/routing_integration_tests}/online_cross_tests.cpp (96%) rename {integration_tests => routing/routing_integration_tests}/osrm_route_test.cpp (98%) rename {integration_tests => routing/routing_integration_tests}/osrm_turn_test.cpp (99%) rename {integration_tests => routing/routing_integration_tests}/pedestrian_route_test.cpp (99%) rename integration_tests/integration_tests.pro => routing/routing_integration_tests/routing_integration_tests.pro (90%) rename {integration_tests => routing/routing_integration_tests}/routing_test_tools.cpp (99%) rename {integration_tests => routing/routing_integration_tests}/routing_test_tools.hpp (100%) diff --git a/omim.pro b/omim.pro index f0496bc862..31dd885dd5 100644 --- a/omim.pro +++ b/omim.pro @@ -80,12 +80,12 @@ CONFIG(desktop) { SUBDIRS += storage/storage_tests SUBDIRS += search/search_tests SUBDIRS += map/map_tests map/benchmark_tool map/mwm_tests + SUBDIRS += routing/routing_integration_tests SUBDIRS += routing/routing_tests SUBDIRS += generator/generator_tests SUBDIRS += indexer/indexer_tests SUBDIRS += graphics/graphics_tests SUBDIRS += gui/gui_tests - SUBDIRS *= integration_tests SUBDIRS += pedestrian_routing_benchmarks SUBDIRS += search/search_integration_tests diff --git a/integration_tests/jni/Android.mk b/routing/routing_integration_tests/jni/Android.mk similarity index 100% rename from integration_tests/jni/Android.mk rename to routing/routing_integration_tests/jni/Android.mk diff --git a/integration_tests/jni/Application.mk b/routing/routing_integration_tests/jni/Application.mk similarity index 100% rename from integration_tests/jni/Application.mk rename to routing/routing_integration_tests/jni/Application.mk diff --git a/integration_tests/jni/test.cpp b/routing/routing_integration_tests/jni/test.cpp similarity index 100% rename from integration_tests/jni/test.cpp rename to routing/routing_integration_tests/jni/test.cpp diff --git a/integration_tests/jni/test.hpp b/routing/routing_integration_tests/jni/test.hpp similarity index 100% rename from integration_tests/jni/test.hpp rename to routing/routing_integration_tests/jni/test.hpp diff --git a/integration_tests/online_cross_tests.cpp b/routing/routing_integration_tests/online_cross_tests.cpp similarity index 96% rename from integration_tests/online_cross_tests.cpp rename to routing/routing_integration_tests/online_cross_tests.cpp index 49e48b0a33..fc4b234eac 100644 --- a/integration_tests/online_cross_tests.cpp +++ b/routing/routing_integration_tests/online_cross_tests.cpp @@ -1,6 +1,6 @@ #include "testing/testing.hpp" -#include "integration_tests/routing_test_tools.hpp" +#include "routing/routing_integration_tests/routing_test_tools.hpp" namespace { diff --git a/integration_tests/osrm_route_test.cpp b/routing/routing_integration_tests/osrm_route_test.cpp similarity index 98% rename from integration_tests/osrm_route_test.cpp rename to routing/routing_integration_tests/osrm_route_test.cpp index 91c29756b7..02b2ed09ed 100644 --- a/integration_tests/osrm_route_test.cpp +++ b/routing/routing_integration_tests/osrm_route_test.cpp @@ -1,8 +1,8 @@ #include "testing/testing.hpp" -#include "integration_tests/routing_test_tools.hpp" +#include "routing/routing_integration_tests/routing_test_tools.hpp" -#include "../indexer/mercator.hpp" +#include "../../indexer/mercator.hpp" using namespace routing; diff --git a/integration_tests/osrm_turn_test.cpp b/routing/routing_integration_tests/osrm_turn_test.cpp similarity index 99% rename from integration_tests/osrm_turn_test.cpp rename to routing/routing_integration_tests/osrm_turn_test.cpp index 66360f193e..f505e9ff0b 100644 --- a/integration_tests/osrm_turn_test.cpp +++ b/routing/routing_integration_tests/osrm_turn_test.cpp @@ -1,6 +1,6 @@ #include "testing/testing.hpp" -#include "integration_tests/routing_test_tools.hpp" +#include "routing/routing_integration_tests/routing_test_tools.hpp" #include "routing/route.hpp" diff --git a/integration_tests/pedestrian_route_test.cpp b/routing/routing_integration_tests/pedestrian_route_test.cpp similarity index 99% rename from integration_tests/pedestrian_route_test.cpp rename to routing/routing_integration_tests/pedestrian_route_test.cpp index 11197d0aa5..2eb4979199 100644 --- a/integration_tests/pedestrian_route_test.cpp +++ b/routing/routing_integration_tests/pedestrian_route_test.cpp @@ -1,6 +1,6 @@ #include "testing/testing.hpp" -#include "integration_tests/routing_test_tools.hpp" +#include "routing/routing_integration_tests/routing_test_tools.hpp" #include "indexer/mercator.hpp" diff --git a/integration_tests/integration_tests.pro b/routing/routing_integration_tests/routing_integration_tests.pro similarity index 90% rename from integration_tests/integration_tests.pro rename to routing/routing_integration_tests/routing_integration_tests.pro index 2ea11d99a5..a249a61059 100644 --- a/integration_tests/integration_tests.pro +++ b/routing/routing_integration_tests/routing_integration_tests.pro @@ -5,12 +5,12 @@ # - tests are written to be launch on the whole world dataset; # - tests covers significant number of subsystems; -TARGET = integration_tests +TARGET = routing_integration_tests CONFIG += console warn_on CONFIG -= app_bundle TEMPLATE = app -ROOT_DIR = .. +ROOT_DIR = ../.. DEPENDENCIES = map routing search storage indexer platform geometry coding base osrm jansson protobuf tomcrypt succinct stats_client macx-*: LIBS *= "-framework IOKit" "-framework SystemConfiguration" @@ -20,7 +20,7 @@ include($$ROOT_DIR/common.pri) QT *= core SOURCES += \ - ../testing/testingmain.cpp \ + ../../testing/testingmain.cpp \ online_cross_tests.cpp \ osrm_route_test.cpp \ osrm_turn_test.cpp \ diff --git a/integration_tests/routing_test_tools.cpp b/routing/routing_integration_tests/routing_test_tools.cpp similarity index 99% rename from integration_tests/routing_test_tools.cpp rename to routing/routing_integration_tests/routing_test_tools.cpp index 5712537c39..b0caf53ae9 100644 --- a/integration_tests/routing_test_tools.cpp +++ b/routing/routing_integration_tests/routing_test_tools.cpp @@ -1,4 +1,4 @@ -#include "integration_tests/routing_test_tools.hpp" +#include "routing/routing_integration_tests/routing_test_tools.hpp" #include "testing/testing.hpp" diff --git a/integration_tests/routing_test_tools.hpp b/routing/routing_integration_tests/routing_test_tools.hpp similarity index 100% rename from integration_tests/routing_test_tools.hpp rename to routing/routing_integration_tests/routing_test_tools.hpp From 76887ab1ec40fdf24c52cdd7c606790273d3ceda Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Fri, 2 Oct 2015 09:10:49 +0300 Subject: [PATCH 2/2] Fixing unit and integration test for Android. --- android/UnitTests/build.gradle | 2 +- android/UnitTests/jni/Android.mk | 6 +++--- android/UnitTests/jni/AndroidBeginning.mk | 4 ++-- android/UnitTests/jni/main.cpp | 4 ++-- android/UnitTests/jni/mock.cpp | 6 ++++++ .../mapswithme/maps/unittests/AllTestsActivity.java | 2 +- android/UnitTests/tests_list.sh | 2 +- indexer/indexer_tests/jni/Android.mk | 2 +- omim.pro | 2 +- routing/routing_integration_tests/jni/Android.mk | 10 +++++----- routing/routing_integration_tests/jni/Application.mk | 2 +- routing/routing_integration_tests/jni/test.cpp | 2 +- routing/routing_integration_tests/jni/test.hpp | 2 +- 13 files changed, 26 insertions(+), 20 deletions(-) diff --git a/android/UnitTests/build.gradle b/android/UnitTests/build.gradle index 1a894d109a..cc8604eba6 100644 --- a/android/UnitTests/build.gradle +++ b/android/UnitTests/build.gradle @@ -79,7 +79,7 @@ android { } def NUM_OF_PARALLEL_MAKE_TASKS = Runtime.runtime.availableProcessors() + 1 -def INTEGRATION_TESTS_BUILD = '../../integration_tests/' +def INTEGRATION_TESTS_BUILD = '../../routing/routing_integration_tests/' Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream()) def NDK_BUILD = properties.getProperty('ndk.dir') + '/ndk-build' diff --git a/android/UnitTests/jni/Android.mk b/android/UnitTests/jni/Android.mk index 9928732568..59fb0f5a9b 100644 --- a/android/UnitTests/jni/Android.mk +++ b/android/UnitTests/jni/Android.mk @@ -7,8 +7,8 @@ MY_PREBUILT_LIBS_PATH := ../libs/tmp/$(TARGET_ARCH_ABI) $(info $(MY_PREBUILT_LIBS_PATH)) include $(CLEAR_VARS) -LOCAL_MODULE := integration_tests -LOCAL_SRC_FILES := $(MY_PREBUILT_LIBS_PATH)/libintegration_tests.so +LOCAL_MODULE := routing_integration_tests +LOCAL_SRC_FILES := $(MY_PREBUILT_LIBS_PATH)/librouting_integration_tests.so include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) @@ -27,6 +27,6 @@ LOCAL_SRC_FILES := ./main.cpp LOCAL_STATIC_LIBRARIES := android_native_app_glue # todo(vbykoianko) extract the names of the libs from tests_list.sh -LOCAL_SHARED_LIBRARIES := integration_tests indexer_tests +LOCAL_SHARED_LIBRARIES := routing_integration_tests indexer_tests include ./jni/AndroidEnding.mk diff --git a/android/UnitTests/jni/AndroidBeginning.mk b/android/UnitTests/jni/AndroidBeginning.mk index 15d49363f5..e0dca37833 100644 --- a/android/UnitTests/jni/AndroidBeginning.mk +++ b/android/UnitTests/jni/AndroidBeginning.mk @@ -23,7 +23,7 @@ define add_prebuild_static_lib include $(PREBUILT_STATIC_LIBRARY) endef -prebuild_static_libs := osrm protobuf tomcrypt jansson bzip2 zlib fribidi freetype expat base coding geometry anim platform graphics indexer storage search routing gui map stats_client succinct +prebuild_static_libs := minizip osrm protobuf tomcrypt jansson fribidi freetype expat base coding geometry anim platform graphics indexer storage search routing gui map opening_hours stats_client succinct $(foreach item,$(prebuild_static_libs),$(eval $(call add_prebuild_static_lib,$(item)))) @@ -60,5 +60,5 @@ LOCAL_SRC_FILES += $(ROOT_PATH_FROM_JNI)/android/UnitTests/jni/mock.cpp LOCAL_SRC_FILES += ./test.cpp LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -LOCAL_LDLIBS += -lGLESv2 -latomic +LOCAL_LDLIBS += -lGLESv2 -latomic -lz LOCAL_LDLIBS += -Wl,--gc-sections diff --git a/android/UnitTests/jni/main.cpp b/android/UnitTests/jni/main.cpp index 6f2d5d0207..aec938c744 100644 --- a/android/UnitTests/jni/main.cpp +++ b/android/UnitTests/jni/main.cpp @@ -1,7 +1,7 @@ // @todo(vbykoianko) this file should be generated with a script based on tests_list.sh #include "mock.hpp" -#include "integration_tests/jni/test.hpp" +#include "routing/routing_integration_tests/jni/test.hpp" #include "indexer/indexer_tests/jni/test.hpp" #include @@ -12,7 +12,7 @@ void android_main(struct android_app * state) // Make sure glue isn't stripped. app_dummy(); - integration_tests::test(state); + routing_integration_tests::test(state); indexer_tests::test(state); // @todo(vbykoianko) Take care of correctly leaving the activity after all tests have diff --git a/android/UnitTests/jni/mock.cpp b/android/UnitTests/jni/mock.cpp index acac3a88eb..2177ea92a2 100644 --- a/android/UnitTests/jni/mock.cpp +++ b/android/UnitTests/jni/mock.cpp @@ -226,6 +226,12 @@ void Platform::RunOnGuiThread(TFunctor const & fn) LOG(LWARNING, ("Platform::RunOnGuiThread() is not implemented.")); } +Platform::EConnectionType Platform::ConnectionStatus() +{ + LOG(LWARNING, ("Platform::ConnectionStatus() is not implemented.")); + return Platform::EConnectionType::CONNECTION_NONE; +} + JavaVM * GetJVM() { LOG(LWARNING, ("GetJVM() returns nullptr.")); diff --git a/android/UnitTests/src/com/mapswithme/maps/unittests/AllTestsActivity.java b/android/UnitTests/src/com/mapswithme/maps/unittests/AllTestsActivity.java index c4505adbc5..87f9d53ef0 100644 --- a/android/UnitTests/src/com/mapswithme/maps/unittests/AllTestsActivity.java +++ b/android/UnitTests/src/com/mapswithme/maps/unittests/AllTestsActivity.java @@ -4,7 +4,7 @@ package com.mapswithme.maps.unittests; public class AllTestsActivity extends android.app.NativeActivity { static { - System.loadLibrary("integration_tests"); + System.loadLibrary("routing_integration_tests"); System.loadLibrary("indexer_tests"); System.loadLibrary("all_tests"); } diff --git a/android/UnitTests/tests_list.sh b/android/UnitTests/tests_list.sh index d5b625e4b2..a7e34f68ad 100644 --- a/android/UnitTests/tests_list.sh +++ b/android/UnitTests/tests_list.sh @@ -9,4 +9,4 @@ MY_PATH=$(dirname "$0") # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized -declare -r TESTS_LIST=($MY_PATH/../../integration_tests/ $MY_PATH/../../indexer/indexer_tests/) +declare -r TESTS_LIST=($MY_PATH/../../routing/routing_integration_tests/ $MY_PATH/../../indexer/indexer_tests/) diff --git a/indexer/indexer_tests/jni/Android.mk b/indexer/indexer_tests/jni/Android.mk index 5211049c1a..e3b7a7cfc0 100644 --- a/indexer/indexer_tests/jni/Android.mk +++ b/indexer/indexer_tests/jni/Android.mk @@ -10,6 +10,6 @@ include ../../android/UnitTests/jni/AndroidBeginning.mk LOCAL_MODULE := indexer_tests -LOCAL_STATIC_LIBRARIES := android_native_app_glue indexer platform geometry coding base protobuf tomcrypt zlib +LOCAL_STATIC_LIBRARIES := android_native_app_glue indexer platform geometry coding base protobuf tomcrypt opening_hours minizip zlib include ../../android/UnitTests/jni/AndroidEnding.mk diff --git a/omim.pro b/omim.pro index 31dd885dd5..9b420c8bbb 100644 --- a/omim.pro +++ b/omim.pro @@ -38,7 +38,7 @@ SUBDIRS += storage CONFIG(gtool):!CONFIG(no-tests) { SUBDIRS += search SUBDIRS += map - SUBDIRS += integration_tests + SUBDIRS += routing/routing_integration_tests } CONFIG(desktop) { diff --git a/routing/routing_integration_tests/jni/Android.mk b/routing/routing_integration_tests/jni/Android.mk index 0eb13287d1..4f2a2186c3 100644 --- a/routing/routing_integration_tests/jni/Android.mk +++ b/routing/routing_integration_tests/jni/Android.mk @@ -5,11 +5,11 @@ # - there are additional libs here (android_native_app_glue and zlib); LOCAL_PATH := $(call my-dir) -ROOT_PATH := .. -include ../android/UnitTests/jni/AndroidBeginning.mk +ROOT_PATH := ../.. +include ../../android/UnitTests/jni/AndroidBeginning.mk -LOCAL_MODULE := integration_tests +LOCAL_MODULE := routing_integration_tests -LOCAL_STATIC_LIBRARIES := android_native_app_glue base tomcrypt map routing search storage geometry osrm jansson indexer protobuf succinct stats_client platform coding zlib +LOCAL_STATIC_LIBRARIES := android_native_app_glue base tomcrypt map routing search storage geometry osrm jansson indexer protobuf succinct stats_client platform coding opening_hours minizip zlib -include ../android/UnitTests/jni/AndroidEnding.mk +include ../../android/UnitTests/jni/AndroidEnding.mk diff --git a/routing/routing_integration_tests/jni/Application.mk b/routing/routing_integration_tests/jni/Application.mk index c481657457..43a1529450 120000 --- a/routing/routing_integration_tests/jni/Application.mk +++ b/routing/routing_integration_tests/jni/Application.mk @@ -1 +1 @@ -../../android/UnitTests/jni/Application.mk \ No newline at end of file +../../../android/UnitTests/jni/Application.mk \ No newline at end of file diff --git a/routing/routing_integration_tests/jni/test.cpp b/routing/routing_integration_tests/jni/test.cpp index d8f99b13ec..2167640aa7 100644 --- a/routing/routing_integration_tests/jni/test.cpp +++ b/routing/routing_integration_tests/jni/test.cpp @@ -5,7 +5,7 @@ extern int main(int argc, char * argv[]); -namespace integration_tests +namespace routing_integration_tests { void test(android_app * state) { diff --git a/routing/routing_integration_tests/jni/test.hpp b/routing/routing_integration_tests/jni/test.hpp index 4aa2fa842d..d74fc3f593 100644 --- a/routing/routing_integration_tests/jni/test.hpp +++ b/routing/routing_integration_tests/jni/test.hpp @@ -3,7 +3,7 @@ struct android_app; -namespace integration_tests +namespace routing_integration_tests { void test(android_app * state); }