mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-4379 Show elapsed time of test suite to verify that uprv_getUTCtime can show subsecond precision.
X-SVN-Rev: 17346
This commit is contained in:
parent
f0096e265f
commit
ac150dfac8
3 changed files with 38 additions and 0 deletions
|
@ -108,6 +108,8 @@ int main(int argc, const char* const argv[])
|
|||
TestNode *root;
|
||||
const char *warnOrErr = "Failure";
|
||||
const char** argv2;
|
||||
UDate startTime, endTime;
|
||||
int32_t diffTime;
|
||||
|
||||
/* initial check for the default converter */
|
||||
UErrorCode errorCode = U_ZERO_ERROR;
|
||||
|
@ -116,6 +118,8 @@ int main(int argc, const char* const argv[])
|
|||
|
||||
U_MAIN_INIT_ARGS(argc, argv);
|
||||
|
||||
startTime = ucal_getNow();
|
||||
|
||||
argv2 = (const char**) malloc(sizeof(char*) * argc);
|
||||
if (argv2 == NULL) {
|
||||
printf("*** Error: Out of memory (too many cmd line args?)\n");
|
||||
|
@ -258,6 +262,15 @@ int main(int argc, const char* const argv[])
|
|||
} /* End of loop that repeats the entire test, if requested. (Normally doesn't loop) */
|
||||
|
||||
free((void*)argv2);
|
||||
|
||||
endTime = ucal_getNow();
|
||||
diffTime = (int32_t)(endTime - startTime);
|
||||
printf("Elapsed Time: %02d:%02d:%02d.%03d\n",
|
||||
((diffTime%U_MILLIS_PER_DAY)/U_MILLIS_PER_HOUR),
|
||||
((diffTime%U_MILLIS_PER_HOUR)/U_MILLIS_PER_MINUTE),
|
||||
((diffTime%U_MILLIS_PER_MINUTE)/U_MILLIS_PER_SECOND),
|
||||
(diffTime%U_MILLIS_PER_SECOND));
|
||||
|
||||
return nerrors ? 1 : 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -911,9 +911,13 @@ main(int argc, char* argv[])
|
|||
UErrorCode errorCode = U_ZERO_ERROR;
|
||||
UConverter *cnv = NULL;
|
||||
const char *warnOrErr = "Failure";
|
||||
UDate startTime, endTime;
|
||||
int32_t diffTime;
|
||||
|
||||
U_MAIN_INIT_ARGS(argc, argv);
|
||||
|
||||
startTime = Calendar::getNow();
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (argv[i][0] == '-') {
|
||||
const char* str = argv[i] + 1;
|
||||
|
@ -1138,6 +1142,13 @@ main(int argc, char* argv[])
|
|||
if (execCount <= 0) {
|
||||
fprintf(stdout, "***** Not all called tests actually exist! *****\n");
|
||||
}
|
||||
endTime = Calendar::getNow();
|
||||
diffTime = (int32_t)(endTime - startTime);
|
||||
printf("Elapsed Time: %02d:%02d:%02d.%03d\n",
|
||||
((diffTime%U_MILLIS_PER_DAY)/U_MILLIS_PER_HOUR),
|
||||
((diffTime%U_MILLIS_PER_HOUR)/U_MILLIS_PER_MINUTE),
|
||||
((diffTime%U_MILLIS_PER_MINUTE)/U_MILLIS_PER_SECOND),
|
||||
(diffTime%U_MILLIS_PER_SECOND));
|
||||
return major.getErrors();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "ustr_cnv.h"
|
||||
#include "iotest.h"
|
||||
#include "unicode/tstdtmod.h"
|
||||
#include "unicode/ucal.h"
|
||||
|
||||
#if U_IOSTREAM_SOURCE >= 199711
|
||||
#include <iostream>
|
||||
|
@ -866,6 +867,10 @@ int main(int argc, char* argv[])
|
|||
int32_t nerrors = 0;
|
||||
TestNode *root = NULL;
|
||||
UErrorCode errorCode = U_ZERO_ERROR;
|
||||
UDate startTime, endTime;
|
||||
int32_t diffTime;
|
||||
|
||||
startTime = ucal_getNow();
|
||||
|
||||
/* Check whether ICU will initialize without forcing the build data directory into
|
||||
* the ICU_DATA path. Success here means either the data dll contains data, or that
|
||||
|
@ -917,5 +922,14 @@ int main(int argc, char* argv[])
|
|||
cleanUpTestTree(root);
|
||||
DataDrivenLogger::cleanUp();
|
||||
u_cleanup();
|
||||
|
||||
endTime = ucal_getNow();
|
||||
diffTime = (int32_t)(endTime - startTime);
|
||||
printf("Elapsed Time: %02d:%02d:%02d.%03d\n",
|
||||
((diffTime%U_MILLIS_PER_DAY)/U_MILLIS_PER_HOUR),
|
||||
((diffTime%U_MILLIS_PER_HOUR)/U_MILLIS_PER_MINUTE),
|
||||
((diffTime%U_MILLIS_PER_MINUTE)/U_MILLIS_PER_SECOND),
|
||||
(diffTime%U_MILLIS_PER_SECOND));
|
||||
|
||||
return nerrors;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue