]> git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/itmajor.cpp
ICU-8.11.2.tar.gz
[apple/icu.git] / icuSources / test / intltest / itmajor.cpp
1 /********************************************************************
2 * COPYRIGHT:
3 * Copyright (c) 1998-2006, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
6
7 /**
8 * MajorTestLevel is the top level test class for everything in the directory "IntlWork".
9 */
10
11 /***********************************************************************
12 * Modification history
13 * Date Name Description
14 * 02/14/2001 synwee Release collation for testing.
15 ***********************************************************************/
16
17 #include "unicode/utypes.h"
18 #include "itmajor.h"
19
20 #include "itutil.h"
21 #include "tscoll.h"
22 #include "itformat.h"
23 #include "ittrans.h"
24 #include "itrbbi.h"
25 #include "itrbnf.h"
26 #include "itrbnfp.h"
27 #include "itrbnfrt.h"
28 #include "normconf.h"
29 #include "regextst.h"
30 #include "tstnorm.h"
31 #include "canittst.h"
32 #include "icusvtst.h"
33 #include "testidna.h"
34 #include "convtest.h"
35 #include "csdetest.h"
36
37 #define CASE_SUITE(id, suite) case id: \
38 name = #suite; \
39 if(exec) { \
40 logln(#suite "---"); \
41 suite test; \
42 callTest(test, par); \
43 } \
44 break
45
46 void MajorTestLevel::runIndexedTest( int32_t index, UBool exec, const char* &name, char* par )
47 {
48 switch (index) {
49 case 0: name = "utility";
50 if (exec) {
51 logln("TestSuite Utilities---"); logln();
52 IntlTestUtilities test;
53 callTest( test, par );
54 }
55 break;
56
57 case 1: name = "normalize";
58 #if !UCONFIG_NO_NORMALIZATION
59 if (exec) {
60 logln("TestSuite Normalize---"); logln();
61 IntlTestNormalize test;
62 callTest( test, par );
63 }
64 #endif
65 break;
66
67 case 2: name = "collate";
68 #if !UCONFIG_NO_COLLATION
69 if (exec) {
70 logln("TestSuite Collator---"); logln();
71 IntlTestCollator test;
72 callTest( test, par );
73 }
74 #endif
75 break;
76
77 case 3: name = "regex";
78 #if !UCONFIG_NO_REGULAR_EXPRESSIONS
79 if (exec) {
80 logln("TestSuite Regex---"); logln();
81 RegexTest test;
82 callTest( test, par );
83 }
84 #endif
85 break;
86
87 case 4: name = "format";
88 #if !UCONFIG_NO_FORMATTING
89 if (exec) {
90 logln("TestSuite Format---"); logln();
91 IntlTestFormat test;
92 callTest( test, par );
93 }
94 #endif
95 break;
96
97 case 5: name = "translit";
98 #if !UCONFIG_NO_TRANSLITERATION
99 if (exec) {
100 logln("TestSuite Transliterator---"); logln();
101 IntlTestTransliterator test;
102 callTest( test, par );
103 }
104 #endif
105 break;
106
107 case 6: name = "rbbi";
108 #if !UCONFIG_NO_BREAK_ITERATION
109 if (exec) {
110 logln("TestSuite RuleBasedBreakIterator---"); logln();
111 IntlTestRBBI test;
112 callTest( test, par );
113 }
114 #endif
115 break;
116 case 7: name = "rbnf";
117 #if !UCONFIG_NO_FORMATTING
118 if (exec) {
119 logln("TestSuite RuleBasedNumberFormat----"); logln();
120 IntlTestRBNF test;
121 callTest(test, par);
122 }
123 #endif
124 break;
125 case 8: name = "rbnfrt";
126 #if !UCONFIG_NO_FORMATTING
127 if (exec) {
128 logln("TestSuite RuleBasedNumberFormat RT----"); logln();
129 RbnfRoundTripTest test;
130 callTest(test, par);
131 }
132 #endif
133 break;
134
135 case 9: name = "icuserv";
136 #if !UCONFIG_NO_SERVICE
137 if (exec) {
138 logln("TestSuite ICUService---"); logln();
139 ICUServiceTest test;
140 callTest(test, par);
141 }
142 #endif
143 break;
144 case 10: name = "idna";
145 #if !UCONFIG_NO_IDNA && !UCONFIG_NO_TRANSLITERATION
146 if(exec){
147 logln("TestSuite IDNA----"); logln();
148 TestIDNA test;
149 callTest(test,par);
150 }
151 #endif
152 break;
153 case 11: name = "convert";
154 #if !UCONFIG_NO_LEGACY_CONVERSION
155 if (exec) {
156 logln("TestSuite Conversion---"); logln();
157 ConversionTest test;
158 callTest( test, par );
159 }
160 #endif
161 break;
162
163 case 12: name = "rbnfp";
164 #if !UCONFIG_NO_FORMATTING
165 if (exec) {
166 logln("TestSuite RuleBasedNumberParse ----"); logln();
167 IntlTestRBNFParse test;
168 callTest(test, par);
169 }
170 #endif
171 break;
172
173 case 13: name = "csdet";
174 if (exec) {
175 logln("TestSuite CharsetDetection---"); logln();
176 CharsetDetectionTest test;
177 callTest(test, par);
178 }
179
180 break;
181
182 default: name = ""; break;
183 }
184
185
186 }
187
188 void IntlTestNormalize::runIndexedTest( int32_t index, UBool exec, const char* &name, char* par )
189 {
190 if(exec) logln("TestSuite Normalize:");
191 #if UCONFIG_NO_NORMALIZATION
192 name="";
193 #else
194 switch (index) {
195 CASE_SUITE(0, BasicNormalizerTest);
196 CASE_SUITE(1, NormalizerConformanceTest); // this takes a long time
197 CASE_SUITE(2, CanonicalIteratorTest);
198 default:
199 name="";
200 break;
201 }
202 #endif
203 }