From 37b0592f7e4f7a89c731019df19a62e829c3a227 Mon Sep 17 00:00:00 2001 From: Sergey Yershov Date: Wed, 8 Jun 2016 16:21:14 +0300 Subject: [PATCH] [booking] Get Online price for hotel --- configure.sh | 2 + map/booking_api.cpp | 104 +++++++++++++++++- map/booking_api.hpp | 12 ++ map/map_tests/booking_tests.cpp | 65 +++++++++++ .../alohalitics.xcodeproj/project.pbxproj | 4 + xcode/base/base.xcodeproj/project.pbxproj | 23 ++-- xcode/map/map.xcodeproj/project.pbxproj | 39 ++++++- 7 files changed, 237 insertions(+), 12 deletions(-) create mode 100644 map/map_tests/booking_tests.cpp diff --git a/configure.sh b/configure.sh index 78da54d36f..3c6129aa4f 100755 --- a/configure.sh +++ b/configure.sh @@ -48,6 +48,8 @@ else #define HOCKEY_APP_BETA_KEY "" #define CRASHLYTICS_IOS_KEY "" #define BOOKING_AFFILIATE_ID "" +#define BOOKING_KEY "" +#define BOOKING_SECRET "" ' > "$PRIVATE_HEADER" echo 'ext { spropStoreFile = "../tools/android/debug.keystore" diff --git a/map/booking_api.cpp b/map/booking_api.cpp index 8ce0e8f969..7d4e04dc9d 100644 --- a/map/booking_api.cpp +++ b/map/booking_api.cpp @@ -1,8 +1,26 @@ -#include "booking_api.hpp" +#include "map/booking_api.hpp" + +#include "platform/http_request.hpp" + +#include "base/gmtime.hpp" +#include "base/logging.hpp" + +#include "std/chrono.hpp" +#include "std/iostream.hpp" +#include "std/sstream.hpp" + +#include "3party/jansson/myjansson.hpp" #include "private.h" -BookingApi::BookingApi() : m_affiliateId(BOOKING_AFFILIATE_ID) {} +char const BookingApi::kDefaultCurrency[1]; + +BookingApi::BookingApi() : m_affiliateId(BOOKING_AFFILIATE_ID) +{ + stringstream ss; + ss << BOOKING_KEY << ":" << BOOKING_SECRET; + m_apiUrl = "https://" + ss.str() + "@distribution-xml.booking.com/json/bookings."; +} string BookingApi::GetBookingUrl(string const & baseUrl, string const & /* lang */) const { return GetDescriptionUrl(baseUrl) + "#availability"; @@ -12,3 +30,85 @@ string BookingApi::GetDescriptionUrl(string const & baseUrl, string const & /* l { return baseUrl + "?affiliate_id=" + m_affiliateId; } + +void BookingApi::GetMinPrice(string const & hotelId, string const & currency, + function const & fn) +{ + char dateArrival[12]{}; + char dateDeparture[12]{}; + + system_clock::time_point p = system_clock::from_time_t(time(nullptr)); + tm arrival = my::GmTime(system_clock::to_time_t(p)); + tm departure = my::GmTime(system_clock::to_time_t(p + hours(24))); + strftime(dateArrival, sizeof(dateArrival), "%Y-%m-%d", &arrival); + strftime(dateDeparture, sizeof(dateDeparture), "%Y-%m-%d", &departure); + + string url = MakeApiUrl("getHotelAvailability", {{"hotel_ids", hotelId}, + {"currency_code", currency}, + {"arrival_date", dateArrival}, + {"departure_date", dateDeparture}}); + auto const callback = [fn, currency](downloader::HttpRequest & answer) + { + + string minPrice; + string priceCurrency; + try + { + my::Json root(answer.Data().c_str()); + if (!json_is_array(root.get())) + MYTHROW(my::Json::Exception, ("The answer must contain a json array.")); + size_t const sz = json_array_size(root.get()); + + if (sz > 0) + { + // Read default hotel price and currency. + auto obj = json_array_get(root.get(), 0); + my::FromJSONObject(obj, "min_price", minPrice); + my::FromJSONObject(obj, "currency_code", priceCurrency); + + // Try to get price in requested currency. + if (!currency.empty() && priceCurrency != currency) + { + json_t * arr = json_object_get(obj, "other_currency"); + if (arr && json_is_array(arr)) + { + size_t sz = json_array_size(arr); + for (size_t i = 0; i < sz; ++i) + { + auto el = json_array_get(arr, i); + string code; + my::FromJSONObject(el, "currency_code", code); + if (code == currency) + { + priceCurrency = code; + my::FromJSONObject(el, "min_price", minPrice); + break; + } + } + } + } + } + } + catch (my::Json::Exception const & e) + { + LOG(LERROR, (e.Msg())); + minPrice.clear(); + priceCurrency.clear(); + } + fn(minPrice, priceCurrency); + }; + + downloader::HttpRequest::Get(url, callback); +} + +string BookingApi::MakeApiUrl(string const & func, + initializer_list> const & params) +{ + stringstream ss; + ss << m_apiUrl << func << "?"; + bool firstRun = true; + for (auto const & param : params) + ss << (firstRun ? firstRun = false, "" : "&") << param.first << "=" << param.second; + + return ss.str(); +} \ No newline at end of file diff --git a/map/booking_api.hpp b/map/booking_api.hpp index 09a946e480..1cd45a012c 100644 --- a/map/booking_api.hpp +++ b/map/booking_api.hpp @@ -1,13 +1,25 @@ #pragma once +#include "std/function.hpp" +#include "std/initializer_list.hpp" +#include "std/map.hpp" #include "std/string.hpp" +#include "std/utility.hpp" class BookingApi { string m_affiliateId; + string m_apiUrl; public: + static constexpr const char kDefaultCurrency[1] = {0}; + BookingApi(); string GetBookingUrl(string const & baseUrl, string const & lang = string()) const; string GetDescriptionUrl(string const & baseUrl, string const & lang = string()) const; + void GetMinPrice(string const & hotelId, string const & currency, + function const & fn); + +protected: + string MakeApiUrl(string const & func, initializer_list> const & params); }; diff --git a/map/map_tests/booking_tests.cpp b/map/map_tests/booking_tests.cpp new file mode 100644 index 0000000000..ccbf44090e --- /dev/null +++ b/map/map_tests/booking_tests.cpp @@ -0,0 +1,65 @@ +#include "testing/testing.hpp" + +#include "map/booking_api.hpp" + +UNIT_TEST(Booking_SmokeTest) +{ + BookingApi api; + + string url = api.GetBookingUrl("http://someurl.com"); + TEST(!url.empty(), ()); +} + +UNIT_TEST(Booking_GetMinPrice) +{ + BookingApi api; + + { + string price; + string currency; + api.GetMinPrice("10340", BookingApi::kDefaultCurrency, + [&price, ¤cy](string const & val, string const & curr) + { + price = val; + currency = curr; + testing::StopEventLoop(); + }); + testing::RunEventLoop(); + + TEST(!price.empty(), ()); + TEST(!currency.empty(), ()); + TEST_EQUAL(currency, "EUR", ()); + } + + { + string price; + string currency; + api.GetMinPrice("10340", "RUB", [&price, ¤cy](string const & val, string const & curr) + { + price = val; + currency = curr; + testing::StopEventLoop(); + }); + testing::RunEventLoop(); + + TEST(!price.empty(), ()); + TEST(!currency.empty(), ()); + TEST_EQUAL(currency, "RUB", ()); + } + + { + string price; + string currency; + api.GetMinPrice("10340", "ISK", [&price, ¤cy](string const & val, string const & curr) + { + price = val; + currency = curr; + testing::StopEventLoop(); + }); + testing::RunEventLoop(); + + TEST(!price.empty(), ()); + TEST(!currency.empty(), ()); + TEST_EQUAL(currency, "ISK", ()); + } +} diff --git a/xcode/alohalitics/alohalitics.xcodeproj/project.pbxproj b/xcode/alohalitics/alohalitics.xcodeproj/project.pbxproj index 185a2397c0..81ddb3d381 100644 --- a/xcode/alohalitics/alohalitics.xcodeproj/project.pbxproj +++ b/xcode/alohalitics/alohalitics.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 670D04A31B0B7E460013A7AC /* alohalytics.cc in Sources */ = {isa = PBXBuildFile; fileRef = 670D04A21B0B7E460013A7AC /* alohalytics.cc */; }; 674125171B4C056600A3E828 /* file_manager_posix_impl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 674125161B4C056600A3E828 /* file_manager_posix_impl.cc */; }; + 678850921D083DA0004201E1 /* http_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 678850911D083DA0004201E1 /* http_client.h */; }; 67D1C7F71AE50DDF00A239E3 /* alohalytics_objc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 67D1C7F51AE50DDF00A239E3 /* alohalytics_objc.mm */; }; 67D1C7F81AE50DDF00A239E3 /* http_client_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 67D1C7F61AE50DDF00A239E3 /* http_client_apple.mm */; }; 67D1C7FB1AE50DFB00A239E3 /* alohalytics_objc.h in Headers */ = {isa = PBXBuildFile; fileRef = 67D1C7F91AE50DFB00A239E3 /* alohalytics_objc.h */; }; @@ -19,6 +20,7 @@ 670D04A21B0B7E460013A7AC /* alohalytics.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = alohalytics.cc; path = src/cpp/alohalytics.cc; sourceTree = ""; }; 670D05B91B0E0CAD0013A7AC /* defaults.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = defaults.xcconfig; path = ../defaults.xcconfig; sourceTree = ""; }; 674125161B4C056600A3E828 /* file_manager_posix_impl.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = file_manager_posix_impl.cc; path = src/posix/file_manager_posix_impl.cc; sourceTree = ""; }; + 678850911D083DA0004201E1 /* http_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = http_client.h; path = src/http_client.h; sourceTree = ""; }; 67D1C7DF1AE507D700A239E3 /* libalohalitics.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libalohalitics.a; sourceTree = BUILT_PRODUCTS_DIR; }; 67D1C7F51AE50DDF00A239E3 /* alohalytics_objc.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = alohalytics_objc.mm; path = src/apple/alohalytics_objc.mm; sourceTree = ""; }; 67D1C7F61AE50DDF00A239E3 /* http_client_apple.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = http_client_apple.mm; path = src/apple/http_client_apple.mm; sourceTree = ""; }; @@ -57,6 +59,7 @@ 67D1C7E11AE507D700A239E3 /* alohalitics */ = { isa = PBXGroup; children = ( + 678850911D083DA0004201E1 /* http_client.h */, 674125161B4C056600A3E828 /* file_manager_posix_impl.cc */, 670D04A21B0B7E460013A7AC /* alohalytics.cc */, 67D1C7F91AE50DFB00A239E3 /* alohalytics_objc.h */, @@ -76,6 +79,7 @@ buildActionMask = 2147483647; files = ( 67D1C7FC1AE50DFB00A239E3 /* alohalytics.h in Headers */, + 678850921D083DA0004201E1 /* http_client.h in Headers */, 67D1C7FB1AE50DFB00A239E3 /* alohalytics_objc.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/xcode/base/base.xcodeproj/project.pbxproj b/xcode/base/base.xcodeproj/project.pbxproj index a7332ee4b5..dff395b65f 100644 --- a/xcode/base/base.xcodeproj/project.pbxproj +++ b/xcode/base/base.xcodeproj/project.pbxproj @@ -110,8 +110,6 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 34CB447C1C0C34C50061F6A0 /* timegm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = timegm.cpp; sourceTree = ""; }; - 34CB447D1C0C34C50061F6A0 /* timegm.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = timegm.hpp; sourceTree = ""; }; 39FD26C81CC65A0E00AFF551 /* assert_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = assert_test.cpp; sourceTree = ""; }; 39FD26CA1CC65A0E00AFF551 /* bits_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bits_test.cpp; sourceTree = ""; }; 39FD26CB1CC65A0E00AFF551 /* buffer_vector_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = buffer_vector_test.cpp; sourceTree = ""; }; @@ -280,12 +278,8 @@ 6753416E1A3F57BF00A0A8C3 = { isa = PBXGroup; children = ( - 39FD27441CC65B5C00AFF551 /* libtomcrypt.a */, - 39FD27421CC65B4800AFF551 /* libcoding.a */, - 39FD27401CC65B2800AFF551 /* libindexer.a */, - 39FD273C1CC65B1000AFF551 /* libplatform_tests_support.a */, - 39FD273D1CC65B1000AFF551 /* libplatform.a */, 670D05AA1B0E057B0013A7AC /* defaults.xcconfig */, + 678850931D084AF6004201E1 /* libs */, 675341791A3F57BF00A0A8C3 /* base */, 39FD26C71CC659D200AFF551 /* base_tests */, 675341781A3F57BF00A0A8C3 /* Products */, @@ -367,8 +361,6 @@ 675341C81A3F57E400A0A8C3 /* threaded_priority_queue.hpp */, 675341C91A3F57E400A0A8C3 /* timer.cpp */, 675341CA1A3F57E400A0A8C3 /* timer.hpp */, - 34CB447C1C0C34C50061F6A0 /* timegm.cpp */, - 34CB447D1C0C34C50061F6A0 /* timegm.hpp */, 67A609AC1C88642E001E641A /* deferred_task.cpp */, 67A609AD1C88642E001E641A /* deferred_task.hpp */, ); @@ -385,6 +377,18 @@ path = internal; sourceTree = ""; }; + 678850931D084AF6004201E1 /* libs */ = { + isa = PBXGroup; + children = ( + 39FD27441CC65B5C00AFF551 /* libtomcrypt.a */, + 39FD27421CC65B4800AFF551 /* libcoding.a */, + 39FD27401CC65B2800AFF551 /* libindexer.a */, + 39FD273C1CC65B1000AFF551 /* libplatform_tests_support.a */, + 39FD273D1CC65B1000AFF551 /* libplatform.a */, + ); + name = libs; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -745,6 +749,7 @@ 39FD271D1CC65A7100AFF551 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 675341721A3F57BF00A0A8C3 /* Build configuration list for PBXProject "base" */ = { isa = XCConfigurationList; diff --git a/xcode/map/map.xcodeproj/project.pbxproj b/xcode/map/map.xcodeproj/project.pbxproj index 546a061cf8..c74d5b84d5 100644 --- a/xcode/map/map.xcodeproj/project.pbxproj +++ b/xcode/map/map.xcodeproj/project.pbxproj @@ -64,6 +64,15 @@ 675346A21A4054E800A0A8C3 /* user_mark.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 675346331A4054E800A0A8C3 /* user_mark.hpp */; }; 6788507E1D059068004201E1 /* booking_api.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6788507C1D059068004201E1 /* booking_api.cpp */; }; 6788507F1D059068004201E1 /* booking_api.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6788507D1D059068004201E1 /* booking_api.hpp */; }; + 678850811D06F588004201E1 /* booking_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 678850801D06F588004201E1 /* booking_tests.cpp */; }; + 678850821D071E33004201E1 /* libdrape.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 674A29F61B26FE62001A525C /* libdrape.a */; }; + 6788508A1D071E34004201E1 /* libdrape_frontend.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 678850831D071E34004201E1 /* libdrape_frontend.a */; }; + 6788508B1D071E34004201E1 /* libeditor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 678850841D071E34004201E1 /* libeditor.a */; }; + 6788508C1D071E34004201E1 /* liboauthcpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 678850851D071E34004201E1 /* liboauthcpp.a */; }; + 6788508D1D071E34004201E1 /* libplatform_tests_support.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 678850861D071E34004201E1 /* libplatform_tests_support.a */; }; + 6788508E1D071E34004201E1 /* libpugixml.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 678850871D071E34004201E1 /* libpugixml.a */; }; + 6788508F1D071E34004201E1 /* libsdf_image.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 678850881D071E34004201E1 /* libsdf_image.a */; }; + 678850901D071E34004201E1 /* libstb_image.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 678850891D071E34004201E1 /* libstb_image.a */; }; 67F183751BD5041700AB1840 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 67F183741BD5041700AB1840 /* libz.tbd */; }; 67F183761BD5045700AB1840 /* bookmarks_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 674A29CB1B26FCFE001A525C /* bookmarks_test.cpp */; }; 67F183771BD5045700AB1840 /* ge0_parser_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 674A29CC1B26FCFE001A525C /* ge0_parser_tests.cpp */; }; @@ -166,6 +175,14 @@ 675346331A4054E800A0A8C3 /* user_mark.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = user_mark.hpp; sourceTree = ""; }; 6788507C1D059068004201E1 /* booking_api.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = booking_api.cpp; sourceTree = ""; }; 6788507D1D059068004201E1 /* booking_api.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = booking_api.hpp; sourceTree = ""; }; + 678850801D06F588004201E1 /* booking_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = booking_tests.cpp; sourceTree = ""; }; + 678850831D071E34004201E1 /* libdrape_frontend.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libdrape_frontend.a; path = "../../../omim-xcode-build/Debug/libdrape_frontend.a"; sourceTree = ""; }; + 678850841D071E34004201E1 /* libeditor.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libeditor.a; path = "../../../omim-xcode-build/Debug/libeditor.a"; sourceTree = ""; }; + 678850851D071E34004201E1 /* liboauthcpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liboauthcpp.a; path = "../../../omim-xcode-build/Debug/liboauthcpp.a"; sourceTree = ""; }; + 678850861D071E34004201E1 /* libplatform_tests_support.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplatform_tests_support.a; path = "../../../omim-xcode-build/Debug/libplatform_tests_support.a"; sourceTree = ""; }; + 678850871D071E34004201E1 /* libpugixml.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpugixml.a; path = "../../../omim-xcode-build/Debug/libpugixml.a"; sourceTree = ""; }; + 678850881D071E34004201E1 /* libsdf_image.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsdf_image.a; path = "../../../omim-xcode-build/Debug/libsdf_image.a"; sourceTree = ""; }; + 678850891D071E34004201E1 /* libstb_image.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libstb_image.a; path = "../../../omim-xcode-build/Debug/libstb_image.a"; sourceTree = ""; }; 67F183741BD5041700AB1840 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 67F1837D1BD5049500AB1840 /* libagg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libagg.a; path = "../../../omim-xcode-build/Debug/libagg.a"; sourceTree = ""; }; 67F1837E1BD5049500AB1840 /* liblodepng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblodepng.a; path = "../../../omim-xcode-build/Debug/liblodepng.a"; sourceTree = ""; }; @@ -188,6 +205,14 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 6788508A1D071E34004201E1 /* libdrape_frontend.a in Frameworks */, + 6788508B1D071E34004201E1 /* libeditor.a in Frameworks */, + 6788508C1D071E34004201E1 /* liboauthcpp.a in Frameworks */, + 6788508D1D071E34004201E1 /* libplatform_tests_support.a in Frameworks */, + 6788508E1D071E34004201E1 /* libpugixml.a in Frameworks */, + 6788508F1D071E34004201E1 /* libsdf_image.a in Frameworks */, + 678850901D071E34004201E1 /* libstb_image.a in Frameworks */, + 678850821D071E33004201E1 /* libdrape.a in Frameworks */, 67F183881BD5050900AB1840 /* SystemConfiguration.framework in Frameworks */, 67F183811BD5049500AB1840 /* libagg.a in Frameworks */, 67F183821BD5049500AB1840 /* liblodepng.a in Frameworks */, @@ -242,6 +267,7 @@ 674A29CE1B26FCFE001A525C /* kmz_unarchive_test.cpp */, 674A29CF1B26FCFE001A525C /* mwm_url_tests.cpp */, 674A2A351B27011A001A525C /* working_time_tests.cpp */, + 678850801D06F588004201E1 /* booking_tests.cpp */, ); name = map_tests; path = ../../map/map_tests; @@ -250,6 +276,13 @@ 674A2A341B2700B2001A525C /* libs */ = { isa = PBXGroup; children = ( + 678850831D071E34004201E1 /* libdrape_frontend.a */, + 678850841D071E34004201E1 /* libeditor.a */, + 678850851D071E34004201E1 /* liboauthcpp.a */, + 678850861D071E34004201E1 /* libplatform_tests_support.a */, + 678850871D071E34004201E1 /* libpugixml.a */, + 678850881D071E34004201E1 /* libsdf_image.a */, + 678850891D071E34004201E1 /* libstb_image.a */, 67F183871BD5050900AB1840 /* SystemConfiguration.framework */, 67F183851BD504ED00AB1840 /* libsystem_configuration.tbd */, 67F1837D1BD5049500AB1840 /* libagg.a */, @@ -466,6 +499,7 @@ 67F183781BD5045700AB1840 /* geourl_test.cpp in Sources */, 67F183791BD5045700AB1840 /* kmz_unarchive_test.cpp in Sources */, 67F1837A1BD5045700AB1840 /* mwm_url_tests.cpp in Sources */, + 678850811D06F588004201E1 /* booking_tests.cpp in Sources */, 674A29F01B26FD6F001A525C /* testingmain.cpp in Sources */, 674A2A361B27011A001A525C /* working_time_tests.cpp in Sources */, ); @@ -507,7 +541,7 @@ FRAMEWORK_SEARCH_PATHS = "$(QT_PATH)/lib"; GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", + "OMIM_UNIT_TEST_WITH_QT_EVENT_LOOP=1", "$(inherited)", ); LIBRARY_SEARCH_PATHS = ( @@ -536,6 +570,7 @@ COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(QT_PATH)/lib"; GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = "OMIM_UNIT_TEST_WITH_QT_EVENT_LOOP=1"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(SDKROOT)/usr/lib/system", @@ -600,6 +635,7 @@ "$(OMIM_ROOT)/3party/freetype/include", "$(OMIM_ROOT)/3party/expat/lib", "$(OMIM_ROOT)/3party/glm", + "$(OMIM_ROOT)/3party/jansson/src", ); MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; @@ -647,6 +683,7 @@ "$(OMIM_ROOT)/3party/freetype/include", "$(OMIM_ROOT)/3party/expat/lib", "$(OMIM_ROOT)/3party/glm", + "$(OMIM_ROOT)/3party/jansson/src", ); MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO;