Files
poky/meta/recipes-kernel/lttng/babeltrace2/0001-tests-fix-test-applications-in-cpp-common.patch
Bin Lan 2c6cb136ca babeltrace2: upgrade 2.0.6 -> 2.1.0
Refresh 0001-Make-manpages-multilib-identical.patch with
correct number and upstream status. Create a new patch
0001-tests-fix-test-applications-in-cpp-common.patch
to fix test applications in cpp-common are needed to re-build when
running in an embedded environment.
0001-tests-do-not-run-test-applications-from-.libs.patch is deleted
for the commit log is not very accurate and the line number is changed,
is replaced by 0001-tests-set-the-correct-plugin-directory.patch.
Use 0001-tests-set-the-correct-plugin-directory.patch to set the
correct directory of plugin shared library.

Copy the trace files (*.ref) the metadata files (*.mctf) and json files
which are required by test cases from source directory in
babeltrace2_2.1.0.bb. Add character set conversion (gconv) for UTF-16/32
encoding for test cases. Set the correct test environment variables in
tests/utils/env.sh when running in an embedded environment. Remove
"GREP=grep SED=sed PYTHON=python3" from the file run-ptest for these
test environment variables are set in tests/utils/env.sh.

License-Update: add new license BSD-4-Clause GPL-3.0-or-later CC-BY-SA-4.0 PSF-2.0
Babeltrace 2.1.0 is a major change. Babeltrace 2.1.0 is released after five years
of development after the release of Babeltrace 2.0.0. The licenses did change
significantly.

Changelog:
Babeltrace 2.1, MIP 1 is available and adds many functions
to support CTF 2 features.
The Python bindings wrap all the library changes in the same
systematic way as in Babeltrace 2.0. Add type hints to the
public API to assist with static analysis of your applications.

Details about the 2.1.0 release:
https://babeltrace.org/docs/release-notes/babeltrace-2.1.0-release-notes.html

(From OE-Core rev: 1a17aec7955cb3ed288519d28ee10858abbba3ae)

Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-18 11:25:36 +00:00

130 lines
4.0 KiB
Diff

From 1dc81f272855d94e6a78f7d10ea952745d991aa9 Mon Sep 17 00:00:00 2001
From: Bin Lan <bin.lan.cn@windriver.com>
Date: Tue, 11 Mar 2025 17:19:11 +0800
Subject: [PATCH] Tests: fix test applications in cpp-common are needed to
re-build
Test applications in cpp-common directory are needed to re-build when
calling make check in embedded system. The following error is shown
when running test applications:
make[3]: *** No rule to make target 'cpp-common/test-c-string-view.cpp',
needed by 'cpp-common/test-c-string-view.o'.
make[3]: *** No rule to make target '../tests/utils/tap/libtap.la',
needed by 'cpp-common/test-c-string-view'.
make[3]: *** No rule to make target '../src/common/libcommon.la',
needed by 'cpp-common/test-c-string-view'.
make[3]: *** No rule to make target '../src/logging/liblogging.la',
needed by 'cpp-common/test-c-string-view'.
...
make[2]: *** [Makefile:1274: check-TESTS] Error 2
make[1]: *** [Makefile:1805: check-am] Error 2
make: *** [Makefile:1033: check-recursive] Error 1
make: Target 'check' not remade because of errors.
Create some new shell scripts which are used to call test applications
in cpp-common directory. Then these test applications can run without
actually examining the source code.
Upstream-Status: Submitted [https://review.lttng.org/c/babeltrace/+/14213]
Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
---
tests/Makefile.am | 6 +++---
tests/cpp-common/test-c-string-view.sh | 17 +++++++++++++++++
tests/cpp-common/test-unicode-conv.sh | 17 +++++++++++++++++
tests/cpp-common/test-uuid.sh | 17 +++++++++++++++++
4 files changed, 54 insertions(+), 3 deletions(-)
create mode 100755 tests/cpp-common/test-c-string-view.sh
create mode 100755 tests/cpp-common/test-unicode-conv.sh
create mode 100755 tests/cpp-common/test-uuid.sh
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2a4022bc4..c79b77b32 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -129,9 +129,9 @@ cpp_common_test_unicode_conv_LDADD = \
$(COMMON_TEST_LDADD)
TESTS_CPP_COMMON = \
- cpp-common/test-c-string-view \
- cpp-common/test-uuid \
- cpp-common/test-unicode-conv
+ cpp-common/test-c-string-view.sh \
+ cpp-common/test-uuid.sh \
+ cpp-common/test-unicode-conv.sh
TESTS_LIB = \
lib/test-bt-uuid \
diff --git a/tests/cpp-common/test-c-string-view.sh b/tests/cpp-common/test-c-string-view.sh
new file mode 100755
index 000000000..9c2ca5818
--- /dev/null
+++ b/tests/cpp-common/test-c-string-view.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2025 Bin Lan <bin.lan.cn@windriver.com>
+#
+
+if [ -n "${BT_TESTS_SRCDIR:-}" ]; then
+ UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
+else
+ UTILSSH="$(dirname "$0")/../utils/utils.sh"
+fi
+
+# shellcheck source=../utils/utils.sh
+source "$UTILSSH"
+
+"${BT_TESTS_BUILDDIR}/cpp-common/test-c-string-view" "$BT_TESTS_BT2_BIN"
diff --git a/tests/cpp-common/test-unicode-conv.sh b/tests/cpp-common/test-unicode-conv.sh
new file mode 100755
index 000000000..df490b2eb
--- /dev/null
+++ b/tests/cpp-common/test-unicode-conv.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2025 Bin Lan <bin.lan.cn@windriver.com>
+#
+
+if [ -n "${BT_TESTS_SRCDIR:-}" ]; then
+ UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
+else
+ UTILSSH="$(dirname "$0")/../utils/utils.sh"
+fi
+
+# shellcheck source=../utils/utils.sh
+source "$UTILSSH"
+
+"${BT_TESTS_BUILDDIR}/cpp-common/test-unicode-conv" "$BT_TESTS_BT2_BIN"
diff --git a/tests/cpp-common/test-uuid.sh b/tests/cpp-common/test-uuid.sh
new file mode 100755
index 000000000..8c65daa94
--- /dev/null
+++ b/tests/cpp-common/test-uuid.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2025 Bin Lan <bin.lan.cn@windriver.com>
+#
+
+if [ -n "${BT_TESTS_SRCDIR:-}" ]; then
+ UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
+else
+ UTILSSH="$(dirname "$0")/../utils/utils.sh"
+fi
+
+# shellcheck source=../utils/utils.sh
+source "$UTILSSH"
+
+"${BT_TESTS_BUILDDIR}/cpp-common/test-uuid" "$BT_TESTS_BT2_BIN"
--
2.34.1