Benchmark: use return values of test runner.

This commit is contained in:
bergwerkgis 2015-09-14 13:01:32 +00:00
parent 291089dec7
commit 3929d9298d
11 changed files with 52 additions and 40 deletions

1
.gitignore vendored
View file

@ -11,6 +11,7 @@
*.a *.a
*.swp *.swp
*.dylib *.dylib
mapnik-gyp
plugins/input/*.input plugins/input/*.input
plugins/input/templates/*.input plugins/input/templates/*.input
demo/c++/rundemo demo/c++/rundemo

View file

@ -386,61 +386,62 @@ public:
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
int retVal = 0;
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc,argv,params);
{ {
test4 test_runner4(params); test4 test_runner4(params);
run(test_runner4,"calloc"); retVal = retVal | run(test_runner4,"calloc");
} }
{ {
test1 test_runner(params); test1 test_runner(params);
run(test_runner,"malloc/memcpy"); retVal = retVal | run(test_runner,"malloc/memcpy");
} }
{ {
test1b test_runner(params); test1b test_runner(params);
run(test_runner,"malloc/memset"); retVal = retVal | run(test_runner,"malloc/memset");
} }
{ {
test1c test_runner(params); test1c test_runner(params);
run(test_runner,"operator new/std::fill"); retVal = retVal | run(test_runner,"operator new/std::fill");
} }
{ {
test2 test_runner(params); test2 test_runner(params);
run(test_runner,"operator new/memcpy"); retVal = retVal | run(test_runner,"operator new/memcpy");
} }
{ {
test3 test_runner(params); test3 test_runner(params);
run(test_runner,"vector(N)"); retVal = retVal | run(test_runner,"vector(N)");
} }
{ {
test3b test_runner(params); test3b test_runner(params);
run(test_runner,"vector/resize"); retVal = retVal | run(test_runner,"vector/resize");
} }
{ {
test3c test_runner(params); test3c test_runner(params);
run(test_runner,"vector/assign"); retVal = retVal | run(test_runner,"vector/assign");
} }
{ {
test3d test_runner(params); test3d test_runner(params);
run(test_runner,"deque(N)"); retVal = retVal | run(test_runner,"deque(N)");
} }
{ {
test5 test_runner(params); test5 test_runner(params);
run(test_runner,"std::string range"); retVal = retVal | run(test_runner,"std::string range");
} }
{ {
test5b test_runner(params); test5b test_runner(params);
run(test_runner,"std::string &[0]"); retVal = retVal | run(test_runner,"std::string &[0]");
} }
{ {
test6 test_runner(params); test6 test_runner(params);
run(test_runner,"valarray"); retVal = retVal | run(test_runner,"valarray");
} }
#if BOOST_VERSION >= 105400 #if BOOST_VERSION >= 105400
{ {
test7 test_runner(params); test7 test_runner(params);
run(test_runner,"static_vector"); retVal = retVal | run(test_runner,"static_vector");
} }
#endif #endif
return 0; return retVal;
} }

View file

@ -37,5 +37,5 @@ int main(int argc, char** argv)
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc,argv,params);
test test_runner(params); test test_runner(params);
run(test_runner,"expr parsing"); return run(test_runner,"expr parsing");
} }

View file

@ -75,13 +75,14 @@ int main(int argc, char** argv)
{ {
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc,argv,params);
int retVal = 0;
{ {
test_static test_runner(params); test_static test_runner(params);
run(test_runner,"static_cast"); retVal = retVal | run(test_runner,"static_cast");
} }
{ {
test_numeric test_runner(params); test_numeric test_runner(params);
run(test_runner,"numeric_cast"); retVal = retVal | run(test_runner,"numeric_cast");
} }
return 0; return retVal;
} }

View file

@ -93,9 +93,10 @@ int main(int argc, char** argv)
{ {
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc,argv,params);
int retVal = 0;
{ {
test_offset test_runner(params); test_offset test_runner(params);
run(test_runner,"offset_test"); retVal = run(test_runner,"offset_test");
} }
return 0; return retVal;
} }

View file

@ -528,19 +528,20 @@ int main(int argc, char** argv)
throw std::runtime_error("could not open: '" + filename_ + "'"); throw std::runtime_error("could not open: '" + filename_ + "'");
std::string wkt_in( (std::istreambuf_iterator<char>(in) ), std::string wkt_in( (std::istreambuf_iterator<char>(in) ),
(std::istreambuf_iterator<char>()) ); (std::istreambuf_iterator<char>()) );
int retVal = 0;
{ {
test1 test_runner(params,wkt_in,clipping_box); 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); 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); 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;
} }

View file

@ -51,29 +51,30 @@ int main(int argc, char** argv)
mapnik::box2d<double> z1(-20037508.3428,-8317435.0606,20037508.3428,18399242.7298); mapnik::box2d<double> z1(-20037508.3428,-8317435.0606,20037508.3428,18399242.7298);
// bbox for 16/10491/22911.png // bbox for 16/10491/22911.png
mapnik::box2d<double> z16(-13622912.929097254,6026906.8062295765,-13621689.93664469,6028129.79868214); mapnik::box2d<double> z16(-13622912.929097254,6026906.8062295765,-13621689.93664469,6028129.79868214);
int retVal = 0;
{ {
test test_runner(params, test test_runner(params,
"benchmark/data/polygon_rendering_clip.xml", "benchmark/data/polygon_rendering_clip.xml",
z1); z1);
run(test_runner,"polygon clip render z1"); retVal = retVal | run(test_runner,"polygon clip render z1");
} }
{ {
test test_runner(params, test test_runner(params,
"benchmark/data/polygon_rendering_no_clip.xml", "benchmark/data/polygon_rendering_no_clip.xml",
z1); z1);
run(test_runner,"polygon noclip render z1"); retVal = retVal | run(test_runner,"polygon noclip render z1");
} }
{ {
test test_runner(params, test test_runner(params,
"benchmark/data/polygon_rendering_clip.xml", "benchmark/data/polygon_rendering_clip.xml",
z16); z16);
run(test_runner,"polygon clip render z16"); retVal = retVal | run(test_runner,"polygon clip render z16");
} }
{ {
test test_runner(params, test test_runner(params,
"benchmark/data/polygon_rendering_no_clip.xml", "benchmark/data/polygon_rendering_no_clip.xml",
z16); z16);
run(test_runner,"polygon noclip render z16"); retVal = retVal | run(test_runner,"polygon noclip render z16");
} }
return 0; return retVal;
} }

View file

@ -67,32 +67,34 @@ int main(int argc, char** argv)
std::string to_str("+init=epsg:3857"); std::string to_str("+init=epsg:3857");
std::string from_str2("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"); 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"); 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, test test_runner(params,
from_str, from_str,
to_str, to_str,
from, from,
to, to,
true); true);
run(test_runner,"lonlat->merc epsg"); retVal = retVal | run(test_runner,"lonlat->merc epsg");
test test_runner2(params, test test_runner2(params,
from_str2, from_str2,
to_str2, to_str2,
from, from,
to, to,
true); true);
run(test_runner2,"lonlat->merc literal"); retVal = retVal | run(test_runner2,"lonlat->merc literal");
test test_runner3(params, test test_runner3(params,
to_str, to_str,
from_str, from_str,
to, to,
from, from,
true); true);
run(test_runner3,"merc->lonlat epsg"); retVal = retVal | run(test_runner3,"merc->lonlat epsg");
test test_runner4(params, test test_runner4(params,
to_str2, to_str2,
from_str2, from_str2,
to, to,
from, from,
true); true);
return run(test_runner4,"merc->lonlat literal"); retVal = retVal | run(test_runner4,"merc->lonlat literal");
return retVal;
} }

View file

@ -88,6 +88,7 @@ public:
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
int retVal = 0;
try try
{ {
mapnik::parameters params; mapnik::parameters params;
@ -102,7 +103,7 @@ int main(int argc, char** argv)
mapnik::datasource_cache::instance().register_datasources("./plugins/input/"); mapnik::datasource_cache::instance().register_datasources("./plugins/input/");
{ {
test test_runner(params); test test_runner(params);
run(test_runner,*name); retVal = run(test_runner,*name);
} }
} }
catch (std::exception const& ex) catch (std::exception const& ex)
@ -110,5 +111,5 @@ int main(int argc, char** argv)
std::clog << ex.what() << "\n"; std::clog << ex.what() << "\n";
return -1; return -1;
} }
return 0; return retVal;
} }

View file

@ -145,6 +145,7 @@ public:
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
int retVal = 0;
try try
{ {
mapnik::parameters params; mapnik::parameters params;
@ -159,7 +160,7 @@ int main(int argc, char** argv)
mapnik::datasource_cache::instance().register_datasources("./plugins/input/"); mapnik::datasource_cache::instance().register_datasources("./plugins/input/");
{ {
test test_runner(params); test test_runner(params);
run(test_runner,*name); retVal = run(test_runner,*name);
} }
} }
catch (std::exception const& ex) catch (std::exception const& ex)
@ -167,5 +168,5 @@ int main(int argc, char** argv)
std::clog << ex.what() << "\n"; std::clog << ex.what() << "\n";
return -1; return -1;
} }
return 0; return retVal;
} }

View file

@ -97,14 +97,16 @@ int main(int argc, char** argv)
{ {
mapnik::parameters params; mapnik::parameters params;
benchmark::handle_args(argc,argv,params); benchmark::handle_args(argc,argv,params);
int retVal = 0;
#ifndef __linux__ #ifndef __linux__
test test_runner(params); test test_runner(params);
run(test_runner,"utf encode std::codecvt"); retVal = retVal | run(test_runner,"utf encode std::codecvt");
#else #else
std::clog << "skipping 'utf encode std::codecvt' test since <codecvt> is not supported on __linux__\n"; std::clog << "skipping 'utf encode std::codecvt' test since <codecvt> is not supported on __linux__\n";
#endif #endif
test2 test_runner2(params); test2 test_runner2(params);
run(test_runner2,"utf encode boost::locale"); retVal = retVal | run(test_runner2,"utf encode boost::locale");
test3 test_runner3(params); test3 test_runner3(params);
return run(test_runner3,"utf encode ICU"); retVal = retVal | run(test_runner3,"utf encode ICU");
return retVal;
} }