summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-10-24 17:39:18 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-10-24 17:44:51 +0200
commit0e928b5204ad5e2a8cfc1dd1a993396be0bd9d87 (patch)
tree1eca3f4f0446c07c38d93049d48a6272b2c989d6
parentd299e580886353e0813d30f9dee74639f899924a (diff)
downloadqtlocation-mapboxgl-0e928b5204ad5e2a8cfc1dd1a993396be0bd9d87.tar.gz
make tests work
-rw-r--r--gyp/common.gypi (renamed from common.gypi)0
-rw-r--r--gyp/platform-linux.gypi1
-rw-r--r--gyp/platform.gypi16
-rw-r--r--include/mbgl/platform/default/glx.h (renamed from common/glx.h)0
-rw-r--r--include/mbgl/platform/default/headless_display.hpp (renamed from common/headless_display.hpp)0
m---------ios/mapbox-gl-cocoa0
-rw-r--r--linux/mapboxgl-app.gyp2
-rw-r--r--macosx/mapboxgl-app.gyp2
-rw-r--r--mapboxgl.gyp8
-rw-r--r--platform/darwin/log_nslog.mm2
-rw-r--r--platform/default/headless_display.cpp (renamed from common/headless_display.cpp)2
-rw-r--r--platform/default/headless_view.cpp4
-rwxr-xr-xscripts/run_tests.sh5
-rw-r--r--test/headless.cpp4
-rw-r--r--test/test.gyp320
15 files changed, 168 insertions, 198 deletions
diff --git a/common.gypi b/gyp/common.gypi
index 89a82fbdb9..89a82fbdb9 100644
--- a/common.gypi
+++ b/gyp/common.gypi
diff --git a/gyp/platform-linux.gypi b/gyp/platform-linux.gypi
index 4288def7fc..9126652a7e 100644
--- a/gyp/platform-linux.gypi
+++ b/gyp/platform-linux.gypi
@@ -44,6 +44,7 @@
'libraries': [
'<@(uv_libraries)',
'<@(curl_libraries)',
+ '-lboost_regex',
]
}]
]
diff --git a/gyp/platform.gypi b/gyp/platform.gypi
new file mode 100644
index 0000000000..605f3d7127
--- /dev/null
+++ b/gyp/platform.gypi
@@ -0,0 +1,16 @@
+{
+ 'conditions': [
+ ['platform == "osx"', {
+ 'includes': ['platform-osx.gypi'],
+ 'variables': { 'platform_library': 'mapboxgl-osx' },
+ }],
+ ['platform == "ios"', {
+ 'includes': ['platform-ios.gypi'],
+ 'variables': { 'platform_library': 'mapboxgl-ios' },
+ }],
+ ['platform == "linux"', {
+ 'includes': ['platform-linux.gypi'],
+ 'variables': { 'platform_library': 'mapboxgl-linux' },
+ }],
+ ],
+}
diff --git a/common/glx.h b/include/mbgl/platform/default/glx.h
index 6b7d9a3df9..6b7d9a3df9 100644
--- a/common/glx.h
+++ b/include/mbgl/platform/default/glx.h
diff --git a/common/headless_display.hpp b/include/mbgl/platform/default/headless_display.hpp
index 5b33fd6990..5b33fd6990 100644
--- a/common/headless_display.hpp
+++ b/include/mbgl/platform/default/headless_display.hpp
diff --git a/ios/mapbox-gl-cocoa b/ios/mapbox-gl-cocoa
-Subproject cfbd1cfad47802ee5489aef24a59e340b841e49
+Subproject 3f9579ad3a002433fee2df9b1a88869a5712417
diff --git a/linux/mapboxgl-app.gyp b/linux/mapboxgl-app.gyp
index 09734fc1c4..e4dacd9af3 100644
--- a/linux/mapboxgl-app.gyp
+++ b/linux/mapboxgl-app.gyp
@@ -1,6 +1,6 @@
{
'includes': [
- '../common.gypi',
+ '../gyp/common.gypi',
],
'targets': [
{
diff --git a/macosx/mapboxgl-app.gyp b/macosx/mapboxgl-app.gyp
index 4451a207b4..dc65c37567 100644
--- a/macosx/mapboxgl-app.gyp
+++ b/macosx/mapboxgl-app.gyp
@@ -1,6 +1,6 @@
{
'includes': [
- '../common.gypi',
+ '../gyp/common.gypi',
],
'targets': [
{
diff --git a/mapboxgl.gyp b/mapboxgl.gyp
index 64c0ccc0c7..8b805ae6d7 100644
--- a/mapboxgl.gyp
+++ b/mapboxgl.gyp
@@ -1,16 +1,12 @@
{
'includes': [
- './common.gypi',
+ './gyp/common.gypi',
'./gyp/shaders.gypi',
'./gyp/npm_install.gypi',
'./gyp/styles.gypi',
'./gyp/fixtures.gypi',
'./gyp/certificates.gypi',
'./gyp/library.gypi',
- ],
- 'conditions': [
- ['platform == "osx"', { 'includes': ['./gyp/platform-osx.gypi'] }],
- ['platform == "ios"', { 'includes': ['./gyp/platform-ios.gypi'] }],
- ['platform == "linux"', { 'includes': ['./gyp/platform-linux.gypi'] }],
+ './gyp/platform.gypi',
],
}
diff --git a/platform/darwin/log_nslog.mm b/platform/darwin/log_nslog.mm
index 231037b2dd..b196930b23 100644
--- a/platform/darwin/log_nslog.mm
+++ b/platform/darwin/log_nslog.mm
@@ -1,4 +1,4 @@
-#include "log_nslog.hpp"
+#include <mbgl/platform/darwin/log_nslog.hpp>
#import <Foundation/Foundation.h>
diff --git a/common/headless_display.cpp b/platform/default/headless_display.cpp
index 3aaf2020b9..409fcbf057 100644
--- a/common/headless_display.cpp
+++ b/platform/default/headless_display.cpp
@@ -1,4 +1,4 @@
-#include "headless_display.hpp"
+#include <mbgl/platform/default/headless_display.hpp>
#include <cstring>
#include <stdexcept>
diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp
index d1d13db5f8..ec5c4aabec 100644
--- a/platform/default/headless_view.cpp
+++ b/platform/default/headless_view.cpp
@@ -1,5 +1,5 @@
-#include "headless_view.hpp"
-#include "headless_display.hpp"
+#include <mbgl/platform/default/headless_view.hpp>
+#include <mbgl/platform/default/headless_display.hpp>
#include <stdexcept>
#include <sstream>
diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh
index 6b42b79911..e107000761 100755
--- a/scripts/run_tests.sh
+++ b/scripts/run_tests.sh
@@ -10,7 +10,10 @@ for TEST in ./test_* ; do
ulimit -c unlimited -S
echo 'ulimit -c: '`ulimit -c`
echo '/proc/sys/kernel/core_pattern: '`cat /proc/sys/kernel/core_pattern`
- sysctl kernel.core_pattern
+
+ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
+ sysctl kernel.core_pattern
+ fi
RESULT=0
${TEST} || RESULT=$?
diff --git a/test/headless.cpp b/test/headless.cpp
index 02dd0165ec..e1bdbdc061 100644
--- a/test/headless.cpp
+++ b/test/headless.cpp
@@ -9,8 +9,8 @@
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>
-#include "../common/headless_view.hpp"
-#include "../common/headless_display.hpp"
+#include <mbgl/platform/default/headless_view.hpp>
+#include <mbgl/platform/default/headless_display.hpp>
#include "./fixtures/fixture_log.hpp"
diff --git a/test/test.gyp b/test/test.gyp
index 49cc33739d..04287bd9a8 100644
--- a/test/test.gyp
+++ b/test/test.gyp
@@ -1,200 +1,154 @@
{
'includes': [
- '../common.gypi',
+ '../gyp/common.gypi',
+ '../gyp/platform.gypi',
],
'targets': [
- {
- 'target_name': 'link_gl',
- 'type': 'none',
- 'direct_dependent_settings': {
- 'conditions': [
- ['OS == "mac"', {
- 'xcode_settings': {
- 'OTHER_LDFLAGS': [
- '<@(glfw3_libraries)', # This is a hack since we're not actually using GLFW
- ],
- },
- }, {
- 'link_settings': {
- 'libraries': [
- '<@(glfw3_libraries)', # This is a hack since we're not actually using GLFW
- '-lboost_regex',
- ],
- },
- }],
- ],
- },
+ { 'target_name': 'rotation_range',
+ 'product_name': 'test_rotation_range',
+ 'type': 'executable',
+ 'sources': [
+ './main.cpp',
+ './rotation_range.cpp',
+ ],
+ 'dependencies': [
+ '../deps/gtest/gtest.gyp:gtest',
+ '../mapboxgl.gyp:mapboxgl',
+ ]
},
- {
- 'target_name': 'link_curl',
- 'type': 'none',
- 'direct_dependent_settings': {
- 'conditions': [
- ['OS == "mac"', {
- 'xcode_settings': {
- 'OTHER_CPLUSPLUSFLAGS':[
- '<@(curl_cflags)',
- ],
- 'OTHER_LDFLAGS': [
- '<@(curl_libraries)',
- ],
- },
- }, {
- 'cflags': [
- '<@(curl_cflags)',
- ],
- 'link_settings': {
- 'libraries': [
- '<@(curl_libraries)',
- ],
- },
- }],
- ],
- },
+ { 'target_name': 'clip_ids',
+ 'product_name': 'test_clip_ids',
+ 'type': 'executable',
+ 'sources': [
+ './main.cpp',
+ './clip_ids.cpp',
+ ],
+ 'dependencies': [
+ '../deps/gtest/gtest.gyp:gtest',
+ '../mapboxgl.gyp:mapboxgl',
+ ]
},
- {
- "target_name": "rotation_range",
- "product_name": "test_rotation_range",
- "type": "executable",
- "sources": [
- "./main.cpp",
- "./rotation_range.cpp",
- ],
- "dependencies": [
- "../deps/gtest/gtest.gyp:gtest",
- "../mapboxgl.gyp:mapboxgl",
- ]
- },
- {
- "target_name": "clip_ids",
- "product_name": "test_clip_ids",
- "type": "executable",
- "sources": [
- "./main.cpp",
- "./clip_ids.cpp",
- ],
- "dependencies": [
- "../deps/gtest/gtest.gyp:gtest",
- "../mapboxgl.gyp:mapboxgl",
- ]
- },
- {
- "target_name": "enums",
- "product_name": "test_enums",
- "type": "executable",
- "sources": [
- "./main.cpp",
- "./enums.cpp",
- ],
- "dependencies": [
- "../deps/gtest/gtest.gyp:gtest",
- "../mapboxgl.gyp:mapboxgl",
- ]
+ { 'target_name': 'enums',
+ 'product_name': 'test_enums',
+ 'type': 'executable',
+ 'sources': [
+ './main.cpp',
+ './enums.cpp',
+ ],
+ 'dependencies': [
+ '../deps/gtest/gtest.gyp:gtest',
+ '../mapboxgl.gyp:mapboxgl',
+ ]
},
- {
- "target_name": "style_parser",
- "product_name": "test_style_parser",
- "type": "executable",
- "sources": [
- "./main.cpp",
- "./style_parser.cpp",
- "./fixtures/fixture_log.hpp",
- "./fixtures/fixture_log.cpp",
- ],
- "dependencies": [
- "../deps/gtest/gtest.gyp:gtest",
- "../mapboxgl.gyp:mapboxgl",
- "../mapboxgl.gyp:copy_fixtures",
- ]
+ { 'target_name': 'style_parser',
+ 'product_name': 'test_style_parser',
+ 'type': 'executable',
+ 'sources': [
+ './main.cpp',
+ './style_parser.cpp',
+ './fixtures/fixture_log.hpp',
+ './fixtures/fixture_log.cpp',
+ ],
+ 'dependencies': [
+ '../deps/gtest/gtest.gyp:gtest',
+ '../mapboxgl.gyp:mapboxgl',
+ '../mapboxgl.gyp:copy_fixtures',
+ ]
},
- {
- "target_name": "variant",
- "product_name": "test_variant",
- "type": "executable",
- "sources": [
- "./main.cpp",
- "./variant.cpp",
- ],
- "dependencies": [
- "../deps/gtest/gtest.gyp:gtest",
- "../mapboxgl.gyp:mapboxgl",
- ]
+ { 'target_name': 'variant',
+ 'product_name': 'test_variant',
+ 'type': 'executable',
+ 'sources': [
+ './main.cpp',
+ './variant.cpp',
+ ],
+ 'dependencies': [
+ '../deps/gtest/gtest.gyp:gtest',
+ '../mapboxgl.gyp:mapboxgl',
+ ]
},
- {
- "target_name": "comparisons",
- "product_name": "test_comparisons",
- "type": "executable",
- "sources": [
- "./main.cpp",
- "./comparisons.cpp",
- ],
- "dependencies": [
- "../deps/gtest/gtest.gyp:gtest",
- "../mapboxgl.gyp:mapboxgl",
- ]
+ { 'target_name': 'comparisons',
+ 'product_name': 'test_comparisons',
+ 'type': 'executable',
+ 'sources': [
+ './main.cpp',
+ './comparisons.cpp',
+ ],
+ 'dependencies': [
+ '../deps/gtest/gtest.gyp:gtest',
+ '../mapboxgl.gyp:mapboxgl',
+ ]
},
- {
- "target_name": "tile",
- "product_name": "test_tile",
- "type": "executable",
- "sources": [
- "./main.cpp",
- "./tile.cpp",
- ],
- "dependencies": [
- "../deps/gtest/gtest.gyp:gtest",
- "../mapboxgl.gyp:mapboxgl",
- ]
+ { 'target_name': 'tile',
+ 'product_name': 'test_tile',
+ 'type': 'executable',
+ 'sources': [
+ './main.cpp',
+ './tile.cpp',
+ ],
+ 'dependencies': [
+ '../deps/gtest/gtest.gyp:gtest',
+ '../mapboxgl.gyp:mapboxgl',
+ ]
},
- {
- "target_name": "functions",
- "product_name": "test_functions",
- "type": "executable",
- "sources": [
- "./main.cpp",
- "./functions.cpp",
- ],
- "dependencies": [
- "../deps/gtest/gtest.gyp:gtest",
- "../mapboxgl.gyp:mapboxgl",
+ { 'target_name': 'functions',
+ 'product_name': 'test_functions',
+ 'type': 'executable',
+ 'sources': [
+ './main.cpp',
+ './functions.cpp',
+ ],
+ 'dependencies': [
+ '../deps/gtest/gtest.gyp:gtest',
+ '../mapboxgl.gyp:mapboxgl',
]
},
- {
- "target_name": "headless",
- "product_name": "test_headless",
- "type": "executable",
- "sources": [
- "./main.cpp",
- "./headless.cpp",
- "../common/headless_view.hpp",
- "../common/headless_view.cpp",
- "../common/headless_display.hpp",
- "../common/headless_display.cpp",
- "../common/platform_default.cpp",
- "./fixtures/fixture_request.cpp",
- "./fixtures/fixture_log.hpp",
- "./fixtures/fixture_log.cpp",
- ],
- "dependencies": [
- "../deps/gtest/gtest.gyp:gtest",
- "../mapboxgl.gyp:mapboxgl",
- "link_gl",
- ]
+ { 'target_name': 'headless',
+ 'product_name': 'test_headless',
+ 'type': 'executable',
+ 'sources': [
+ './main.cpp',
+ './headless.cpp',
+ './fixtures/fixture_request.cpp',
+ './fixtures/fixture_log.cpp',
+ '../platform/default/headless_view.cpp',
+ '../platform/default/headless_display.cpp',
+ ],
+ 'conditions': [
+ # add libuv include path and OpenGL libs
+ ['OS == "mac"',
+ {
+ 'xcode_settings': {
+ 'OTHER_CPLUSPLUSFLAGS': ['<@(uv_cflags)'],
+ 'OTHER_LDFLAGS': ['<@(glfw3_libraries)'],
+ },
+ },
+ {
+ 'cflags': ['<@(uv_cflags)'],
+ 'libraries': ['<@(glfw3_libraries)'],
+ }],
+ ],
+ 'dependencies': [
+ '../deps/gtest/gtest.gyp:gtest',
+ '../mapboxgl.gyp:mapboxgl',
+ '<(platform_library)',
+ ],
},
- {
- "target_name": "test",
- "type": "none",
- "dependencies": [
- "rotation_range",
- "clip_ids",
- "enums",
- "variant",
- "tile",
- "functions",
- "headless",
- "style_parser",
- "comparisons",
- ],
+
+ # Build all targets
+ { 'target_name': 'test',
+ 'type': 'none',
+ 'dependencies': [
+ 'rotation_range',
+ 'clip_ids',
+ 'enums',
+ 'variant',
+ 'tile',
+ 'functions',
+ 'headless',
+ 'style_parser',
+ 'comparisons',
+ ],
}
]
}