diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-03 15:16:49 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-07 18:01:02 -0700 |
commit | f964e40e7e9220d08751d8607af61ac5a7c0794c (patch) | |
tree | d34ca5407188fe3d71396faa8a8acceb52d9bd4b /test | |
parent | f5d66f362272db034a311d2077dbdb2937c9bbdf (diff) | |
download | qtlocation-mapboxgl-f964e40e7e9220d08751d8607af61ac5a7c0794c.tar.gz |
[build] Refactor and simplify build system
* Main gyp files are now standardized as platform/<platform>/platform.gyp.
* Each platform gyp file defines appropriate loop_lib and headless_lib variables.
* Each platform gyp file includes mbgl.gypi, which defines base targets which may be useful to all platforms.
* CI targets are consistent across platforms: `make $(PLATFORM) && make test-$(PLATFORM)`.
* Renamed the "linux" test app to "glfw". It's now built in OS X CI.
* Android build flakiness is fixed.
* iOS CI builds the bench and iosapp targets.
* Mesa version is now in one place.
* CI scripts use bash "strict mode" and correct error handling.
* All build output goes to the build directory.
* Removed vestigial iOS/OS X/Android Travis scripts.
Diffstat (limited to 'test')
-rw-r--r-- | test/api/render_missing.cpp | 10 | ||||
-rw-r--r-- | test/storage/http_error.cpp | 11 | ||||
-rw-r--r-- | test/storage/http_retry_network_status.cpp | 11 | ||||
-rw-r--r-- | test/test.gypi | 41 |
4 files changed, 8 insertions, 65 deletions
diff --git a/test/api/render_missing.cpp b/test/api/render_missing.cpp index 8c3a1f8e52..f29a0c2b9c 100644 --- a/test/api/render_missing.cpp +++ b/test/api/render_missing.cpp @@ -45,15 +45,7 @@ TEST(API, TEST_REQUIRES_SERVER(RenderMissingTile)) { std::rethrow_exception(err); } catch (const std::exception& ex) { message = ex.what(); -#ifdef MBGL_HTTP_NSURL - EXPECT_STREQ("Could not connect to the server.", ex.what()); -#elif MBGL_HTTP_CURL - const char* prefix = "Couldn't connect to server:"; - EXPECT_EQ(0, strncmp(prefix, ex.what(), strlen(prefix))) << "Full message is: \"" - << ex.what() << "\""; -#else - FAIL(); -#endif + EXPECT_TRUE(message.find("connect") != std::string::npos); } promise.set_value(); }); diff --git a/test/storage/http_error.cpp b/test/storage/http_error.cpp index 073f48b1b1..dfe4a55973 100644 --- a/test/storage/http_error.cpp +++ b/test/storage/http_error.cpp @@ -69,17 +69,6 @@ TEST_F(Storage, TEST_REQUIRES_SERVER(HTTPConnectionError)) { EXPECT_GT(wait + 0.2, duration) << "Backoff timer fired too late"; ASSERT_NE(nullptr, res.error); EXPECT_EQ(Response::Error::Reason::Connection, res.error->reason); -#ifdef MBGL_HTTP_NSURL - EXPECT_TRUE(res.error->message == - "The operation couldn’t be completed. (NSURLErrorDomain error -1004.)" || - res.error->message == "Could not connect to the server.") - << "Full message is: \"" << res.error->message << "\""; -#elif MBGL_HTTP_CURL - const std::string prefix { "Couldn't connect to server: " }; - EXPECT_STREQ(prefix.c_str(), res.error->message.substr(0, prefix.size()).c_str()) << "Full message is: \"" << res.error->message << "\""; -#else - FAIL(); -#endif ASSERT_FALSE(res.data.get()); EXPECT_FALSE(bool(res.expires)); EXPECT_FALSE(bool(res.modified)); diff --git a/test/storage/http_retry_network_status.cpp b/test/storage/http_retry_network_status.cpp index 249f74c264..94a2bcdc4d 100644 --- a/test/storage/http_retry_network_status.cpp +++ b/test/storage/http_retry_network_status.cpp @@ -70,17 +70,6 @@ TEST_F(Storage, TEST_REQUIRES_SERVER(HTTPNetworkStatusChangePreempt)) { } ASSERT_NE(nullptr, res.error); EXPECT_EQ(Response::Error::Reason::Connection, res.error->reason); -#ifdef MBGL_HTTP_NSURL - EXPECT_TRUE(res.error->message == - "The operation couldn’t be completed. (NSURLErrorDomain error -1004.)" || - res.error->message == "Could not connect to the server.") - << "Full message is: \"" << res.error->message << "\""; -#elif MBGL_HTTP_CURL - const std::string prefix { "Couldn't connect to server: " }; - EXPECT_STREQ(prefix.c_str(), res.error->message.substr(0, prefix.size()).c_str()) << "Full message is: \"" << res.error->message << "\""; -#else - FAIL(); -#endif ASSERT_FALSE(res.data.get()); EXPECT_FALSE(bool(res.expires)); EXPECT_FALSE(bool(res.modified)); diff --git a/test/test.gypi b/test/test.gypi index c93b5b67b8..782d98e43f 100644 --- a/test/test.gypi +++ b/test/test.gypi @@ -1,24 +1,19 @@ { - 'includes': [ - '../gyp/common.gypi', - ], - 'targets': [ - { 'target_name': 'test', + { + 'target_name': 'test', 'type': 'executable', 'include_dirs': [ + '../include', '../src', '../platform/default', 'include', ], 'dependencies': [ - 'mbgl.gyp:core', - 'mbgl.gyp:platform-<(platform_lib)', - 'mbgl.gyp:http-<(http_lib)', - 'mbgl.gyp:asset-<(asset_lib)', - 'mbgl.gyp:headless-<(headless_lib)', + 'platform-lib', + 'copy_certificate_bundle', ], 'sources': [ @@ -96,6 +91,8 @@ 'sprite/sprite_image.cpp', 'sprite/sprite_parser.cpp', 'sprite/sprite_store.cpp', + + 'src/main.cpp', ], 'variables': { @@ -121,30 +118,6 @@ }, 'conditions': [ - ['host == "ios"', { - 'product_name': 'ios-test', - # iOS tests - 'includes': [ - '../gyp/target-ios-bundle.gypi', - ], - 'sources': [ - 'src/main.mm', - '../src/mbgl/util/premultiply.cpp', - ], - 'xcode_settings': { - 'INFOPLIST_FILE': '../test/src/app-info.plist', - }, - 'copies': [ - { 'destination': '<(PRODUCT_DIR)/$(WRAPPER_NAME)/test', - 'files': [ '../test/fixtures' ], - }, - ] - }, { - # non-iOS tests - 'sources': [ - 'src/main.cpp', - ] - }], ['OS == "mac"', { 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], |