diff options
| -rw-r--r-- | recipes-ids/samhain/files/0001-Format-test-output-to-match-Automake-standards.patch | 102 | ||||
| -rw-r--r-- | recipes-ids/samhain/samhain.inc | 1 |
2 files changed, 103 insertions, 0 deletions
diff --git a/recipes-ids/samhain/files/0001-Format-test-output-to-match-Automake-standards.patch b/recipes-ids/samhain/files/0001-Format-test-output-to-match-Automake-standards.patch new file mode 100644 index 0000000..eccd242 --- /dev/null +++ b/recipes-ids/samhain/files/0001-Format-test-output-to-match-Automake-standards.patch | |||
| @@ -0,0 +1,102 @@ | |||
| 1 | From 065813e5ec274942c4e8803d813ae863fb17313f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Haixiao Yan <haixiao.yan.cn@windriver.com> | ||
| 3 | Date: Sun, 6 Jul 2025 14:34:08 +0800 | ||
| 4 | Subject: [PATCH] Format test output to match Automake standards | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | |||
| 8 | Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com> | ||
| 9 | --- | ||
| 10 | src/CuTest.c | 63 +++++++++++++++-------------------------------- | ||
| 11 | src/make-tests.sh | 1 - | ||
| 12 | 2 files changed, 20 insertions(+), 44 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/src/CuTest.c b/src/CuTest.c | ||
| 15 | index c1884daedbd8..44007fdb97ff 100644 | ||
| 16 | --- a/src/CuTest.c | ||
| 17 | +++ b/src/CuTest.c | ||
| 18 | @@ -302,49 +302,26 @@ void CuSuiteRun(CuSuite* testSuite) | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | -void CuSuiteSummary(CuSuite* testSuite, CuString* summary) | ||
| 23 | -{ | ||
| 24 | - int i; | ||
| 25 | - for (i = 0 ; i < testSuite->count ; ++i) | ||
| 26 | - { | ||
| 27 | - CuTest* testCase = testSuite->list[i]; | ||
| 28 | - CuStringAppend(summary, testCase->failed ? "F" : "."); | ||
| 29 | - } | ||
| 30 | - CuStringAppend(summary, "\n\n"); | ||
| 31 | -} | ||
| 32 | - | ||
| 33 | void CuSuiteDetails(CuSuite* testSuite, CuString* details) | ||
| 34 | { | ||
| 35 | - int i; | ||
| 36 | - int failCount = 0; | ||
| 37 | - | ||
| 38 | - if (testSuite->failCount == 0) | ||
| 39 | - { | ||
| 40 | - int passCount = testSuite->count - testSuite->failCount; | ||
| 41 | - const char* testWord = passCount == 1 ? "test" : "tests"; | ||
| 42 | - CuStringAppendFormat(details, "OK (%d %s)\n", passCount, testWord); | ||
| 43 | - } | ||
| 44 | - else | ||
| 45 | - { | ||
| 46 | - if (testSuite->failCount == 1) | ||
| 47 | - CuStringAppend(details, "There was 1 failure:\n"); | ||
| 48 | - else | ||
| 49 | - CuStringAppendFormat(details, "There were %d failures:\n", testSuite->failCount); | ||
| 50 | - | ||
| 51 | - for (i = 0 ; i < testSuite->count ; ++i) | ||
| 52 | - { | ||
| 53 | - CuTest* testCase = testSuite->list[i]; | ||
| 54 | - if (testCase->failed) | ||
| 55 | - { | ||
| 56 | - failCount++; | ||
| 57 | - CuStringAppendFormat(details, "%d) %s: %s\n", | ||
| 58 | - failCount, testCase->name, testCase->message); | ||
| 59 | - } | ||
| 60 | - } | ||
| 61 | - CuStringAppend(details, "\n!!!FAILURES!!!\n"); | ||
| 62 | - | ||
| 63 | - CuStringAppendFormat(details, "Runs: %d ", testSuite->count); | ||
| 64 | - CuStringAppendFormat(details, "Passes: %d ", testSuite->count - testSuite->failCount); | ||
| 65 | - CuStringAppendFormat(details, "Fails: %d\n", testSuite->failCount); | ||
| 66 | - } | ||
| 67 | + int i; | ||
| 68 | + | ||
| 69 | + for (i = 0; i < testSuite->count; ++i) | ||
| 70 | + { | ||
| 71 | + CuTest* testCase = testSuite->list[i]; | ||
| 72 | + if (testCase->failed) | ||
| 73 | + { | ||
| 74 | + CuStringAppendFormat(details, "FAIL: %s\n", testCase->name); | ||
| 75 | + } | ||
| 76 | + else | ||
| 77 | + { | ||
| 78 | + CuStringAppendFormat(details, "PASS: %s\n", testCase->name); | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + CuStringAppend(details, "\n"); | ||
| 83 | + CuStringAppendFormat(details, "# TOTAL: %d\n", testSuite->count); | ||
| 84 | + CuStringAppendFormat(details, "# PASS: %d\n", testSuite->count - testSuite->failCount); | ||
| 85 | + CuStringAppendFormat(details, "# FAIL: %d\n", testSuite->failCount); | ||
| 86 | } | ||
| 87 | + | ||
| 88 | diff --git a/src/make-tests.sh b/src/make-tests.sh | ||
| 89 | index b6cf814e7030..01399ca75775 100755 | ||
| 90 | --- a/src/make-tests.sh | ||
| 91 | +++ b/src/make-tests.sh | ||
| 92 | @@ -45,7 +45,6 @@ cat $FILES | grep '^void Test' | | ||
| 93 | echo \ | ||
| 94 | ' | ||
| 95 | CuSuiteRun(suite); | ||
| 96 | - CuSuiteSummary(suite, output); | ||
| 97 | CuSuiteDetails(suite, output); | ||
| 98 | if (suite->failCount > 0) | ||
| 99 | fprintf(stderr, "%s%c", output->buffer, 0x0A); | ||
| 100 | -- | ||
| 101 | 2.34.1 | ||
| 102 | |||
diff --git a/recipes-ids/samhain/samhain.inc b/recipes-ids/samhain/samhain.inc index 6b8d30e..fc4e423 100644 --- a/recipes-ids/samhain/samhain.inc +++ b/recipes-ids/samhain/samhain.inc | |||
| @@ -19,6 +19,7 @@ SRC_URI = "https://la-samhna.de/archive/samhain_signed-${PV}.tar.gz \ | |||
| 19 | file://0008-Add-LDFLAGS-variable-for-compiling-samhain_setpwd.patch \ | 19 | file://0008-Add-LDFLAGS-variable-for-compiling-samhain_setpwd.patch \ |
| 20 | file://0009-fix-build-with-new-version-attr.patch \ | 20 | file://0009-fix-build-with-new-version-attr.patch \ |
| 21 | file://0010-Fix-initializer-element-is-not-constant.patch \ | 21 | file://0010-Fix-initializer-element-is-not-constant.patch \ |
| 22 | file://0001-Format-test-output-to-match-Automake-standards.patch \ | ||
| 22 | " | 23 | " |
| 23 | 24 | ||
| 24 | SRC_URI[sha256sum] = "0b5d3534fd60ecf45dfd79bd415e81f7a56eba7f1755771735e204f334033578" | 25 | SRC_URI[sha256sum] = "0b5d3534fd60ecf45dfd79bd415e81f7a56eba7f1755771735e204f334033578" |
