diff mbox series

[v4] icu: use automake ptest output format

Message ID 20251105070341.2335739-1-jiaying.song.cn@windriver.com
State New
Headers show
Series [v4] icu: use automake ptest output format | expand

Commit Message

Song, Jiaying (CN) Nov. 5, 2025, 7:03 a.m. UTC
From: Jiaying Song <jiaying.song.cn@windriver.com>

Make ICU ptest output compatible with Automake format.

Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
---
 ...utput-compatible-with-Automake-forma.patch | 52 +++++++++++++++++++
 meta/recipes-support/icu/icu_77-1.bb          |  3 +-
 2 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/icu/icu/0001-Make-ICU-ptest-output-compatible-with-Automake-forma.patch

Comments

Alexander Kanavin Nov. 5, 2025, 10:17 a.m. UTC | #1
Thanks for the rework and submission, I think this is good.

Alex

On Wed, 5 Nov 2025 at 08:03, <jiaying.song.cn@windriver.com> wrote:
>
> From: Jiaying Song <jiaying.song.cn@windriver.com>
>
> Make ICU ptest output compatible with Automake format.
>
> Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
> ---
>  ...utput-compatible-with-Automake-forma.patch | 52 +++++++++++++++++++
>  meta/recipes-support/icu/icu_77-1.bb          |  3 +-
>  2 files changed, 54 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-support/icu/icu/0001-Make-ICU-ptest-output-compatible-with-Automake-forma.patch
>
> diff --git a/meta/recipes-support/icu/icu/0001-Make-ICU-ptest-output-compatible-with-Automake-forma.patch b/meta/recipes-support/icu/icu/0001-Make-ICU-ptest-output-compatible-with-Automake-forma.patch
> new file mode 100644
> index 0000000000..a3d9b46835
> --- /dev/null
> +++ b/meta/recipes-support/icu/icu/0001-Make-ICU-ptest-output-compatible-with-Automake-forma.patch
> @@ -0,0 +1,52 @@
> +From f56e295e936c6c6d9c7219ef649697891cd11382 Mon Sep 17 00:00:00 2001
> +From: Jiaying Song <jiaying.song.cn@windriver.com>
> +Date: Mon, 3 Nov 2025 11:34:06 +0800
> +Subject: [PATCH] Make ICU ptest output compatible with Automake format
> +
> +Change test result format to PASS/FAIL for Automake compatibility
> +
> +Upstream-Status: Submitted [https://github.com/unicode-org/icu/pull/3764]
> +
> +Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
> +---
> + test/intltest/intltest.cpp | 4 ++--
> + tools/ctestfw/ctest.c      | 3 ++-
> + 2 files changed, 4 insertions(+), 3 deletions(-)
> +
> +diff --git a/test/intltest/intltest.cpp b/test/intltest/intltest.cpp
> +index 33829b0..07071ea 100644
> +--- a/test/intltest/intltest.cpp
> ++++ b/test/intltest/intltest.cpp
> +@@ -830,11 +830,11 @@ UBool IntlTest::runTestLoop( char* testname, char* par, char *baseName )
> +             saveBaseLoc[0]=0; /* reset path */
> +
> +             if (lastErrorCount == errorCount) {
> +-                snprintf( msg, sizeof(msg),  "   } OK:   %s ", name );
> ++                snprintf(msg, sizeof(msg), "PASS: %s\n   }", name);
> +                 if(!no_time) str_timeDelta(msg+strlen(msg),timeStop-timeStart);
> +                 lastTestFailed = false;
> +             }else{
> +-                snprintf(msg, sizeof(msg), "   } ERRORS (%li) in %s", static_cast<long>(errorCount - lastErrorCount), name);
> ++                snprintf(msg, sizeof(msg), "FAIL: %s\n   } (ERRORS: %li)", name, static_cast<long>(errorCount - lastErrorCount));
> +                 if(!no_time) str_timeDelta(msg+strlen(msg),timeStop-timeStart);
> +
> +                 for(int i=0;i<LL_indentlevel;i++) {
> +diff --git a/tools/ctestfw/ctest.c b/tools/ctestfw/ctest.c
> +index 7634526..727b164 100644
> +--- a/tools/ctestfw/ctest.c
> ++++ b/tools/ctestfw/ctest.c
> +@@ -413,9 +413,10 @@ 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);
> ++          log_testinfo_i("\nFAIL: %s\n} ---[ERRORS: %d]", root->name, ERROR_COUNT - myERROR_COUNT);
> +           strcpy(ERROR_LOG[ERRONEOUS_FUNCTION_COUNT++], pathToFunction);
> +         } else {
> ++          log_testinfo_i("\nPASS: %s\n", root->name);
> +           if(!ON_LINE) { /* had some output */
> +             int spaces = FLAG_INDENT-(depth-1);
> +             log_testinfo_i("} %*s[OK] ", spaces, "---");
> +--
> +2.34.1
> +
> diff --git a/meta/recipes-support/icu/icu_77-1.bb b/meta/recipes-support/icu/icu_77-1.bb
> index fa25b3e7c8..370c14af81 100644
> --- a/meta/recipes-support/icu/icu_77-1.bb
> +++ b/meta/recipes-support/icu/icu_77-1.bb
> @@ -122,7 +122,8 @@ SRC_URI = "${BASE_SRC_URI};name=code \
>             file://0001-ICU-23120-Mask-UnicodeStringTest-TestLargeMemory-on-.patch \
>             file://0001-test-Add-support-ptest.patch \
>             file://run-ptest \
> -           "
> +           file://0001-Make-ICU-ptest-output-compatible-with-Automake-forma.patch \
> +          "
>
>  SRC_URI:append:class-target = "\
>             file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/meta/recipes-support/icu/icu/0001-Make-ICU-ptest-output-compatible-with-Automake-forma.patch b/meta/recipes-support/icu/icu/0001-Make-ICU-ptest-output-compatible-with-Automake-forma.patch
new file mode 100644
index 0000000000..a3d9b46835
--- /dev/null
+++ b/meta/recipes-support/icu/icu/0001-Make-ICU-ptest-output-compatible-with-Automake-forma.patch
@@ -0,0 +1,52 @@ 
+From f56e295e936c6c6d9c7219ef649697891cd11382 Mon Sep 17 00:00:00 2001
+From: Jiaying Song <jiaying.song.cn@windriver.com>
+Date: Mon, 3 Nov 2025 11:34:06 +0800
+Subject: [PATCH] Make ICU ptest output compatible with Automake format
+
+Change test result format to PASS/FAIL for Automake compatibility
+
+Upstream-Status: Submitted [https://github.com/unicode-org/icu/pull/3764]
+
+Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
+---
+ test/intltest/intltest.cpp | 4 ++--
+ tools/ctestfw/ctest.c      | 3 ++-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/test/intltest/intltest.cpp b/test/intltest/intltest.cpp
+index 33829b0..07071ea 100644
+--- a/test/intltest/intltest.cpp
++++ b/test/intltest/intltest.cpp
+@@ -830,11 +830,11 @@ UBool IntlTest::runTestLoop( char* testname, char* par, char *baseName )
+             saveBaseLoc[0]=0; /* reset path */
+             
+             if (lastErrorCount == errorCount) {
+-                snprintf( msg, sizeof(msg),  "   } OK:   %s ", name );
++                snprintf(msg, sizeof(msg), "PASS: %s\n   }", name);
+                 if(!no_time) str_timeDelta(msg+strlen(msg),timeStop-timeStart);
+                 lastTestFailed = false;
+             }else{
+-                snprintf(msg, sizeof(msg), "   } ERRORS (%li) in %s", static_cast<long>(errorCount - lastErrorCount), name);
++                snprintf(msg, sizeof(msg), "FAIL: %s\n   } (ERRORS: %li)", name, static_cast<long>(errorCount - lastErrorCount));
+                 if(!no_time) str_timeDelta(msg+strlen(msg),timeStop-timeStart);
+ 
+                 for(int i=0;i<LL_indentlevel;i++) {
+diff --git a/tools/ctestfw/ctest.c b/tools/ctestfw/ctest.c
+index 7634526..727b164 100644
+--- a/tools/ctestfw/ctest.c
++++ b/tools/ctestfw/ctest.c
+@@ -413,9 +413,10 @@ 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);
++          log_testinfo_i("\nFAIL: %s\n} ---[ERRORS: %d]", root->name, ERROR_COUNT - myERROR_COUNT);
+           strcpy(ERROR_LOG[ERRONEOUS_FUNCTION_COUNT++], pathToFunction);
+         } else {
++          log_testinfo_i("\nPASS: %s\n", root->name);
+           if(!ON_LINE) { /* had some output */
+             int spaces = FLAG_INDENT-(depth-1);
+             log_testinfo_i("} %*s[OK] ", spaces, "---");
+-- 
+2.34.1
+
diff --git a/meta/recipes-support/icu/icu_77-1.bb b/meta/recipes-support/icu/icu_77-1.bb
index fa25b3e7c8..370c14af81 100644
--- a/meta/recipes-support/icu/icu_77-1.bb
+++ b/meta/recipes-support/icu/icu_77-1.bb
@@ -122,7 +122,8 @@  SRC_URI = "${BASE_SRC_URI};name=code \
            file://0001-ICU-23120-Mask-UnicodeStringTest-TestLargeMemory-on-.patch \
            file://0001-test-Add-support-ptest.patch \
            file://run-ptest \
-           "
+           file://0001-Make-ICU-ptest-output-compatible-with-Automake-forma.patch \
+          "
 
 SRC_URI:append:class-target = "\
            file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \