diff options
Diffstat (limited to 'vespalib/src/tests/programoptions/programoptions_testutils.h')
-rw-r--r-- | vespalib/src/tests/programoptions/programoptions_testutils.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vespalib/src/tests/programoptions/programoptions_testutils.h b/vespalib/src/tests/programoptions/programoptions_testutils.h new file mode 100644 index 00000000000..a6f103f3e95 --- /dev/null +++ b/vespalib/src/tests/programoptions/programoptions_testutils.h @@ -0,0 +1,32 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +/** + * This class contains some test utilities, to create argc/argv inputs for + * application tests. + */ + +#pragma once + +#include <string> +#include <vector> + +namespace vespalib { + +class AppOptions { + int _argc; + const char** _argv; + std::vector<std::string> _source; + + AppOptions(const AppOptions&); + AppOptions& operator=(const AppOptions&); + +public: + AppOptions(const std::string& optString); + ~AppOptions(); + + int getArgCount() const { return _argc; } + const char* const* getArguments() const { return _argv; } + +}; + +} // vespalib + |