]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: catch boost::program_options errors
authorLoic Dachary <loic-201408@dachary.org>
Wed, 17 Sep 2014 13:37:01 +0000 (15:37 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Wed, 8 Oct 2014 06:59:15 +0000 (08:59 +0200)
And display it before returning on error.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
src/test/bench/small_io_bench_dumb.cc
src/test/bench/small_io_bench_fs.cc
src/test/bench/tp_bench.cc
src/test/erasure-code/ceph_erasure_code.cc
src/test/erasure-code/ceph_erasure_code_benchmark.cc

index fbcca87c7f52da618411ad72f0e68a147d89bed7..db038231c424aade8bae60d385baf48d30729dea 100644 (file)
@@ -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<const char *> ceph_options, def_args;
   ceph_options.reserve(ceph_option_strings.size());
index 74f6565174d88b5ca248cf4d874d430b917314aa..5b00ee394b0bd5d803480642b5f136695d9161ef 100644 (file)
@@ -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<const char *> ceph_options, def_args;
   ceph_options.reserve(ceph_option_strings.size());
index 778dcac3ff565e54eeea2b8c2cd02319ff014b97..f3df9fece77f1a18cfa4dd5d0681818728e36fc0 100644 (file)
@@ -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<const char *> ceph_options, def_args;
   ceph_options.reserve(ceph_option_strings.size());
index 4a5282d4f7e74a52ea5ee4b6efefac2638ccd630..4f19157f06ad149699f8df4888b312d592a66c8d 100644 (file)
@@ -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;
   }
 }
 
index c104651b372b579f75ea40dd39f08ebc538e32f0..1b19e2c50e160d9ece7c1554dc39b3a073e7ba5c 100644 (file)
@@ -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;
   }
 }