COMPMID-415: Add expected failures and disabled tests

Change-Id: I16be0340cd0c5e57c1dd76a71c057bc867fcf6a0
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/81445
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
diff --git a/framework/TestCaseFactory.h b/framework/TestCaseFactory.h
index e275e29..b8c8cdb 100644
--- a/framework/TestCaseFactory.h
+++ b/framework/TestCaseFactory.h
@@ -41,14 +41,28 @@
 class TestCaseFactory
 {
 public:
+    /** Test case status.
+     *
+     * ACTIVE == Test is run and result is validated. Failure on failed validation.
+     * EXPECTED_FAILURE == Test is run and result is validated. Failure on successful validation.
+     * DISABLED == Test is not run.
+     */
+    enum class Status
+    {
+        ACTIVE,
+        EXPECTED_FAILURE,
+        DISABLED
+    };
+
     /** Constructor.
      *
      * @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] status      Status of the test case.
      * @param[in] description Description of data arguments.
      */
-    TestCaseFactory(std::string suite_name, std::string name, DatasetMode mode, std::string description = "");
+    TestCaseFactory(std::string suite_name, std::string name, DatasetMode mode, Status status, std::string description = "");
 
     /** Default destructor. */
     virtual ~TestCaseFactory() = default;
@@ -65,6 +79,12 @@
      */
     DatasetMode mode() const;
 
+    /** Get the status of the test case.
+     *
+     * @return Status of the test case.
+     */
+    Status status() const;
+
     /** Factory function to create the test case
      *
      * @return Unique pointer to a newly created test case.
@@ -76,6 +96,7 @@
     const std::string _test_name;
     const std::string _data_description;
     const DatasetMode _mode{ DatasetMode::ALL };
+    const Status      _status{ Status::ACTIVE };
 };
 
 /** Implementation of a test case factory to create non-data test cases. */
@@ -98,10 +119,11 @@
      * @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] status      Status of the test case.
      * @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, DatasetMode mode, std::string description, const D &data);
+    DataTestCaseFactory(std::string suite_name, std::string test_name, DatasetMode mode, Status status, std::string description, const D &data);
 
     std::unique_ptr<TestCase> make() const override;
 
@@ -109,8 +131,9 @@
     D _data;
 };
 
-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 }
+inline TestCaseFactory::TestCaseFactory(std::string suite_name, std::string test_name, DatasetMode mode, Status status, std::string description)
+    : _suite_name{ std::move(suite_name) }, _test_name{ std::move(test_name) }, _data_description{ std::move(description) }, _mode{ mode }, _status{ status }
+
 {
 }
 
@@ -131,6 +154,31 @@
     return _mode;
 }
 
+inline TestCaseFactory::Status TestCaseFactory::status() const
+{
+    return _status;
+}
+
+inline ::std::ostream &operator<<(::std::ostream &stream, TestCaseFactory::Status status)
+{
+    switch(status)
+    {
+        case TestCaseFactory::Status::ACTIVE:
+            stream << "ACTIVE";
+            break;
+        case TestCaseFactory::Status::EXPECTED_FAILURE:
+            stream << "EXPECTED_FAILURE";
+            break;
+        case TestCaseFactory::Status::DISABLED:
+            stream << "DISABLED";
+            break;
+        default:
+            throw std::invalid_argument("Unsupported test case factory status");
+    }
+
+    return stream;
+}
+
 template <typename T>
 inline std::unique_ptr<TestCase> SimpleTestCaseFactory<T>::make() const
 {
@@ -138,8 +186,8 @@
 }
 
 template <typename T, typename D>
-inline DataTestCaseFactory<T, D>::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 }
+inline DataTestCaseFactory<T, D>::DataTestCaseFactory(std::string suite_name, std::string test_name, DatasetMode mode, Status status, std::string description, const D &data)
+    : TestCaseFactory{ std::move(suite_name), std::move(test_name), mode, status, std::move(description) }, _data{ data }
 {
 }