diff options
Diffstat (limited to 'meta/recipes-kernel/lttng/babeltrace2/0001-tests-fix-test-applications-in-cpp-common.patch')
-rw-r--r-- | meta/recipes-kernel/lttng/babeltrace2/0001-tests-fix-test-applications-in-cpp-common.patch | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/babeltrace2/0001-tests-fix-test-applications-in-cpp-common.patch b/meta/recipes-kernel/lttng/babeltrace2/0001-tests-fix-test-applications-in-cpp-common.patch new file mode 100644 index 0000000000..87f94fb087 --- /dev/null +++ b/meta/recipes-kernel/lttng/babeltrace2/0001-tests-fix-test-applications-in-cpp-common.patch | |||
@@ -0,0 +1,129 @@ | |||
1 | From 1dc81f272855d94e6a78f7d10ea952745d991aa9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bin Lan <bin.lan.cn@windriver.com> | ||
3 | Date: Tue, 11 Mar 2025 17:19:11 +0800 | ||
4 | Subject: [PATCH] Tests: fix test applications in cpp-common are needed to | ||
5 | re-build | ||
6 | |||
7 | Test applications in cpp-common directory are needed to re-build when | ||
8 | calling make check in embedded system. The following error is shown | ||
9 | when running test applications: | ||
10 | make[3]: *** No rule to make target 'cpp-common/test-c-string-view.cpp', | ||
11 | needed by 'cpp-common/test-c-string-view.o'. | ||
12 | make[3]: *** No rule to make target '../tests/utils/tap/libtap.la', | ||
13 | needed by 'cpp-common/test-c-string-view'. | ||
14 | make[3]: *** No rule to make target '../src/common/libcommon.la', | ||
15 | needed by 'cpp-common/test-c-string-view'. | ||
16 | make[3]: *** No rule to make target '../src/logging/liblogging.la', | ||
17 | needed by 'cpp-common/test-c-string-view'. | ||
18 | ... | ||
19 | make[2]: *** [Makefile:1274: check-TESTS] Error 2 | ||
20 | make[1]: *** [Makefile:1805: check-am] Error 2 | ||
21 | make: *** [Makefile:1033: check-recursive] Error 1 | ||
22 | make: Target 'check' not remade because of errors. | ||
23 | |||
24 | Create some new shell scripts which are used to call test applications | ||
25 | in cpp-common directory. Then these test applications can run without | ||
26 | actually examining the source code. | ||
27 | |||
28 | Upstream-Status: Submitted [https://review.lttng.org/c/babeltrace/+/14213] | ||
29 | |||
30 | Signed-off-by: Bin Lan <bin.lan.cn@windriver.com> | ||
31 | --- | ||
32 | tests/Makefile.am | 6 +++--- | ||
33 | tests/cpp-common/test-c-string-view.sh | 17 +++++++++++++++++ | ||
34 | tests/cpp-common/test-unicode-conv.sh | 17 +++++++++++++++++ | ||
35 | tests/cpp-common/test-uuid.sh | 17 +++++++++++++++++ | ||
36 | 4 files changed, 54 insertions(+), 3 deletions(-) | ||
37 | create mode 100755 tests/cpp-common/test-c-string-view.sh | ||
38 | create mode 100755 tests/cpp-common/test-unicode-conv.sh | ||
39 | create mode 100755 tests/cpp-common/test-uuid.sh | ||
40 | |||
41 | diff --git a/tests/Makefile.am b/tests/Makefile.am | ||
42 | index 2a4022bc4..c79b77b32 100644 | ||
43 | --- a/tests/Makefile.am | ||
44 | +++ b/tests/Makefile.am | ||
45 | @@ -129,9 +129,9 @@ cpp_common_test_unicode_conv_LDADD = \ | ||
46 | $(COMMON_TEST_LDADD) | ||
47 | |||
48 | TESTS_CPP_COMMON = \ | ||
49 | - cpp-common/test-c-string-view \ | ||
50 | - cpp-common/test-uuid \ | ||
51 | - cpp-common/test-unicode-conv | ||
52 | + cpp-common/test-c-string-view.sh \ | ||
53 | + cpp-common/test-uuid.sh \ | ||
54 | + cpp-common/test-unicode-conv.sh | ||
55 | |||
56 | TESTS_LIB = \ | ||
57 | lib/test-bt-uuid \ | ||
58 | diff --git a/tests/cpp-common/test-c-string-view.sh b/tests/cpp-common/test-c-string-view.sh | ||
59 | new file mode 100755 | ||
60 | index 000000000..9c2ca5818 | ||
61 | --- /dev/null | ||
62 | +++ b/tests/cpp-common/test-c-string-view.sh | ||
63 | @@ -0,0 +1,17 @@ | ||
64 | +#!/bin/bash | ||
65 | +# | ||
66 | +# SPDX-License-Identifier: GPL-2.0-only | ||
67 | +# | ||
68 | +# Copyright (C) 2025 Bin Lan <bin.lan.cn@windriver.com> | ||
69 | +# | ||
70 | + | ||
71 | +if [ -n "${BT_TESTS_SRCDIR:-}" ]; then | ||
72 | + UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh" | ||
73 | +else | ||
74 | + UTILSSH="$(dirname "$0")/../utils/utils.sh" | ||
75 | +fi | ||
76 | + | ||
77 | +# shellcheck source=../utils/utils.sh | ||
78 | +source "$UTILSSH" | ||
79 | + | ||
80 | +"${BT_TESTS_BUILDDIR}/cpp-common/test-c-string-view" "$BT_TESTS_BT2_BIN" | ||
81 | diff --git a/tests/cpp-common/test-unicode-conv.sh b/tests/cpp-common/test-unicode-conv.sh | ||
82 | new file mode 100755 | ||
83 | index 000000000..df490b2eb | ||
84 | --- /dev/null | ||
85 | +++ b/tests/cpp-common/test-unicode-conv.sh | ||
86 | @@ -0,0 +1,17 @@ | ||
87 | +#!/bin/bash | ||
88 | +# | ||
89 | +# SPDX-License-Identifier: GPL-2.0-only | ||
90 | +# | ||
91 | +# Copyright (C) 2025 Bin Lan <bin.lan.cn@windriver.com> | ||
92 | +# | ||
93 | + | ||
94 | +if [ -n "${BT_TESTS_SRCDIR:-}" ]; then | ||
95 | + UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh" | ||
96 | +else | ||
97 | + UTILSSH="$(dirname "$0")/../utils/utils.sh" | ||
98 | +fi | ||
99 | + | ||
100 | +# shellcheck source=../utils/utils.sh | ||
101 | +source "$UTILSSH" | ||
102 | + | ||
103 | +"${BT_TESTS_BUILDDIR}/cpp-common/test-unicode-conv" "$BT_TESTS_BT2_BIN" | ||
104 | diff --git a/tests/cpp-common/test-uuid.sh b/tests/cpp-common/test-uuid.sh | ||
105 | new file mode 100755 | ||
106 | index 000000000..8c65daa94 | ||
107 | --- /dev/null | ||
108 | +++ b/tests/cpp-common/test-uuid.sh | ||
109 | @@ -0,0 +1,17 @@ | ||
110 | +#!/bin/bash | ||
111 | +# | ||
112 | +# SPDX-License-Identifier: GPL-2.0-only | ||
113 | +# | ||
114 | +# Copyright (C) 2025 Bin Lan <bin.lan.cn@windriver.com> | ||
115 | +# | ||
116 | + | ||
117 | +if [ -n "${BT_TESTS_SRCDIR:-}" ]; then | ||
118 | + UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh" | ||
119 | +else | ||
120 | + UTILSSH="$(dirname "$0")/../utils/utils.sh" | ||
121 | +fi | ||
122 | + | ||
123 | +# shellcheck source=../utils/utils.sh | ||
124 | +source "$UTILSSH" | ||
125 | + | ||
126 | +"${BT_TESTS_BUILDDIR}/cpp-common/test-uuid" "$BT_TESTS_BT2_BIN" | ||
127 | -- | ||
128 | 2.34.1 | ||
129 | |||