Ignore:
Timestamp:
2018-07-05T21:41:23Z (7 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fceeb93
Parents:
e54bbde5
git-author:
Dzejrou <dzejrou@…> (2018-05-11 18:05:44)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
Message:

cpp: updated & fixed tests, now output is optional (for possible use with pcut)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/internal/test/tests.hpp

    re54bbde5 r96ae12b  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2018 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    4747            }
    4848
    49             bool run()
     49            bool run(bool report)
    5050            {
    5151                bool res{true};
     
    5555                for (auto test: tests_)
    5656                {
    57                     res &= test->run();
     57                    res &= test->run(report);
    5858                    succeeded += test->get_succeeded();
    5959                    failed += test->get_failed();
    6060                }
    6161
    62                 std::printf("\n");
    63                 if (res)
    64                     std::printf("[TESTS SUCCEEDED!]");
    65                 else
    66                     std::printf("[TESTS FAILED]");
    67                 std::printf("[%u OK][%u FAIL][%u TOTAL]\n",
    68                             succeeded, failed, (succeeded + failed));
     62                if (report)
     63                {
     64                    std::printf("\n");
     65                    if (res)
     66                        std::printf("[TESTS SUCCEEDED!]");
     67                    else
     68                        std::printf("[TESTS FAILED]");
     69                    std::printf("[%u OK][%u FAIL][%u TOTAL]\n",
     70                                succeeded, failed, (succeeded + failed));
     71                }
    6972
    7073                return res;
     
    8487    {
    8588        public:
    86             bool run() override;
     89            bool run(bool) override;
    8790            const char* name() override;
    8891
     
    9497    {
    9598        public:
    96             bool run() override;
     99            bool run(bool) override;
    97100            const char* name() override;
    98101
     
    109112    {
    110113        public:
    111             bool run() override;
     114            bool run(bool) override;
    112115            const char* name() override;
    113116
Note: See TracChangeset for help on using the changeset viewer.