aboutsummaryrefslogtreecommitdiff
path: root/tests/YoloInferenceTest.hpp
diff options
context:
space:
mode:
authorJames Ward <james.ward@arm.com>2020-10-12 14:17:36 +0100
committerJames Ward <james.ward@arm.com>2020-10-14 12:41:58 +0000
commitc89829f1f47855227f9a842c979f3a43800ea826 (patch)
tree40d58dfa85ff4f8ebf03f5b594ace1775fae2c22 /tests/YoloInferenceTest.hpp
parentf9f33a04626756b73e6fd5c89092fd4bcb504b16 (diff)
downloadarmnn-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/YoloInferenceTest.hpp')
-rw-r--r--tests/YoloInferenceTest.hpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/YoloInferenceTest.hpp b/tests/YoloInferenceTest.hpp
index 81ba0f5127..4f391a84a5 100644
--- a/tests/YoloInferenceTest.hpp
+++ b/tests/YoloInferenceTest.hpp
@@ -10,13 +10,13 @@
#include <armnn/utility/Assert.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
+#include <boost/multi_array.hpp>
+#include <boost/test/tools/floating_point_comparison.hpp>
+
#include <algorithm>
#include <array>
#include <utility>
-#include <boost/multi_array.hpp>
-#include <boost/test/tools/floating_point_comparison.hpp>
-
constexpr size_t YoloOutputSize = 1470;
template <typename Model>
@@ -187,18 +187,17 @@ public:
{
}
- 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()
- ("data-dir,d", po::value<std::string>(&m_DataDir)->required(),
- "Path to directory containing test data");
+ options
+ .allow_unrecognised_options()
+ .add_options()
+ ("d,data-dir", "Path to directory containing test data", cxxopts::value<std::string>(m_DataDir));
- 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))
{