source: mainline/uspace/lib/cpp/src/__bits/test/test.cpp@ c6f23a7

Last change on this file since c6f23a7 was b57ba05, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Update headers in C++ files

  • Property mode set to 100644
File size: 957 bytes
Line 
1/*
2 * SPDX-FileCopyrightText: 2018 Jaroslav Jindrak
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <__bits/test/test.hpp>
8#include <cstdio>
9
10namespace std::test
11{
12 void test_suite::report(bool result, const char* tname)
13 {
14 if (!report_)
15 return;
16
17 if (result)
18 std::printf("[%s][%s] ... OK\n", name(), tname);
19 else
20 std::printf("[%s][%s] ... FAIL\n", name(), tname);
21 }
22
23 void test_suite::start()
24 {
25 if (report_)
26 std::printf("\n[TEST START][%s]\n", name());
27 }
28
29 bool test_suite::end()
30 {
31 if (report_)
32 std::printf("[TEST END][%s][%u OK][%u FAIL]\n",
33 name(), succeeded_, failed_);
34 return ok_;
35 }
36
37 unsigned int test_suite::get_failed() const noexcept
38 {
39 return failed_;
40 }
41
42 unsigned int test_suite::get_succeeded() const noexcept
43 {
44 return succeeded_;
45 }
46}
Note: See TracBrowser for help on using the repository browser.