intl/icu/source/tools/ctestfw/unicode/testlog.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /********************************************************************
michael@0 2 * COPYRIGHT:
michael@0 3 * Copyright (c) 2004-2010, International Business Machines Corporation and
michael@0 4 * others. All Rights Reserved.
michael@0 5 ********************************************************************/
michael@0 6
michael@0 7 /* Created by grhoten 03/17/2004 */
michael@0 8
michael@0 9 /* Base class for data driven tests */
michael@0 10
michael@0 11 #ifndef U_TESTFW_TESTLOG
michael@0 12 #define U_TESTFW_TESTLOG
michael@0 13
michael@0 14 #include "unicode/errorcode.h"
michael@0 15 #include "unicode/unistr.h"
michael@0 16 #include "unicode/testtype.h"
michael@0 17
michael@0 18 /** Facilitates internal logging of data driven test service
michael@0 19 * It would be interesting to develop this into a full
michael@0 20 * fledged control system as in Java.
michael@0 21 */
michael@0 22 class T_CTEST_EXPORT_API TestLog {
michael@0 23 public:
michael@0 24 virtual ~TestLog();
michael@0 25 virtual void errln( const UnicodeString &message ) = 0;
michael@0 26 virtual void logln( const UnicodeString &message ) = 0;
michael@0 27 virtual void dataerrln( const UnicodeString &message ) = 0;
michael@0 28 virtual const char* getTestDataPath(UErrorCode& err) = 0;
michael@0 29 };
michael@0 30
michael@0 31 class T_CTEST_EXPORT_API IcuTestErrorCode : public ErrorCode {
michael@0 32 public:
michael@0 33 IcuTestErrorCode(TestLog &callingTestClass, const char *callingTestName) :
michael@0 34 testClass(callingTestClass), testName(callingTestName) {}
michael@0 35 virtual ~IcuTestErrorCode();
michael@0 36 // Returns TRUE if isFailure().
michael@0 37 UBool logIfFailureAndReset(const char *fmt, ...);
michael@0 38 UBool logDataIfFailureAndReset(const char *fmt, ...);
michael@0 39 protected:
michael@0 40 virtual void handleFailure() const;
michael@0 41 private:
michael@0 42 TestLog &testClass;
michael@0 43 const char *const testName;
michael@0 44 };
michael@0 45
michael@0 46 #endif

mercurial