Пример #1
0
void TestOutput::printTestsEnded(const TestResult& result)
{
    print("\n\r");
    if (result.getFailureCount() > 0) {
        if (color_) {
            print("\033[31;1m");
        }
        print("Errors (");
        print(result.getFailureCount());
        print(" failures, ");
    }
    else {
        if (color_) {
            print("\033[32;1m");
        }
        print("OK (");
    }
    print(result.getTestCount());
    print(" tests, ");
    print(result.getRunCount());
    print(" ran, ");
    print(result.getCheckCount());
    print(" checks, ");
    print(result.getIgnoredCount());
    print(" ignored, ");
    print(result.getFilteredOutCount());
    print(" filtered out, ");
    print(result.getTotalExecutionTime());
    print(" ms)");
    if (color_) {
        print("\033[m");
    }
    print("\n\r\n\r");
}
Пример #2
0
void TestOutput::printTestsEnded(const TestResult& result)
{
    print("\n");
    const bool anyTestFailed = result.getFailureCount() > 0;
    if (anyTestFailed) {
        if (color_) {
            print("\033[31;1m");
        }
        print("Errors (");
        print(result.getFailureCount());
        print(" failures, ");
    }
    else {
        if (color_) {
            print("\033[32;1m");
        }
        print("OK (");
    }
    print(result.getTestCount());
    print(" tests, ");
    print(result.getRunCount());
    print(" ran, ");
    print(result.getCheckCount());
    print(" checks, ");
    print(result.getIgnoredCount());
    print(" ignored, ");
    print(result.getFilteredOutCount());
    print(" filtered out, ");
    if (shuffleSeed_ != SHUFFLE_DISABLED && (verbose_ || anyTestFailed)) {
        print("shuffle seed was: ");
        print(shuffleSeed_);
        print(", ");
    }
    print(result.getTotalExecutionTime());
    print(" ms)");
    if (color_) {
        print("\033[m");
    }
    print("\n\n");

    dotCount_ = 0;
}
void MemoryLeakWarningPlugin::postTestAction(UtestShell& test, TestResult& result)
{
	memLeakDetector_->stopChecking();
	int leaks = memLeakDetector_->totalMemoryLeaks(mem_leak_period_checking);

	if (!ignoreAllWarnings_ && expectedLeaks_ != leaks && failureCount_ == result.getFailureCount()) {
		TestFailure f(&test, memLeakDetector_->report(mem_leak_period_checking));
		result.addFailure(f);
	}
	memLeakDetector_->markCheckingPeriodLeaksAsNonCheckingPeriod();
	ignoreAllWarnings_ = false;
	expectedLeaks_ = 0;
}
void MemoryLeakWarningPlugin::preTestAction(UtestShell& /*test*/, TestResult& result)
{
	memLeakDetector_->startChecking();
	failureCount_ = result.getFailureCount();
}
Пример #5
0
int main( int argc, char *argv[] )
{
    TestResult result;
    TestRegistry::runAllTests( result );
    return result.getFailureCount();
}