diff options
Diffstat (limited to 'meta/recipes-support/libcheck')
-rw-r--r-- | meta/recipes-support/libcheck/libcheck/automake-output.patch | 82 | ||||
-rw-r--r-- | meta/recipes-support/libcheck/libcheck_0.15.2.bb | 24 |
2 files changed, 98 insertions, 8 deletions
diff --git a/meta/recipes-support/libcheck/libcheck/automake-output.patch b/meta/recipes-support/libcheck/libcheck/automake-output.patch new file mode 100644 index 0000000000..c860f0cc0f --- /dev/null +++ b/meta/recipes-support/libcheck/libcheck/automake-output.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | Add optional output in automake style, for integration with ptest. | ||
2 | Export CK_AUTOMAKE=1 when running a test suite and you'll get | ||
3 | PASS/FAIL lines on standard output. | ||
4 | |||
5 | Marking this as Inappropriate right now as it's a little rough on the | ||
6 | edges. Filed https://github.com/libcheck/check/issues/349 to discuss | ||
7 | with upstream. | ||
8 | |||
9 | Upstream-Status: Inappropriate | ||
10 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
11 | |||
12 | diff --git a/src/check_log.c b/src/check_log.c | ||
13 | index 0844661..ad23c65 100644 | ||
14 | --- a/src/check_log.c | ||
15 | +++ b/src/check_log.c | ||
16 | @@ -26,6 +26,7 @@ | ||
17 | #if ENABLE_SUBUNIT | ||
18 | #include <subunit/child.h> | ||
19 | #endif | ||
20 | +#include <libgen.h> | ||
21 | |||
22 | #include "check_error.h" | ||
23 | #include "check_list.h" | ||
24 | @@ -381,6 +382,34 @@ void tap_lfun(SRunner * sr CK_ATTRIBUTE_UNUSED, FILE * file, | ||
25 | } | ||
26 | } | ||
27 | |||
28 | +void am_lfun(SRunner * sr CK_ATTRIBUTE_UNUSED, FILE * file, | ||
29 | + enum print_output printmode CK_ATTRIBUTE_UNUSED, void *obj, | ||
30 | + enum cl_event evt) | ||
31 | +{ | ||
32 | + TestResult *tr; | ||
33 | + const char* types[] = { "INVALID", "PASS", "FAIL", "ERROR"}; | ||
34 | + | ||
35 | + switch (evt) | ||
36 | + { | ||
37 | + case CLINITLOG_SR: | ||
38 | + case CLENDLOG_SR: | ||
39 | + case CLSTART_SR: | ||
40 | + case CLSTART_S: | ||
41 | + case CLEND_SR: | ||
42 | + case CLEND_S: | ||
43 | + case CLSTART_T: | ||
44 | + break; | ||
45 | + case CLEND_T: | ||
46 | + tr = (TestResult *)obj; | ||
47 | + fprintf(file, "%s: %s:%s:%s %s\n", | ||
48 | + types[tr->rtype], basename(tr->file), tr->tcname, tr->tname, tr->msg); | ||
49 | + fflush(file); | ||
50 | + break; | ||
51 | + default: | ||
52 | + eprintf("Bad event type received in am_lfun", __FILE__, __LINE__); | ||
53 | + } | ||
54 | +} | ||
55 | + | ||
56 | #if ENABLE_SUBUNIT | ||
57 | void subunit_lfun(SRunner * sr, FILE * file, enum print_output printmode, | ||
58 | void *obj, enum cl_event evt) | ||
59 | @@ -527,6 +556,9 @@ void srunner_init_logging(SRunner * sr, enum print_output print_mode) | ||
60 | { | ||
61 | srunner_register_lfun(sr, f, f != stdout, tap_lfun, print_mode); | ||
62 | } | ||
63 | + if (getenv("CK_AUTOMAKE")) | ||
64 | + srunner_register_lfun(sr, stdout, 0, am_lfun, print_mode); | ||
65 | + | ||
66 | srunner_send_evt(sr, NULL, CLINITLOG_SR); | ||
67 | } | ||
68 | |||
69 | diff --git a/src/check_log.h b/src/check_log.h | ||
70 | index 7223b98..bfe1de3 100644 | ||
71 | --- a/src/check_log.h | ||
72 | +++ b/src/check_log.h | ||
73 | @@ -40,6 +40,9 @@ void xml_lfun(SRunner * sr, FILE * file, enum print_output, | ||
74 | void tap_lfun(SRunner * sr, FILE * file, enum print_output, | ||
75 | void *obj, enum cl_event evt); | ||
76 | |||
77 | +void am_lfun(SRunner * sr, FILE * file, enum print_output, | ||
78 | + void *obj, enum cl_event evt); | ||
79 | + | ||
80 | void subunit_lfun(SRunner * sr, FILE * file, enum print_output, | ||
81 | void *obj, enum cl_event evt); | ||
82 | |||
diff --git a/meta/recipes-support/libcheck/libcheck_0.15.2.bb b/meta/recipes-support/libcheck/libcheck_0.15.2.bb index 33e07db93c..5ab67b8728 100644 --- a/meta/recipes-support/libcheck/libcheck_0.15.2.bb +++ b/meta/recipes-support/libcheck/libcheck_0.15.2.bb | |||
@@ -1,28 +1,36 @@ | |||
1 | SUMMARY = "Check - unit testing framework for C code" | 1 | SUMMARY = "Check - unit testing framework for C code" |
2 | DESCRIPTION = "It features a simple interface for defining unit tests, \ | ||
3 | putting little in the way of the developer. Tests are run in a separate \ | ||
4 | address space, so both assertion failures and code errors that cause \ | ||
5 | segmentation faults or other signals can be caught. Test results are \ | ||
6 | reportable in the following: Subunit, TAP, XML, and a generic logging format." | ||
2 | HOMEPAGE = "https://libcheck.github.io/check/" | 7 | HOMEPAGE = "https://libcheck.github.io/check/" |
3 | SECTION = "devel" | 8 | SECTION = "devel" |
4 | 9 | ||
5 | LICENSE = "LGPLv2.1+" | 10 | LICENSE = "LGPL-2.1-or-later" |
6 | LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=2d5025d4aa3495befef8f17206a5b0a1" | 11 | LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=2d5025d4aa3495befef8f17206a5b0a1" |
7 | 12 | ||
8 | SRC_URI = "https://github.com/${BPN}/check/releases/download/${PV}/check-${PV}.tar.gz \ | 13 | SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/check-${PV}.tar.gz \ |
14 | file://automake-output.patch \ | ||
9 | file://not-echo-compiler-info-to-check_stdint.h.patch" | 15 | file://not-echo-compiler-info-to-check_stdint.h.patch" |
10 | SRC_URI[sha256sum] = "a8de4e0bacfb4d76dd1c618ded263523b53b85d92a146d8835eb1a52932fa20a" | 16 | SRC_URI[sha256sum] = "a8de4e0bacfb4d76dd1c618ded263523b53b85d92a146d8835eb1a52932fa20a" |
11 | UPSTREAM_CHECK_URI = "https://github.com/libcheck/check/releases/" | 17 | GITHUB_BASE_URI = "https://github.com/libcheck/check/releases/" |
12 | 18 | ||
13 | S = "${WORKDIR}/check-${PV}" | 19 | S = "${WORKDIR}/check-${PV}" |
14 | 20 | ||
15 | inherit autotools pkgconfig texinfo | 21 | inherit autotools pkgconfig texinfo github-releases |
16 | 22 | ||
17 | CACHED_CONFIGUREVARS += "ac_cv_path_AWK_PATH=${bindir}/gawk" | 23 | CACHED_CONFIGUREVARS += "ac_cv_path_AWK_PATH=${bindir}/gawk" |
18 | 24 | ||
19 | RREPLACES_${PN} = "check (<= 0.9.5)" | 25 | RREPLACES:${PN} = "check (<= 0.9.5)" |
20 | 26 | ||
27 | do_install:append:class-native() { | ||
28 | create_cmdline_shebang_wrapper ${D}${bindir}/checkmk | ||
29 | } | ||
21 | BBCLASSEXTEND = "native nativesdk" | 30 | BBCLASSEXTEND = "native nativesdk" |
22 | 31 | ||
23 | PACKAGES =+ "checkmk" | 32 | PACKAGES =+ "checkmk" |
24 | 33 | ||
25 | FILES_checkmk = "${bindir}/checkmk" | 34 | FILES:checkmk = "${bindir}/checkmk" |
26 | |||
27 | RDEPENDS_checkmk = "gawk" | ||
28 | 35 | ||
36 | RDEPENDS:checkmk = "gawk" | ||