void test_completed(const tut::test_result& tr) override
    {
        if (tr.group != current_group)
        {
            os << std::endl << tr.group << ": " << std::flush;
            current_group = tr.group;
        }

        os << tr << std::flush;

        // update global statistics
        switch (tr.result) {
            case test_result::ok:
                ok_count++;
                break;
            case test_result::fail:
            case test_result::rethrown:
                failures_count++;
                break;
            case test_result::ex:
            case test_result::ex_ctor:
                exceptions_count++;
                break;
            case test_result::warn:
                warnings_count++;
                break;
            case test_result::term:
                terminations_count++;
                break;
            case test_result::skipped:
                skipped_count++;
                break;
            case tut::test_result::dummy:
                assert( (tr.result != tut::test_result::dummy) && "Should never be called");
        } // switch

        if ( (tr.result != tut::test_result::ok) &&
             (tr.result != tut::test_result::skipped) )
        {
            not_passed.push_back(tr);
        }
    }
Esempio n. 2
0
    void test_completed(const tut::test_result& tr)
    {
        if (tr.group != current_group)
        {
            os << std::endl << tr.group << ": " << std::endl;
            current_group = tr.group;
        }

        os << tr << std::flush;
        if (tr.result == tut::test_result::ok)
        {
            ok_count++;
        }
        else if (tr.result == tut::test_result::ex)
        {
            exceptions_count++;
        }
        else if (tr.result == tut::test_result::ex_ctor)
        {
            exceptions_count++;
        }
        else if (tr.result == tut::test_result::fail)
        {
            failures_count++;
        }
        else if (tr.result == tut::test_result::warn)
        {
            warnings_count++;
        }
        else
        {
            terminations_count++;
        }

        if (tr.result != tut::test_result::ok)
        {
            not_passed.push_back(tr);
        }
    }