diff options
author | James Ward <james.ward@arm.com> | 2020-10-12 14:17:36 +0100 |
---|---|---|
committer | James Ward <james.ward@arm.com> | 2020-10-14 12:41:58 +0000 |
commit | c89829f1f47855227f9a842c979f3a43800ea826 (patch) | |
tree | 40d58dfa85ff4f8ebf03f5b594ace1775fae2c22 /tests/MobileNetSsdInferenceTest.hpp | |
parent | f9f33a04626756b73e6fd5c89092fd4bcb504b16 (diff) | |
download | armnn-c89829f1f47855227f9a842c979f3a43800ea826.tar.gz |
IVGCVSW-5280 Switch tests/InferenceTest and derived tests over to cxxopts
* refactor AddCommandLineOptions() functions to allow checking of required options
* add CxxoptsUtils.hpp file for convenience functions
!referencetests:268500
Signed-off-by: James Ward <james.ward@arm.com>
Change-Id: Ica954b210b2981b7cd10995f0d75fcb2a2f7b443
Diffstat (limited to 'tests/MobileNetSsdInferenceTest.hpp')
-rw-r--r-- | tests/MobileNetSsdInferenceTest.hpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/MobileNetSsdInferenceTest.hpp b/tests/MobileNetSsdInferenceTest.hpp index 2a5d47d634..7377640629 100644 --- a/tests/MobileNetSsdInferenceTest.hpp +++ b/tests/MobileNetSsdInferenceTest.hpp @@ -152,18 +152,19 @@ public: : m_ConstructModel(constructModel) {} - virtual void AddCommandLineOptions(boost::program_options::options_description& options) override + virtual void AddCommandLineOptions(cxxopts::Options& options, std::vector<std::string>& required) override { - namespace po = boost::program_options; + options + .allow_unrecognised_options() + .add_options() + ("d,data-dir", "Path to directory containing test data", cxxopts::value<std::string>(m_DataDir)); - options.add_options() - ("data-dir,d", po::value<std::string>(&m_DataDir)->required(), - "Path to directory containing test data"); + required.emplace_back("data-dir"); - Model::AddCommandLineOptions(options, m_ModelCommandLineOptions); + Model::AddCommandLineOptions(options, m_ModelCommandLineOptions, required); } - virtual bool ProcessCommandLineOptions(const InferenceTestOptions &commonOptions) override + virtual bool ProcessCommandLineOptions(const InferenceTestOptions& commonOptions) override { if (!ValidateDirectory(m_DataDir)) { |