Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions icu4c/source/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,21 @@ If set, it will REPLACE any automatic list of libraries.],
*) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
esac],
samples=true)

# Enable Automake-compatible test output format
AC_ARG_ENABLE([automake-test-format],
AS_HELP_STRING([--enable-automake-test-format],
[Generate test output in Automake format (PASS / FAIL: testname) ]),
[
if test "x$enableval" = "xyes"; then
UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_AUTOMAKE_TEST_FORMAT=1"
AC_MSG_RESULT([Automake test format is enabled])
else
AC_MSG_RESULT([Automake test format is disabled])
fi
],
[enable_automake_test_format=no])

ICU_CONDITIONAL(SAMPLES, test "$samples" = true)

ICUDATA_CHAR=$U_ENDIAN_CHAR
Expand Down Expand Up @@ -1366,3 +1381,5 @@ then
fi

$as_unset _CXX_CXXSUFFIX


10 changes: 9 additions & 1 deletion icu4c/source/test/intltest/intltest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,11 +824,19 @@ UBool IntlTest::runTestLoop( char* testname, char* par, char *baseName )
saveBaseLoc[0]=0; /* reset path */

if (lastErrorCount == errorCount) {
snprintf( msg, sizeof(msg), " } OK: %s ", name );
#ifdef U_AUTOMAKE_TEST_FORMAT
snprintf(msg, sizeof(msg), "PASS: %s\n }", name);
#else
snprintf(msg, sizeof(msg), " } OK: %s ", name );
#endif
if(!no_time) str_timeDelta(msg+strlen(msg),timeStop-timeStart);
lastTestFailed = false;
}else{
#ifdef U_AUTOMAKE_TEST_FORMAT
snprintf(msg, sizeof(msg), "FAIL: %s\n } (ERRORS: %li)", name, static_cast<long>(errorCount - lastErrorCount));
#else
snprintf(msg, sizeof(msg), " } ERRORS (%li) in %s", static_cast<long>(errorCount - lastErrorCount), name);
#endif
if(!no_time) str_timeDelta(msg+strlen(msg),timeStop-timeStart);

for(int i=0;i<LL_indentlevel;i++) {
Expand Down
9 changes: 8 additions & 1 deletion icu4c/source/tools/ctestfw/ctest.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,16 @@ static void iterateTestsWithLevel ( const TestNode* root,
ctest_xml_testcase(pathToFunction, pathToFunction, timeSeconds, (myERROR_COUNT!=ERROR_COUNT)?"error":NULL);

if (myERROR_COUNT != ERROR_COUNT) {
log_testinfo_i("} ---[%d ERRORS in %s] ", ERROR_COUNT - myERROR_COUNT, pathToFunction);
#ifdef U_AUTOMAKE_TEST_FORMAT
log_testinfo_i("\nFAIL: %s\n} ---[ERRORS: %d]", root->name,ERROR_COUNT - myERROR_COUNT);
#else
log_testinfo_i("} ---[%d ERRORS in %s] ", ERROR_COUNT - myERROR_COUNT,pathToFunction);
#endif
strcpy(ERROR_LOG[ERRONEOUS_FUNCTION_COUNT++], pathToFunction);
} else {
#ifdef U_AUTOMAKE_TEST_FORMAT
log_testinfo_i("\nPASS: %s\n", root->name);
#endif
if(!ON_LINE) { /* had some output */
int spaces = FLAG_INDENT-(depth-1);
log_testinfo_i("} %*s[OK] ", spaces, "---");
Expand Down