From d03b00acd71847fa2db1c5308c87d3b57c781bf9 Mon Sep 17 00:00:00 2001 From: Moritz Pflanzer Date: Mon, 17 Jul 2017 13:50:12 +0100 Subject: COMPMID-415: Fix dataset modes Change-Id: I266e8a22890c914edb3335104f073e79d2bf0ad9 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/80766 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- framework/TestCaseFactory.h | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'framework/TestCaseFactory.h') diff --git a/framework/TestCaseFactory.h b/framework/TestCaseFactory.h index 09e9d198d6..e275e298d6 100644 --- a/framework/TestCaseFactory.h +++ b/framework/TestCaseFactory.h @@ -24,6 +24,7 @@ #ifndef ARM_COMPUTE_TEST_TEST_CASE_FACTORY #define ARM_COMPUTE_TEST_TEST_CASE_FACTORY +#include "DatasetModes.h" #include "TestCase.h" #include "support/ToolchainSupport.h" @@ -44,9 +45,10 @@ public: * * @param[in] suite_name Name of the test suite to which the test case has been added. * @param[in] name Name of the test case. + * @param[in] mode Datset mode of the test case. * @param[in] description Description of data arguments. */ - TestCaseFactory(std::string suite_name, std::string name, std::string description = ""); + TestCaseFactory(std::string suite_name, std::string name, DatasetMode mode, std::string description = ""); /** Default destructor. */ virtual ~TestCaseFactory() = default; @@ -57,6 +59,12 @@ public: */ std::string name() const; + /** Get the mode for which test case will be enabled. + * + * @return Dataset mode of the test case. + */ + DatasetMode mode() const; + /** Factory function to create the test case * * @return Unique pointer to a newly created test case. @@ -67,6 +75,7 @@ private: const std::string _suite_name; const std::string _test_name; const std::string _data_description; + const DatasetMode _mode{ DatasetMode::ALL }; }; /** Implementation of a test case factory to create non-data test cases. */ @@ -88,10 +97,11 @@ public: * * @param[in] suite_name Name of the test suite to which the test case has been added. * @param[in] test_name Name of the test case. + * @param[in] mode Mode in which the test case is enabled. * @param[in] description Description of data arguments. * @param[in] data Input data for the test case. */ - DataTestCaseFactory(std::string suite_name, std::string test_name, std::string description, const D &data); + DataTestCaseFactory(std::string suite_name, std::string test_name, DatasetMode mode, std::string description, const D &data); std::unique_ptr make() const override; @@ -99,8 +109,8 @@ private: D _data; }; -inline TestCaseFactory::TestCaseFactory(std::string suite_name, std::string test_name, std::string description) - : _suite_name{ std::move(suite_name) }, _test_name{ std::move(test_name) }, _data_description{ std::move(description) } +inline TestCaseFactory::TestCaseFactory(std::string suite_name, std::string test_name, DatasetMode mode, std::string description) + : _suite_name{ std::move(suite_name) }, _test_name{ std::move(test_name) }, _data_description{ std::move(description) }, _mode{ mode } { } @@ -116,6 +126,11 @@ inline std::string TestCaseFactory::name() const return name; } +inline DatasetMode TestCaseFactory::mode() const +{ + return _mode; +} + template inline std::unique_ptr SimpleTestCaseFactory::make() const { @@ -123,8 +138,8 @@ inline std::unique_ptr SimpleTestCaseFactory::make() const } template -inline DataTestCaseFactory::DataTestCaseFactory(std::string suite_name, std::string test_name, std::string description, const D &data) - : TestCaseFactory{ std::move(suite_name), std::move(test_name), std::move(description) }, _data{ data } +inline DataTestCaseFactory::DataTestCaseFactory(std::string suite_name, std::string test_name, DatasetMode mode, std::string description, const D &data) + : TestCaseFactory{ std::move(suite_name), std::move(test_name), mode, std::move(description) }, _data{ data } { } -- cgit v1.2.1