From: Loic Dachary Date: Wed, 17 Sep 2014 13:37:01 +0000 (+0200) Subject: test: catch boost::program_options errors X-Git-Tag: v0.88~91^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0100c9cfd2b105ec17ca0e90e4634075a6972147;p=ceph.git test: catch boost::program_options errors And display it before returning on error. Signed-off-by: Loic Dachary --- diff --git a/src/test/bench/small_io_bench_dumb.cc b/src/test/bench/small_io_bench_dumb.cc index fbcca87c7f5..db038231c42 100644 --- a/src/test/bench/small_io_bench_dumb.cc +++ b/src/test/bench/small_io_bench_dumb.cc @@ -83,6 +83,9 @@ int main(int argc, char **argv) ceph_option_strings = po::collect_unrecognized(parsed.options, po::include_positional); + } catch(po::error &e) { + std::cerr << e.what() << std::endl; + return 1; } vector ceph_options, def_args; ceph_options.reserve(ceph_option_strings.size()); diff --git a/src/test/bench/small_io_bench_fs.cc b/src/test/bench/small_io_bench_fs.cc index 74f6565174d..5b00ee394b0 100644 --- a/src/test/bench/small_io_bench_fs.cc +++ b/src/test/bench/small_io_bench_fs.cc @@ -94,6 +94,9 @@ int main(int argc, char **argv) ceph_option_strings = po::collect_unrecognized(parsed.options, po::include_positional); + } catch(po::error &e) { + std::cerr << e.what() << std::endl; + return 1; } vector ceph_options, def_args; ceph_options.reserve(ceph_option_strings.size()); diff --git a/src/test/bench/tp_bench.cc b/src/test/bench/tp_bench.cc index 778dcac3ff5..f3df9fece77 100644 --- a/src/test/bench/tp_bench.cc +++ b/src/test/bench/tp_bench.cc @@ -130,6 +130,9 @@ int main(int argc, char **argv) ceph_option_strings = po::collect_unrecognized(parsed.options, po::include_positional); + } catch(po::error &e) { + std::cerr << e.what() << std::endl; + return 1; } vector ceph_options, def_args; ceph_options.reserve(ceph_option_strings.size()); diff --git a/src/test/erasure-code/ceph_erasure_code.cc b/src/test/erasure-code/ceph_erasure_code.cc index 4a5282d4f7e..4f19157f06a 100644 --- a/src/test/erasure-code/ceph_erasure_code.cc +++ b/src/test/erasure-code/ceph_erasure_code.cc @@ -151,6 +151,9 @@ int main(int argc, char** argv) { if (err) return err; return eccommand.run(); + } catch(po::error &e) { + cerr << e.what() << endl; + return 1; } } diff --git a/src/test/erasure-code/ceph_erasure_code_benchmark.cc b/src/test/erasure-code/ceph_erasure_code_benchmark.cc index c104651b372..1b19e2c50e1 100644 --- a/src/test/erasure-code/ceph_erasure_code_benchmark.cc +++ b/src/test/erasure-code/ceph_erasure_code_benchmark.cc @@ -223,6 +223,9 @@ int main(int argc, char** argv) { if (err) return err; return ecbench.run(); + } catch(po::error &e) { + cerr << e.what() << endl; + return 1; } }