New mason-based build system
This commit is contained in:
@@ -31,7 +31,7 @@ TEST(Enums, StyleLayerType) {
|
||||
ASSERT_EQ(StyleLayerTypeClass(StyleLayerType::Raster), StyleLayerTypeClass(StyleLayerType::Raster));
|
||||
ASSERT_EQ(StyleLayerTypeClass(StyleLayerType::Background), StyleLayerTypeClass(StyleLayerType::Background));
|
||||
|
||||
ASSERT_EQ(false, StyleLayerTypeClass("").valid());
|
||||
ASSERT_EQ(false, StyleLayerTypeClass("Backgrund").valid());
|
||||
ASSERT_FALSE(StyleLayerTypeClass("").valid());
|
||||
ASSERT_FALSE(StyleLayerTypeClass("Backgrund").valid());
|
||||
}
|
||||
|
||||
|
||||
12
test/fixtures/fixture_request.cpp
vendored
12
test/fixtures/fixture_request.cpp
vendored
@@ -35,11 +35,17 @@ void HTTPRequestBaton::start(const util::ptr<HTTPRequestBaton> &baton) {
|
||||
const size_t size = ftell(file);
|
||||
fseek(file, 0, SEEK_SET);
|
||||
baton->response->data.resize(size);
|
||||
fread(&baton->response->data[0], size, 1, file);
|
||||
const size_t read = fread(&baton->response->data[0], 1, size, file);
|
||||
fclose(file);
|
||||
|
||||
baton->response->code = 200;
|
||||
baton->type = HTTPResponseType::Successful;
|
||||
if (read == size) {
|
||||
baton->response->code = 200;
|
||||
baton->type = HTTPResponseType::Successful;
|
||||
} else {
|
||||
baton->response->code = 500;
|
||||
baton->type = HTTPResponseType::PermanentError;
|
||||
baton->response->message = "Read bytes differed from file size";
|
||||
}
|
||||
} else {
|
||||
baton->type = HTTPResponseType::PermanentError;
|
||||
baton->response->code = 404;
|
||||
|
||||
@@ -35,8 +35,8 @@ TEST_P(HeadlessTest, render) {
|
||||
// Parse style.
|
||||
rapidjson::Document styleDoc;
|
||||
styleDoc.Parse<0>((const char *const)style.c_str());
|
||||
ASSERT_EQ(false, styleDoc.HasParseError());
|
||||
ASSERT_EQ(true, styleDoc.IsObject());
|
||||
ASSERT_FALSE(styleDoc.HasParseError());
|
||||
ASSERT_TRUE(styleDoc.IsObject());
|
||||
|
||||
rapidjson::StringBuffer buffer;
|
||||
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
||||
@@ -46,16 +46,16 @@ TEST_P(HeadlessTest, render) {
|
||||
// Parse settings.
|
||||
rapidjson::Document infoDoc;
|
||||
infoDoc.Parse<0>((const char *const)info.c_str());
|
||||
ASSERT_EQ(false, infoDoc.HasParseError());
|
||||
ASSERT_EQ(true, infoDoc.IsObject());
|
||||
ASSERT_FALSE(infoDoc.HasParseError());
|
||||
ASSERT_TRUE(infoDoc.IsObject());
|
||||
|
||||
Log::Set<FixtureLogBackend>();
|
||||
|
||||
for (auto it = infoDoc.MemberBegin(), end = infoDoc.MemberEnd(); it != end; it++) {
|
||||
const std::string name { it->name.GetString(), it->name.GetStringLength() };
|
||||
const rapidjson::Value &value = it->value;
|
||||
ASSERT_EQ(true, value.IsObject());
|
||||
if (value.HasMember("center")) ASSERT_EQ(true, value["center"].IsArray());
|
||||
ASSERT_TRUE(value.IsObject());
|
||||
if (value.HasMember("center")) ASSERT_TRUE(value["center"].IsArray());
|
||||
|
||||
const std::string actual_image = base_directory + "tests/" + base + "/" + name + "/actual.png";
|
||||
|
||||
@@ -70,10 +70,10 @@ TEST_P(HeadlessTest, render) {
|
||||
std::vector<std::string> classes;
|
||||
if (value.HasMember("classes")) {
|
||||
const rapidjson::Value &js_classes = value["classes"];
|
||||
ASSERT_EQ(true, js_classes.IsArray());
|
||||
ASSERT_TRUE(js_classes.IsArray());
|
||||
for (rapidjson::SizeType i = 0; i < js_classes.Size(); i++) {
|
||||
const rapidjson::Value &js_class = js_classes[i];
|
||||
ASSERT_EQ(true, js_class.IsString());
|
||||
ASSERT_TRUE(js_class.IsString());
|
||||
classes.push_back({ js_class.GetString(), js_class.GetStringLength() });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ TEST_P(StyleParserTest, ParseStyle) {
|
||||
// Parse settings.
|
||||
rapidjson::Document doc;
|
||||
doc.Parse<0>((const char *const)info.c_str());
|
||||
ASSERT_EQ(false, doc.HasParseError());
|
||||
ASSERT_EQ(true, doc.IsObject());
|
||||
ASSERT_FALSE(doc.HasParseError());
|
||||
ASSERT_TRUE(doc.IsObject());
|
||||
|
||||
std::ifstream stylefile(style_path);
|
||||
ASSERT_TRUE(stylefile.good());
|
||||
|
||||
@@ -10,14 +10,9 @@
|
||||
'direct_dependent_settings': {
|
||||
'conditions': [
|
||||
['OS == "mac"', {
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-framework OpenGL',
|
||||
],
|
||||
},
|
||||
'xcode_settings': {
|
||||
'OTHER_LDFLAGS': [
|
||||
'-framework OpenGL',
|
||||
'<@(glfw3_libraries)', # This is a hack since we're not actually using GLFW
|
||||
],
|
||||
},
|
||||
}, {
|
||||
@@ -62,9 +57,6 @@
|
||||
"target_name": "rotation_range",
|
||||
"product_name": "test_rotation_range",
|
||||
"type": "executable",
|
||||
"libraries": [
|
||||
"-lpthread",
|
||||
],
|
||||
"sources": [
|
||||
"./main.cpp",
|
||||
"./rotation_range.cpp",
|
||||
@@ -78,9 +70,6 @@
|
||||
"target_name": "clip_ids",
|
||||
"product_name": "test_clip_ids",
|
||||
"type": "executable",
|
||||
"libraries": [
|
||||
"-lpthread",
|
||||
],
|
||||
"sources": [
|
||||
"./main.cpp",
|
||||
"./clip_ids.cpp",
|
||||
@@ -94,9 +83,6 @@
|
||||
"target_name": "enums",
|
||||
"product_name": "test_enums",
|
||||
"type": "executable",
|
||||
"libraries": [
|
||||
"-lpthread",
|
||||
],
|
||||
"sources": [
|
||||
"./main.cpp",
|
||||
"./enums.cpp",
|
||||
@@ -110,9 +96,6 @@
|
||||
"target_name": "style_parser",
|
||||
"product_name": "test_style_parser",
|
||||
"type": "executable",
|
||||
"libraries": [
|
||||
"-lpthread",
|
||||
],
|
||||
"sources": [
|
||||
"./main.cpp",
|
||||
"./style_parser.cpp",
|
||||
@@ -129,9 +112,6 @@
|
||||
"target_name": "variant",
|
||||
"product_name": "test_variant",
|
||||
"type": "executable",
|
||||
"libraries": [
|
||||
"-lpthread",
|
||||
],
|
||||
"sources": [
|
||||
"./main.cpp",
|
||||
"./variant.cpp",
|
||||
@@ -145,9 +125,6 @@
|
||||
"target_name": "comparisons",
|
||||
"product_name": "test_comparisons",
|
||||
"type": "executable",
|
||||
"libraries": [
|
||||
"-lpthread",
|
||||
],
|
||||
"sources": [
|
||||
"./main.cpp",
|
||||
"./comparisons.cpp",
|
||||
@@ -161,9 +138,6 @@
|
||||
"target_name": "tile",
|
||||
"product_name": "test_tile",
|
||||
"type": "executable",
|
||||
"libraries": [
|
||||
"-lpthread",
|
||||
],
|
||||
"sources": [
|
||||
"./main.cpp",
|
||||
"./tile.cpp",
|
||||
@@ -177,9 +151,6 @@
|
||||
"target_name": "functions",
|
||||
"product_name": "test_functions",
|
||||
"type": "executable",
|
||||
"libraries": [
|
||||
"-lpthread",
|
||||
],
|
||||
"sources": [
|
||||
"./main.cpp",
|
||||
"./functions.cpp",
|
||||
@@ -193,9 +164,6 @@
|
||||
"target_name": "headless",
|
||||
"product_name": "test_headless",
|
||||
"type": "executable",
|
||||
"libraries": [
|
||||
"-lpthread",
|
||||
],
|
||||
"sources": [
|
||||
"./main.cpp",
|
||||
"./headless.cpp",
|
||||
|
||||
Reference in New Issue
Block a user