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::Type type)
49 case TestResultsCollectorBase::FailStatus::INTERNAL:
50 case TestResultsCollectorBase::FailStatus::FAILED: ++m_failed;
52 case TestResultsCollectorBase::FailStatus::IGNORED: ++m_ignored;
54 case TestResultsCollectorBase::FailStatus::NONE: ++m_passed;
57 Assert(false && "Bad FailStatus");
61 std::size_t GetTotal() const
65 std::size_t GetPassed() const
69 std::size_t GetSuccesed() const
73 std::size_t GetFailed() const
77 std::size_t GetIgnored() const
81 float GetPassedOrIgnoredPercend() const
83 float passIgnoredPercent =
84 100.0f * (static_cast<float>(m_passed)
85 + static_cast<float>(m_ignored))
86 / static_cast<float>(m_count);
87 return passIgnoredPercent;
92 std::size_t m_ignored;
100 #endif // DPL_TEST_STATISTIC_H