From 5f2fffa319baac8ecc4f5ca4e91de40aec1c2dd9 Mon Sep 17 00:00:00 2001 From: ppalan289 Date: Tue, 31 Mar 2026 13:55:41 +0000 Subject: [PATCH] RDKEMW-14533: Coverity inclusion changes Reason for change: Inclusion of coverity for BT Test Procedure: NA Risks: Low Priority: P2 Signed-off-by: ppalan289 --- .github/workflows/native_full_build.yml | 38 ++++++++++++++++ build_dependencies.sh | 58 +++++++++++++++++++++++++ cov_build.sh | 29 +++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 .github/workflows/native_full_build.yml create mode 100644 build_dependencies.sh create mode 100644 cov_build.sh diff --git a/.github/workflows/native_full_build.yml b/.github/workflows/native_full_build.yml new file mode 100644 index 0000000..6a4c9e2 --- /dev/null +++ b/.github/workflows/native_full_build.yml @@ -0,0 +1,38 @@ +name: BT-Core Build Component in Native Environment + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +jobs: + native-build: + runs-on: ubuntu-latest + + steps: + # ---------------------------------------- + # Checkout + # ---------------------------------------- + - name: Checkout source + uses: actions/checkout@v6 + + # ---------------------------------------- + # Setup scripts permission + # ---------------------------------------- + - name: Make scripts executable + run: | + chmod +x build_dependencies.sh + chmod +x cov_build.sh + + # ---------------------------------------- + # Install dependencies + # ---------------------------------------- + - name: Run bt-core dependency setup + run: ./build_dependencies.sh + + # ---------------------------------------- + # Build project + # ---------------------------------------- + - name: Run bt-core native build + run: ./cov_build.sh diff --git a/build_dependencies.sh b/build_dependencies.sh new file mode 100644 index 0000000..5fa7ebe --- /dev/null +++ b/build_dependencies.sh @@ -0,0 +1,58 @@ +#!/bin/bash +set -e + +echo "Installing system dependencies..." + +sudo apt-get update +sudo apt-get install -y \ + autoconf automake libtool pkg-config \ + gcc g++ make \ + libglib2.0-dev libdbus-1-dev libbluetooth-dev \ + git + +WORKSPACE=$(pwd) + +echo "Setting up telemetry stub..." + +git clone https://github.com/rdkcentral/telemetry.git + +mkdir -p ${WORKSPACE}/external/include +mkdir -p ${WORKSPACE}/external/lib + +cp telemetry/include/telemetry_busmessage_sender.h ${WORKSPACE}/external/include/ +cp telemetry/include/telemetry2_0.h ${WORKSPACE}/external/include/ + +cat << 'EOF' > telemetry_stub.c +int t2_init(void) { return 0; } +int t2_event_s(const char* n, const char* v) { return 0; } +int t2_event_f(const char* n, float v) { return 0; } +int t2_event_d(const char* n, double v) { return 0; } +EOF + +gcc -shared -fPIC telemetry_stub.c \ + -o ${WORKSPACE}/external/lib/libtelemetry_msgsender.so + +echo "Setting up BlueZ legacy headers..." + +git clone https://github.com/bluez/bluez.git + +mkdir -p ${WORKSPACE}/external/include/bluetooth/audio +mkdir -p ${WORKSPACE}/external/include/bluetooth + +git -C bluez checkout tags/4.101 + +cp bluez/audio/ipc.h \ + ${WORKSPACE}/external/include/bluetooth/audio/ipc.h + +git -C bluez checkout tags/5.48 + +cp bluez/profiles/audio/a2dp-codecs.h \ + ${WORKSPACE}/external/include/bluetooth/audio/a2dp-codecs.h + +cp bluez/lib/bluetooth.h \ + ${WORKSPACE}/external/include/bluetooth/bluetooth.h + +sed -i '1i#include \n' \ + ${WORKSPACE}/external/include/bluetooth/audio/ipc.h + +echo "Dependencies setup completed." diff --git a/cov_build.sh b/cov_build.sh new file mode 100644 index 0000000..823f82b --- /dev/null +++ b/cov_build.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e + +WORKSPACE=$(pwd) + +echo "Bootstrapping autotools..." + +libtoolize --force +aclocal +autoheader +automake --force-missing --add-missing +autoconf + +echo "Configuring project..." + +export CPPFLAGS="-I${WORKSPACE}/external/include" +export LDFLAGS="-L${WORKSPACE}/external/lib" +export CFLAGS="-Wno-error" +export CXXFLAGS="-Wno-error" +export LD_LIBRARY_PATH="${WORKSPACE}/external/lib" + +ac_cv_header_telemetry_busmessage_sender_h=yes ./configure + +echo "Building Bluetooth components..." + +make -C src/bt-ifce -j$(nproc) +make -C src -j$(nproc) + +echo "Build completed successfully."