From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FEF0606A31A for ; Mon, 30 Nov 2026 20:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=buildroot.org header.i=@buildroot.org header.a=rsa-sha256 header.s=default header.b=j/6NrDWr Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F0CF7607B1; Mon, 30 Nov 2026 20:14:23 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id E5dNEm8rw9T5; Mon, 30 Nov 2026 20:14:21 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 7136660766 Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796069661; b=CvBOSIxrpkWB5K2lnMCpWdTdqJ+Z21OOPKlwTXc82Gk0cdIx3xfQCZxxz7Y5CxaE63NW n/NgRnJJDQ7VbQClw1wThRmj3TcXqoTzFduD8tldLPJqyGKhBA6FpXmG1sg0v1AyRyeBm 9xHHsqjnmGIDfDHiQllrnyrgTFpI9brXBkDjGg50fdz5DiaiPdBNn5tnUv/0J4qO0KEo+ YJZ7uwE3l6ua/+zGi/QBbFPnAQA76vPHI7GsDmRzTaZJYIDbxa2oJfpwTZeSbwo2jNzE1 qrpiVF1X32TE/V/M9/ymtIwU4P4nbVb5R4TeMCafg803GJ5yVU8rwAuy4cBG9PT1AJg== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796069661; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received:To: Date:Message-ID:X-Mailer:MIME-Version:X-Last-TLS-Session-Version: Subject:X-BeenThere:X-Mailman-Version:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:From: Reply-To:Cc:Content-Type:Content-Transfer-Encoding:Errors-To:Sender; bh=+1E80+M3lGcOC3Ivf+QiMpwP6AAXXCZD2OVVKzjbViI=; b=RY25ItunrRdM6Fwz+3TLuU3X7VShUFB6Qne6vYPJagcG49rC8EQ313X4HLLXY/qtn7KY OALNUhTQr10D6mZT9fdpcZZAhrXFhKV8EH3f0HOyv4tafBzBhvD1ixKneONzugGgCNoFw 58Dy5cavsYFqMoxtLSKABGlH+Z5Gtf84+AoHr4dXUcSRNJ6bON4U2b+/6DRFkYSSCJwfP F3K0DufqUDOBhNvttJFzV+HBTMQCfRCDIEUXMgDRa+qTRLuuY55E6nupJ/tBoB8Gk4PYK 1AQeCfWc42oAjNF0QdR0wZKM6sV+in0DDYFvwCvzGiTApnCksW7CCNXeNeOQaDXVx0g== ARC-Authentication-Results: i=1; smtp3.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=buildroot.org; s=default; t=1796069661; bh=+1E80+M3lGcOC3Ivf+QiMpwP6AAXXCZD2OVVKzjbViI=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=j/6NrDWrvnBWNiWWp0G23Z745OqIZtvU7aX1oKM3tBhKzzT4DaFCzL7BHY+8MEzk9 5+TQ33i2I97B3ZAQ1ea0n1b0zgha1Qfs1Q+S3ECGUPhEQCz+H6vhqpB3rSCXyRLqyf jiRYJ6fxdJnRDpI7YqiqrcqbnBw5losqb6PC4igm+KhdfUrqfFyMLPUuitUnrjH0Yi m57FccylZZDBLR3Ir2vzmb9LYCGXy8frqV1hrVC+Zhmg2bFK/K3I1s3yh+NsULu5ZL GkqlzRaR//IqBQDW3NYTxAa7W+bg9si8pqc7IWH2G9xaRF+xiwPU32N4MG9Bk8Szv7 LAzdl0vZOnCag== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 7136660766; Mon, 30 Nov 2026 20:14:21 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists1.osuosl.org (Postfix) with ESMTP id 428FF158 for ; Mon, 30 Nov 2026 20:14:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3429E60766 for ; Mon, 30 Nov 2026 20:14:20 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id nqcwWco4DQYQ for ; Mon, 30 Nov 2026 20:14:19 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 1467060743 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:4f8:1c0c:5073::1; helo=mail.heine.tech; envelope-from=buildroot@heine.tech; receiver= Received: from mail.heine.tech (mail.heine.tech [IPv6:2a01:4f8:1c0c:5073::1]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1467060743 for ; Mon, 30 Nov 2026 20:14:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1A3401814BE; Mon, 30 Nov 2026 21:14:14 +0100 (CET) To: buildroot@buildroot.org Date: Mon, 30 Nov 2026 21:14:01 +0100 Message-ID: <20261130201402.657202-1-buildroot@heine.tech> X-Mailer: git-send-email 2.53.0 X-Archived-By: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 Subject: [Buildroot] [PATCH] support/testing: add sdbus-cpp runtime test X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Discussion and development of buildroot List-Archive: List-Post: List-Help: List-Subscribe: , From: Michael Nosthoff via buildroot Reply-To: Michael Nosthoff Cc: Thomas Petazzoni Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "buildroot" X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Build a subset of the upstream integration tests in a test-only external package against the installed sdbus-c++ library. Run selected connection, method, signal and property tests using both event loops on an emulated systemd target. Signed-off-by: Michael Nosthoff Assisted-By: gpt-6.1-terra --- DEVELOPERS | 2 + .../package/br2-external/sdbus-cpp/Config.in | 1 + .../br2-external/sdbus-cpp/external.desc | 1 + .../br2-external/sdbus-cpp/external.mk | 1 + .../package/sdbus-cpp-test/Config.in | 8 ++++ .../package/sdbus-cpp-test/sdbus-cpp-test.mk | 37 ++++++++++++++++ .../testing/tests/package/test_sdbus_cpp.py | 44 +++++++++++++++++++ 7 files changed, 94 insertions(+) create mode 100644 support/testing/tests/package/br2-external/sdbus-cpp/Config.in create mode 100644 support/testing/tests/package/br2-external/sdbus-cpp/external.desc create mode 100644 support/testing/tests/package/br2-external/sdbus-cpp/external.mk create mode 100644 support/testing/tests/package/br2-external/sdbus-cpp/package/sdbus-cpp-test/Config.in create mode 100644 support/testing/tests/package/br2-external/sdbus-cpp/package/sdbus-cpp-test/sdbus-cpp-test.mk create mode 100644 support/testing/tests/package/test_sdbus_cpp.py diff --git a/DEVELOPERS b/DEVELOPERS index 59fad7f26b..7a4e5a67db 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2494,7 +2494,9 @@ F: package/protobuf/ F: package/sdbus-cpp/ F: package/spdlog/ F: package/sqlitecpp/ +F: support/testing/tests/package/br2-external/sdbus-cpp/ F: support/testing/tests/package/br2-external/sqlitecpp/ +F: support/testing/tests/package/test_sdbus_cpp.py F: support/testing/tests/package/test_sqlitecpp.py N: Michael Trimarchi diff --git a/support/testing/tests/package/br2-external/sdbus-cpp/Config.in b/support/testing/tests/package/br2-external/sdbus-cpp/Config.in new file mode 100644 index 0000000000..33c6f3161d --- /dev/null +++ b/support/testing/tests/package/br2-external/sdbus-cpp/Config.in @@ -0,0 +1 @@ +source "$BR2_EXTERNAL_SDBUS_CPP_TEST_PATH/package/sdbus-cpp-test/Config.in" diff --git a/support/testing/tests/package/br2-external/sdbus-cpp/external.desc b/support/testing/tests/package/br2-external/sdbus-cpp/external.desc new file mode 100644 index 0000000000..5cc8d178fb --- /dev/null +++ b/support/testing/tests/package/br2-external/sdbus-cpp/external.desc @@ -0,0 +1 @@ +name: SDBUS_CPP_TEST diff --git a/support/testing/tests/package/br2-external/sdbus-cpp/external.mk b/support/testing/tests/package/br2-external/sdbus-cpp/external.mk new file mode 100644 index 0000000000..ea6169fb67 --- /dev/null +++ b/support/testing/tests/package/br2-external/sdbus-cpp/external.mk @@ -0,0 +1 @@ +include $(sort $(wildcard $(BR2_EXTERNAL_SDBUS_CPP_TEST_PATH)/package/*/*.mk)) diff --git a/support/testing/tests/package/br2-external/sdbus-cpp/package/sdbus-cpp-test/Config.in b/support/testing/tests/package/br2-external/sdbus-cpp/package/sdbus-cpp-test/Config.in new file mode 100644 index 0000000000..17aef9a571 --- /dev/null +++ b/support/testing/tests/package/br2-external/sdbus-cpp/package/sdbus-cpp-test/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_SDBUS_CPP_TEST + bool "sdbus-c++ integration tests" + depends on BR2_PACKAGE_SDBUS_CPP + depends on BR2_USE_WCHAR # gtest + select BR2_PACKAGE_GTEST + select BR2_PACKAGE_GTEST_GMOCK + help + Build a subset of the upstream sdbus-c++ integration tests. diff --git a/support/testing/tests/package/br2-external/sdbus-cpp/package/sdbus-cpp-test/sdbus-cpp-test.mk b/support/testing/tests/package/br2-external/sdbus-cpp/package/sdbus-cpp-test/sdbus-cpp-test.mk new file mode 100644 index 0000000000..500c446f9d --- /dev/null +++ b/support/testing/tests/package/br2-external/sdbus-cpp/package/sdbus-cpp-test/sdbus-cpp-test.mk @@ -0,0 +1,37 @@ +################################################################################ +# +# sdbus-cpp-test +# +################################################################################ + +SDBUS_CPP_TEST_DEPENDENCIES = gtest sdbus-cpp +SDBUS_CPP_TEST_UPSTREAM_DIR = $(SDBUS_CPP_DIR)/tests/integrationtests +SDBUS_CPP_TEST_SOURCES = \ + DBusConnectionTests.cpp \ + DBusMethodsTests.cpp \ + DBusSignalsTests.cpp \ + DBusPropertiesTests.cpp \ + TestFixture.cpp \ + TestAdaptor.cpp \ + TestProxy.cpp \ + sdbus-c++-integration-tests.cpp + +define SDBUS_CPP_TEST_BUILD_CMDS + $(TARGET_CXX) $(TARGET_CXXFLAGS) -std=c++20 -pthread \ + -DLIBSYSTEMD_VERSION=$(firstword $(subst ., ,$(SYSTEMD_VERSION))) \ + -DSDBUS_systemd \ + -I$(SDBUS_CPP_TEST_UPSTREAM_DIR)/dbus-api/gen-cpp \ + $(addprefix $(SDBUS_CPP_TEST_UPSTREAM_DIR)/,$(SDBUS_CPP_TEST_SOURCES)) \ + -o $(@D)/sdbus-c++-integration-tests \ + $(TARGET_LDFLAGS) -lsdbus-c++ -lgmock -lgtest -lsystemd +endef + +define SDBUS_CPP_TEST_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 0755 $(@D)/sdbus-c++-integration-tests \ + $(TARGET_DIR)/usr/bin/sdbus-c++-integration-tests + $(INSTALL) -D -m 0644 \ + $(SDBUS_CPP_TEST_UPSTREAM_DIR)/files/org.sdbuscpp.integrationtests.conf \ + $(TARGET_DIR)/etc/dbus-1/system.d/org.sdbuscpp.integrationtests.conf +endef + +$(eval $(generic-package)) diff --git a/support/testing/tests/package/test_sdbus_cpp.py b/support/testing/tests/package/test_sdbus_cpp.py new file mode 100644 index 0000000000..e39e619cd3 --- /dev/null +++ b/support/testing/tests/package/test_sdbus_cpp.py @@ -0,0 +1,44 @@ +import os + +import infra.basetest + + +class TestSdbusCpp(infra.basetest.BRTest): + br2_external = [infra.filepath("tests/package/br2-external/sdbus-cpp")] + config = \ + """ + BR2_arm=y + BR2_cortex_a9=y + BR2_ARM_ENABLE_VFP=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_INIT_SYSTEMD=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + BR2_PACKAGE_SDBUS_CPP=y + BR2_PACKAGE_SDBUS_CPP_TEST=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv7", kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + tests = [ + "Connection.CanBeDefaultConstructed", + "Connection.CanRequestName", + "SdbusTestObject/0.CallsMethodsWithBaseTypesSuccessfully", + "SdbusTestObject/0.CallsMethodWithVariantSuccessfully", + "SdbusTestObject/0.EmitsSimpleSignalSuccessfully", + "SdbusTestObject/0.WritesAndReadsReadWritePropertySuccessfully", + "SdbusTestObject/1.CallsMethodsWithBaseTypesSuccessfully", + "SdbusTestObject/1.CallsMethodWithVariantSuccessfully", + "SdbusTestObject/1.EmitsSimpleSignalSuccessfully", + "SdbusTestObject/1.WritesAndReadsReadWritePropertySuccessfully", + ] + cmd = f"/usr/bin/sdbus-c++-integration-tests --gtest_filter='{':'.join(tests)}'" + output, exit_code = self.emulator.run(cmd, timeout=120) + self.assertEqual(exit_code, 0, output) + self.assertIn(f"[ PASSED ] {len(tests)} tests.", output) -- 2.53.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot