+static test_return_t port_TEST(void *)
+{
+ const char *args[]= { "--help", "--port=9090", 0 };
+
+ test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t pid_file_TEST(void *)
+{
+ const char *args[]= { "--help", "--pid-file=/tmp/foo.pid", 0 };
+
+ test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t log_file_TEST(void *)
+{
+ const char *args[]= { "--help", "--log-file=/tmp/foo.log", 0 };
+
+ test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t max_connections_file_TEST(void *)
+{
+ const char *args[]= { "--help", "--max-connections=/tmp/foo.max_connections", 0 };
+
+ test_compare(EXIT_SUCCESS, exec_cmdline(executable, args, true));
+
+ return TEST_SUCCESS;
+}
+
+typedef test_return_t (*libmemcached_test_callback_fn)(memcached_st *);
+
+static test_return_t _runner_default(libmemcached_test_callback_fn func, void *object)
+{
+ if (func)
+ {
+ test_true(object);
+ test_return_t ret;
+ try {
+ ret= func((memcached_st*)object);
+ }
+ catch (std::exception& e)
+ {
+ libtest::Error << e.what();
+ return TEST_FAILURE;
+ }
+
+ return ret;
+ }
+
+ return TEST_SUCCESS;
+}
+
+class MemcachedLightRunner : public libtest::Runner {
+public:
+ test_return_t run(test_callback_fn* func, void *object)
+ {
+ return _runner_default(libmemcached_test_callback_fn(func), object);
+ }
+};
+
+test_st cmdline_option_TESTS[] ={