ICU-7856 added support for -x option for DateFmtPerf project to output .xml file

X-SVN-Rev: 28410
This commit is contained in:
Alexey Gousev 2010-08-04 17:36:18 +00:00
parent f519d51352
commit 678654839e

View File

@ -139,18 +139,27 @@ int main(int argc, const char* argv[]){
ofstream out; ofstream out;
out.open(argv[2]); out.open(argv[2]);
out << "<perfTestResults icu=\"c\" version=\"" << U_ICU_VERSION << "\">" << endl;
for(int i = 0; i < 5; i++) for(int i = 0; i < 5; i++)
{ {
out << " <perfTestResult" << endl;
out << " test=\"";
switch(i) switch(i)
{ {
case 0: out << "<DateFormat> "; break; case 0: out << "DateFormat"; break;
case 1: out << "<BreakIterator Word> "; break; case 1: out << "BreakIterator Word"; break;
case 2: out << "<BreakIterator Char> "; break; case 2: out << "BreakIterator Char"; break;
case 3: out << "<NumbFormat> "; break; case 3: out << "NumbFormat"; break;
case 4: out << "<Collation> "; break; case 4: out << "Collation"; break;
} }
out << t[i] << endl; out << "\"" << endl;
int iter = 10000;
if(i > 2) iter = 100000;
out << " iterations=\"" << iter << "\"" << endl;
out << " time=\"" << t[i] << "\" />" << endl;
} }
out << "</perfTestResults>" << endl;
out.close(); out.close();
return 0; return 0;
@ -158,6 +167,7 @@ int main(int argc, const char* argv[]){
// Normal performance test mode // Normal performance test mode
UErrorCode status = U_ZERO_ERROR;
DateFormatPerfTest test(argc, argv, status); DateFormatPerfTest test(argc, argv, status);