2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @author Lukasz Wrzosek (l.wrzosek@samsung.com)
19 * @author Marcin Niesluchowski (m.niesluchow@samsung.com)
21 * @brief Header file with implementation of Statistic class
24 #ifndef DPL_TEST_STATISTIC_H
25 #define DPL_TEST_STATISTIC_H
29 #include <dpl/assert.h>
30 #include <dpl/test/test_results_collector.h>
45 void AddTest(TestResultsCollectorBase::FailStatus status)
49 case TestResultsCollectorBase::FailStatus::FAILED: ++m_failed;
51 case TestResultsCollectorBase::FailStatus::IGNORED: ++m_ignored;
53 case TestResultsCollectorBase::FailStatus::NONE: ++m_passed;
56 Assert(false && "Bad FailStatus");
60 std::size_t GetTotal() const
64 std::size_t GetPassed() const
68 std::size_t GetSuccesed() const
72 std::size_t GetFailed() const
76 std::size_t GetIgnored() const
80 float GetPassedOrIgnoredPercend() const
82 float passIgnoredPercent =
83 100.0f * (static_cast<float>(m_passed)
84 + static_cast<float>(m_ignored))
85 / static_cast<float>(m_count);
86 return passIgnoredPercent;
91 std::size_t m_ignored;
99 #endif // DPL_TEST_STATISTIC_H