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/DeepSpeechV1InferenceTest.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/DeepSpeechV1InferenceTest.hpp')
-rw-r--r-- | tests/DeepSpeechV1InferenceTest.hpp | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/tests/DeepSpeechV1InferenceTest.hpp b/tests/DeepSpeechV1InferenceTest.hpp index d859ba7505..ac799cb45a 100644 --- a/tests/DeepSpeechV1InferenceTest.hpp +++ b/tests/DeepSpeechV1InferenceTest.hpp @@ -99,31 +99,28 @@ 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.add_options() - ("input-seq-dir,s", po::value<std::string>(&m_InputSeqDir)->required(), - "Path to directory containing test data for m_InputSeq"); - options.add_options() - ("prev-state-h-dir,h", po::value<std::string>(&m_PrevStateHDir)->required(), - "Path to directory containing test data for m_PrevStateH"); - options.add_options() - ("prev-state-c-dir,c", po::value<std::string>(&m_PrevStateCDir)->required(), - "Path to directory containing test data for m_PrevStateC"); - options.add_options() - ("logits-dir,l", po::value<std::string>(&m_LogitsDir)->required(), - "Path to directory containing test data for m_Logits"); - options.add_options() - ("new-state-h-dir,H", po::value<std::string>(&m_NewStateHDir)->required(), - "Path to directory containing test data for m_NewStateH"); - options.add_options() - ("new-state-c-dir,C", po::value<std::string>(&m_NewStateCDir)->required(), - "Path to directory containing test data for m_NewStateC"); - - - Model::AddCommandLineOptions(options, m_ModelCommandLineOptions); + options + .allow_unrecognised_options() + .add_options() + ("s,input-seq-dir", "Path to directory containing test data for m_InputSeq", + cxxopts::value<std::string>(m_InputSeqDir)) + ("h,prev-state-h-dir", "Path to directory containing test data for m_PrevStateH", + cxxopts::value<std::string>(m_PrevStateHDir)) + ("c,prev-state-c-dir", "Path to directory containing test data for m_PrevStateC", + cxxopts::value<std::string>(m_PrevStateCDir)) + ("l,logits-dir", "Path to directory containing test data for m_Logits", + cxxopts::value<std::string>(m_LogitsDir)) + ("H,new-state-h-dir", "Path to directory containing test data for m_NewStateH", + cxxopts::value<std::string>(m_NewStateHDir)) + ("C,new-state-c-dir", "Path to directory containing test data for m_NewStateC", + cxxopts::value<std::string>(m_NewStateCDir)); + + required.insert(required.end(), {"input-seq-dir", "prev-state-h-dir", "prev-state-c-dir", "logits-dir", + "new-state-h-dir", "new-state-c-dir"}); + + Model::AddCommandLineOptions(options, m_ModelCommandLineOptions, required); } virtual bool ProcessCommandLineOptions(const InferenceTestOptions &commonOptions) override |