From 3929d9298d2c05fb2b304a39c448e8326a7b866a Mon Sep 17 00:00:00 2001 From: bergwerkgis Date: Mon, 14 Sep 2015 13:01:32 +0000 Subject: [PATCH] Benchmark: use return values of test runner. --- .gitignore | 1 + benchmark/test_array_allocation.cpp | 29 ++++++++++--------- benchmark/test_expression_parse.cpp | 2 +- .../test_numeric_cast_vs_static_cast.cpp | 7 +++-- benchmark/test_offset_converter.cpp | 5 ++-- benchmark/test_polygon_clipping.cpp | 9 +++--- benchmark/test_polygon_clipping_rendering.cpp | 11 +++---- benchmark/test_proj_transform1.cpp | 10 ++++--- benchmark/test_rendering.cpp | 5 ++-- benchmark/test_rendering_shared_map.cpp | 5 ++-- benchmark/test_utf_encoding.cpp | 8 +++-- 11 files changed, 52 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 9b10ae824..816bc0ec9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ *.a *.swp *.dylib +mapnik-gyp plugins/input/*.input plugins/input/templates/*.input demo/c++/rundemo diff --git a/benchmark/test_array_allocation.cpp b/benchmark/test_array_allocation.cpp index 05da7ae01..0eb2c5bcf 100644 --- a/benchmark/test_array_allocation.cpp +++ b/benchmark/test_array_allocation.cpp @@ -386,61 +386,62 @@ public: int main(int argc, char** argv) { + int retVal = 0; mapnik::parameters params; benchmark::handle_args(argc,argv,params); { test4 test_runner4(params); - run(test_runner4,"calloc"); + retVal = retVal | run(test_runner4,"calloc"); } { test1 test_runner(params); - run(test_runner,"malloc/memcpy"); + retVal = retVal | run(test_runner,"malloc/memcpy"); } { test1b test_runner(params); - run(test_runner,"malloc/memset"); + retVal = retVal | run(test_runner,"malloc/memset"); } { test1c test_runner(params); - run(test_runner,"operator new/std::fill"); + retVal = retVal | run(test_runner,"operator new/std::fill"); } { test2 test_runner(params); - run(test_runner,"operator new/memcpy"); + retVal = retVal | run(test_runner,"operator new/memcpy"); } { test3 test_runner(params); - run(test_runner,"vector(N)"); + retVal = retVal | run(test_runner,"vector(N)"); } { test3b test_runner(params); - run(test_runner,"vector/resize"); + retVal = retVal | run(test_runner,"vector/resize"); } { test3c test_runner(params); - run(test_runner,"vector/assign"); + retVal = retVal | run(test_runner,"vector/assign"); } { test3d test_runner(params); - run(test_runner,"deque(N)"); + retVal = retVal | run(test_runner,"deque(N)"); } { test5 test_runner(params); - run(test_runner,"std::string range"); + retVal = retVal | run(test_runner,"std::string range"); } { test5b test_runner(params); - run(test_runner,"std::string &[0]"); + retVal = retVal | run(test_runner,"std::string &[0]"); } { test6 test_runner(params); - run(test_runner,"valarray"); + retVal = retVal | run(test_runner,"valarray"); } #if BOOST_VERSION >= 105400 { test7 test_runner(params); - run(test_runner,"static_vector"); + retVal = retVal | run(test_runner,"static_vector"); } #endif - return 0; + return retVal; } diff --git a/benchmark/test_expression_parse.cpp b/benchmark/test_expression_parse.cpp index 704a69c7c..7e399223c 100644 --- a/benchmark/test_expression_parse.cpp +++ b/benchmark/test_expression_parse.cpp @@ -37,5 +37,5 @@ int main(int argc, char** argv) mapnik::parameters params; benchmark::handle_args(argc,argv,params); test test_runner(params); - run(test_runner,"expr parsing"); + return run(test_runner,"expr parsing"); } diff --git a/benchmark/test_numeric_cast_vs_static_cast.cpp b/benchmark/test_numeric_cast_vs_static_cast.cpp index 52865acd0..2a3e3cd81 100644 --- a/benchmark/test_numeric_cast_vs_static_cast.cpp +++ b/benchmark/test_numeric_cast_vs_static_cast.cpp @@ -75,13 +75,14 @@ int main(int argc, char** argv) { mapnik::parameters params; benchmark::handle_args(argc,argv,params); + int retVal = 0; { test_static test_runner(params); - run(test_runner,"static_cast"); + retVal = retVal | run(test_runner,"static_cast"); } { test_numeric test_runner(params); - run(test_runner,"numeric_cast"); + retVal = retVal | run(test_runner,"numeric_cast"); } - return 0; + return retVal; } diff --git a/benchmark/test_offset_converter.cpp b/benchmark/test_offset_converter.cpp index 4bd317558..4dc1fb851 100644 --- a/benchmark/test_offset_converter.cpp +++ b/benchmark/test_offset_converter.cpp @@ -93,9 +93,10 @@ int main(int argc, char** argv) { mapnik::parameters params; benchmark::handle_args(argc,argv,params); + int retVal = 0; { test_offset test_runner(params); - run(test_runner,"offset_test"); + retVal = run(test_runner,"offset_test"); } - return 0; + return retVal; } diff --git a/benchmark/test_polygon_clipping.cpp b/benchmark/test_polygon_clipping.cpp index 0005fc9b2..628e45759 100644 --- a/benchmark/test_polygon_clipping.cpp +++ b/benchmark/test_polygon_clipping.cpp @@ -528,19 +528,20 @@ int main(int argc, char** argv) throw std::runtime_error("could not open: '" + filename_ + "'"); std::string wkt_in( (std::istreambuf_iterator(in) ), (std::istreambuf_iterator()) ); + int retVal = 0; { test1 test_runner(params,wkt_in,clipping_box); - run(test_runner,"clipping polygon with agg"); + retVal = retVal | run(test_runner,"clipping polygon with agg"); } { test3 test_runner(params,wkt_in,clipping_box); - run(test_runner,"clipping polygon with boost"); + retVal = retVal | run(test_runner,"clipping polygon with boost"); } /* { test4 test_runner(params,wkt_in,clipping_box); - run(test_runner,"clipping polygon with clipper_tree"); + retVal = retVal | run(test_runner,"clipping polygon with clipper_tree"); } */ - return 0; + return retVal; } diff --git a/benchmark/test_polygon_clipping_rendering.cpp b/benchmark/test_polygon_clipping_rendering.cpp index 88f20d5e0..375e4c602 100644 --- a/benchmark/test_polygon_clipping_rendering.cpp +++ b/benchmark/test_polygon_clipping_rendering.cpp @@ -51,29 +51,30 @@ int main(int argc, char** argv) mapnik::box2d z1(-20037508.3428,-8317435.0606,20037508.3428,18399242.7298); // bbox for 16/10491/22911.png mapnik::box2d z16(-13622912.929097254,6026906.8062295765,-13621689.93664469,6028129.79868214); + int retVal = 0; { test test_runner(params, "benchmark/data/polygon_rendering_clip.xml", z1); - run(test_runner,"polygon clip render z1"); + retVal = retVal | run(test_runner,"polygon clip render z1"); } { test test_runner(params, "benchmark/data/polygon_rendering_no_clip.xml", z1); - run(test_runner,"polygon noclip render z1"); + retVal = retVal | run(test_runner,"polygon noclip render z1"); } { test test_runner(params, "benchmark/data/polygon_rendering_clip.xml", z16); - run(test_runner,"polygon clip render z16"); + retVal = retVal | run(test_runner,"polygon clip render z16"); } { test test_runner(params, "benchmark/data/polygon_rendering_no_clip.xml", z16); - run(test_runner,"polygon noclip render z16"); + retVal = retVal | run(test_runner,"polygon noclip render z16"); } - return 0; + return retVal; } diff --git a/benchmark/test_proj_transform1.cpp b/benchmark/test_proj_transform1.cpp index b98a49758..920eb9981 100644 --- a/benchmark/test_proj_transform1.cpp +++ b/benchmark/test_proj_transform1.cpp @@ -67,32 +67,34 @@ int main(int argc, char** argv) std::string to_str("+init=epsg:3857"); std::string from_str2("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"); std::string to_str2("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over"); + int retVal = 0; test test_runner(params, from_str, to_str, from, to, true); - run(test_runner,"lonlat->merc epsg"); + retVal = retVal | run(test_runner,"lonlat->merc epsg"); test test_runner2(params, from_str2, to_str2, from, to, true); - run(test_runner2,"lonlat->merc literal"); + retVal = retVal | run(test_runner2,"lonlat->merc literal"); test test_runner3(params, to_str, from_str, to, from, true); - run(test_runner3,"merc->lonlat epsg"); + retVal = retVal | run(test_runner3,"merc->lonlat epsg"); test test_runner4(params, to_str2, from_str2, to, from, true); - return run(test_runner4,"merc->lonlat literal"); + retVal = retVal | run(test_runner4,"merc->lonlat literal"); + return retVal; } diff --git a/benchmark/test_rendering.cpp b/benchmark/test_rendering.cpp index 30e80be77..3515473b3 100644 --- a/benchmark/test_rendering.cpp +++ b/benchmark/test_rendering.cpp @@ -88,6 +88,7 @@ public: int main(int argc, char** argv) { + int retVal = 0; try { mapnik::parameters params; @@ -102,7 +103,7 @@ int main(int argc, char** argv) mapnik::datasource_cache::instance().register_datasources("./plugins/input/"); { test test_runner(params); - run(test_runner,*name); + retVal = run(test_runner,*name); } } catch (std::exception const& ex) @@ -110,5 +111,5 @@ int main(int argc, char** argv) std::clog << ex.what() << "\n"; return -1; } - return 0; + return retVal; } diff --git a/benchmark/test_rendering_shared_map.cpp b/benchmark/test_rendering_shared_map.cpp index 0b5705374..78af7e9f7 100644 --- a/benchmark/test_rendering_shared_map.cpp +++ b/benchmark/test_rendering_shared_map.cpp @@ -145,6 +145,7 @@ public: int main(int argc, char** argv) { + int retVal = 0; try { mapnik::parameters params; @@ -159,7 +160,7 @@ int main(int argc, char** argv) mapnik::datasource_cache::instance().register_datasources("./plugins/input/"); { test test_runner(params); - run(test_runner,*name); + retVal = run(test_runner,*name); } } catch (std::exception const& ex) @@ -167,5 +168,5 @@ int main(int argc, char** argv) std::clog << ex.what() << "\n"; return -1; } - return 0; + return retVal; } diff --git a/benchmark/test_utf_encoding.cpp b/benchmark/test_utf_encoding.cpp index 100cbd6a8..31916c15b 100644 --- a/benchmark/test_utf_encoding.cpp +++ b/benchmark/test_utf_encoding.cpp @@ -97,14 +97,16 @@ int main(int argc, char** argv) { mapnik::parameters params; benchmark::handle_args(argc,argv,params); + int retVal = 0; #ifndef __linux__ test test_runner(params); - run(test_runner,"utf encode std::codecvt"); + retVal = retVal | run(test_runner,"utf encode std::codecvt"); #else std::clog << "skipping 'utf encode std::codecvt' test since is not supported on __linux__\n"; #endif test2 test_runner2(params); - run(test_runner2,"utf encode boost::locale"); + retVal = retVal | run(test_runner2,"utf encode boost::locale"); test3 test_runner3(params); - return run(test_runner3,"utf encode ICU"); + retVal = retVal | run(test_runner3,"utf encode ICU"); + return retVal; }