diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000..ff832a34 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,18 @@ +# Copilot Instructions + +## Repository overview +This is the **ctrlm-main** (Control Manager) plugin — a Thunder/WPEFramework plugin for RDK remote control management. + +## ci/ directory +The `ci/` directory contains **native CI build support files only**. It is not part of the application. + +- `ci/build_dependencies.sh` / `ci/cov_build.sh` — scripts that build the plugin in a CI container without a full RDK target image +- `ci/mocks/xlog_ci_compat.h` — minimal shim that pulls `std::string`, `std::map`, `std::tuple`, `std::get` into the global namespace (mirrors the transitive effect of the real rdkx_logger.h in the Yocto build) +- `ci/mocks/testframework_overrides.h` — supplements testframework mocks with declarations ctrlm needs that are not yet upstream +- `ci/mocks/devicesettings_ctrlm.patch` — patch applied to the testframework `devicesettings.h` at CI time for ctrlm-specific additions (ducking types, `setAudioDucking`, `Manager::IsInitialized`). Remove once these land in testframework develop. +- `ci/mocks/safec_lib.h` — compatibility shim mapping `safec_lib.h` to system libsafec headers +- `ci/headers/` — empty stub headers and real xr-voice-sdk headers generated/copied at CI build time; not committed to source + +CI currently pins `xr-voice-sdk` to tag `1.0.13` in `build_dependencies.sh`. Real xr-voice-sdk headers (including `rdkx_logger.h`, `xr_voice_sdk.h`, and generated `rdkx_logger_modules.h`) are produced by `build_dependencies.sh` and placed in `ci/headers/xr-voice-sdk/`. Mock/stub headers for platform libraries (IARM, DeviceSettings, RFC, etc.) are sourced from `entservices-testframework/` at CI build time. + +When suggesting code or answering questions, treat CI mocks as scaffolding, not as authoritative API definitions. For real API shapes refer to the installed headers under `install/usr/include/` or the upstream repositories (Thunder, entservices-apis, xr-voice-sdk). diff --git a/.github/workflows/native_full_build.yml b/.github/workflows/native_full_build.yml new file mode 100644 index 00000000..cff24b88 --- /dev/null +++ b/.github/workflows/native_full_build.yml @@ -0,0 +1,29 @@ +name: Build Control Manager in Native Environment + +on: + push: + branches: [ main, 'sprint/**', 'release/**', develop ] + pull_request: + branches: [ main, 'sprint/**', 'release/**', topic/RDK*, develop ] + +permissions: + contents: read + +jobs: + build-control-on-pr: + name: Build Control Manager in github rdkcentral + runs-on: ubuntu-latest + container: + image: ghcr.io/rdkcentral/docker-rdk-ci:latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: build dependencies + run: | + sh -x ci/build_dependencies.sh + + - name: cov build + run: | + sh -x ci/cov_build.sh diff --git a/ci/build_dependencies.sh b/ci/build_dependencies.sh new file mode 100644 index 00000000..9abff1c9 --- /dev/null +++ b/ci/build_dependencies.sh @@ -0,0 +1,204 @@ +#!/bin/bash +# +# If not stated otherwise in this file or this component's license file the +# following copyright and licenses apply: +# +# Copyright 2026 RDK Management +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x +set -e +############################## +GITHUB_WORKSPACE="${PWD}" +cd "${GITHUB_WORKSPACE}" + +git config --global --add safe.directory "${GITHUB_WORKSPACE}" + +# ############################# +# 1. Install Dependencies and packages + +apt update +apt install -y \ + pkg-config \ + libsqlite3-dev \ + libcurl4-openssl-dev \ + libsystemd-dev \ + libglib2.0-dev \ + libjansson-dev \ + libarchive-dev \ + libssl-dev \ + zlib1g-dev \ + libdbus-1-dev \ + uuid-dev \ + libevdev-dev \ + libdrm-dev \ + libsafec-dev \ + python3-pip +python3 -m pip install jsonref + +########################################### +# 2. Clone the required repositories + +XRSDK_REF="1.0.13" +git clone --depth 1 --filter=blob:none --branch "${XRSDK_REF}" https://github.com/rdkcentral/xr-voice-sdk.git + +git clone --depth 1 --filter=blob:none --branch develop https://github.com/rdkcentral/entservices-testframework.git + +# Patch the upstream testframework devicesettings.h with ctrlm-specific +# additions (ducking types, setAudioDucking, Manager::IsInitialized). +# We can remove this if added to upstream testframework +git -C entservices-testframework apply "$GITHUB_WORKSPACE/ci/mocks/devicesettings_ctrlm.patch" + +git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/iarmmgrs.git +git -C iarmmgrs sparse-checkout set hal + +git clone --depth 1 --filter=blob:none --sparse https://github.com/rdkcentral/rdk-halif-deepsleep_manager.git +git -C rdk-halif-deepsleep_manager sparse-checkout set include + +git clone --depth 1 --filter=blob:none --sparse https://github.com/rdkcentral/rdk-halif-power_manager.git +git -C rdk-halif-power_manager sparse-checkout set include + +git clone --depth 1 --filter=blob:none --sparse --branch develop https://github.com/rdkcentral/rdkversion.git +git -C rdkversion sparse-checkout set src + +IARMMGRS_DIR="$GITHUB_WORKSPACE/iarmmgrs" +DEEPSLEEP_HAL_DIR="$GITHUB_WORKSPACE/rdk-halif-deepsleep_manager" +POWER_HAL_DIR="$GITHUB_WORKSPACE/rdk-halif-power_manager" +RDKVERSION_DIR="$GITHUB_WORKSPACE/rdkversion" + +############################ +# 3. Create stub/empty headers for external dependencies +echo "======================================================================================" +echo "Creating stub headers" + +HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" +XRSDK_HEADERS_DIR="$HEADERS_DIR/xr-voice-sdk" +mkdir -p "${HEADERS_DIR}" +mkdir -p "${HEADERS_DIR}/rdk/iarmbus" +mkdir -p "${HEADERS_DIR}/rdk/ds" +mkdir -p "${HEADERS_DIR}/rdk/iarmmgrs-hal" +mkdir -p "${XRSDK_HEADERS_DIR}" + +# Copy real xr-voice-sdk headers. +# xr_fdc.h is NOT copied: only needed when FDC_ENABLED=ON +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-router/xrsr.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-mq/xr_mq.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv_http/xrsv_http.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-speech-vrex/xrsv_ws_nextgen/xrsv_ws_nextgen.h" "${XRSDK_HEADERS_DIR}/" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-timestamp/xr_timestamp.h" "${XRSDK_HEADERS_DIR}/" + +# Generate rdkx_logger_modules.h from xr-voice-sdk's module configuration, +# then copy the real rdkx_logger and xr_voice_sdk headers. +# This replaces the hand-written ci/mocks/control/ stubs. +python3 "$GITHUB_WORKSPACE/xr-voice-sdk/scripts/rdkx_logger_modules_to_c.py" \ + "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-logger/rdkv/rdkx_logger_modules.json" \ + "${XRSDK_HEADERS_DIR}/rdkx_logger_modules" "mw" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr-logger/rdkx_logger_mw.h" "${XRSDK_HEADERS_DIR}/rdkx_logger.h" +cp "$GITHUB_WORKSPACE/xr-voice-sdk/src/xr_voice_sdk.h" "${XRSDK_HEADERS_DIR}/xr_voice_sdk.h" + +cd "${HEADERS_DIR}" + +# IARM headers (types provided via -include Iarm.h) +touch rdk/iarmbus/libIARM.h +touch rdk/iarmbus/libIBus.h +touch rdk/iarmbus/libIBusDaemon.h + +# IARM manager headers +# sysMgr.h conflicts with the forced Iarm.h mock, which already provides the +# needed SYSMgr types. Use a shim here. To remove it later, either stop +# force-including those overlapping Iarm.h declarations or drop sysMgr.h from +# ctrlm source. +cat > rdk/iarmmgrs-hal/sysMgr.h <<'EOF' +#ifndef CTRLM_CI_SYSMGR_SHIM_H +#define CTRLM_CI_SYSMGR_SHIM_H + +/* SYSMgr declarations are provided by the forced Iarm.h mock in CI. */ + +#endif +EOF +cp "$DEEPSLEEP_HAL_DIR/include/deepSleepMgr.h" rdk/iarmmgrs-hal/deepSleepMgr.h +cp "$POWER_HAL_DIR/include/plat_power.h" rdk/iarmmgrs-hal/pwrMgr.h +[ -f rdk/iarmmgrs-hal/sysMgr.h ] +[ -f rdk/iarmmgrs-hal/deepSleepMgr.h ] +[ -f rdk/iarmmgrs-hal/pwrMgr.h ] + +# Device settings headers (types provided via force-included devicesettings.h mock) +touch rdk/ds/audioOutputPort.hpp +touch rdk/ds/dsDisplay.h +touch rdk/ds/dsError.h +touch rdk/ds/dsMgr.h +touch rdk/ds/dsRpc.h +touch rdk/ds/dsTypes.h +touch rdk/ds/dsUtl.h +touch rdk/ds/exception.hpp +touch rdk/ds/host.hpp +touch rdk/ds/manager.hpp +touch rdk/ds/videoOutputPort.hpp +touch rdk/ds/videoOutputPortConfig.hpp +touch rdk/ds/videoOutputPortType.hpp +touch rdk/ds/videoResolution.hpp +touch rdk/ds/frontPanelIndicator.hpp +touch rdk/ds/frontPanelConfig.hpp + +# rfcapi.h (types provided via -include Rfc.h) +touch rfcapi.h + +# comcastIrKeyCodes.h (unconditionally included by ctrlm_main.cpp) +find "$IARMMGRS_DIR" -name comcastIrKeyCodes.h -print -quit | xargs -r -I{} cp "{}" comcastIrKeyCodes.h +[ -f comcastIrKeyCodes.h ] + +# rdkversion.h (used by ctrlm_main.cpp) +cp "$RDKVERSION_DIR/src/rdkversion.h" rdkversion.h +[ -f rdkversion.h ] + +# secure_wrapper (types provided via empty stub — no v_secure_* calls in core) +touch secure_wrapper.h + +# safec compatibility header - committed in ci/mocks, copied here so it is +# resolved on the generated-headers include path. +cp "$GITHUB_WORKSPACE/ci/mocks/safec_lib.h" safec_lib.h + +echo "Stub headers created successfully" + +cd "${GITHUB_WORKSPACE}" + +mkdir -p "${GITHUB_WORKSPACE}/install/usr/include" +printf '{}\n' > "${GITHUB_WORKSPACE}/install/usr/include/ctrlm_config_empty.json" + +############################ +# 4. Create stub shared libraries for linking +echo "======================================================================================" +echo "Creating stub libraries" + +STUB_LIB_DIR="$GITHUB_WORKSPACE/install/usr/lib" +mkdir -p "${STUB_LIB_DIR}" + +# Create a minimal C stub source +cat > /tmp/stub.c << 'STUB_EOF' +void __stub_placeholder(void) {} +STUB_EOF + +# Build stub .so for each missing library +# nopoll and dshalcli are unused (factory-only) but unconditionally linked by CMakeLists.txt +# We can remove them from the link list in the future if desired, but for now just provide stubs to satisfy the linker. +for lib in xr-voice-sdk rdkversion IARMBus ds nopoll dshalcli rfcapi secure_wrapper evdev; do + gcc -shared -fPIC -o "${STUB_LIB_DIR}/lib${lib}.so" /tmp/stub.c +done + +rm /tmp/stub.c + +echo "Stub libraries created in ${STUB_LIB_DIR}" +echo "======================================================================================" +echo "build_dependencies.sh complete" diff --git a/ci/cov_build.sh b/ci/cov_build.sh new file mode 100644 index 00000000..3a51b921 --- /dev/null +++ b/ci/cov_build.sh @@ -0,0 +1,112 @@ +#!/bin/bash +# +# If not stated otherwise in this file or this component's license file the +# following copyright and licenses apply: +# +# Copyright 2026 RDK Management +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x +set -e +############################## +GITHUB_WORKSPACE="${PWD}" +ls -la "${GITHUB_WORKSPACE}" +############################ + +# Build control (ctrlm-main) +echo "building control (ctrlm-main)" + +XRSDK_REAL_HEADERS="$GITHUB_WORKSPACE/ci/headers/xr-voice-sdk" +XLOG_COMPAT="$GITHUB_WORKSPACE/ci/mocks/xlog_ci_compat.h" +MOCK_DIR="$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks" +MOCK_OVERRIDES="$GITHUB_WORKSPACE/ci/mocks/testframework_overrides.h" +HEADERS_DIR="$GITHUB_WORKSPACE/ci/headers" +EMPTY_JSON="$GITHUB_WORKSPACE/install/usr/include/ctrlm_config_empty.json" +GLIB_CFLAGS="$(pkg-config --cflags glib-2.0)" + +cmake -G Ninja -S "$GITHUB_WORKSPACE" -B build/control \ +-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}/install/usr" \ +-DCMAKE_INSTALL_SYSCONFDIR="${GITHUB_WORKSPACE}/install/etc" \ +-DCMAKE_MODULE_PATH="${GITHUB_WORKSPACE}/install/tools/cmake" \ +-DCMAKE_VERBOSE_MAKEFILE=ON \ +-DCMAKE_PROJECT_VERSION="1.0.0" \ +-DTHUNDER=OFF \ +-DTHUNDER_SECURITY=OFF \ +-DBLE_ENABLED=OFF \ +-DRF4CE_ENABLED=OFF \ +-DIP_ENABLED=OFF \ +-DTELEMETRY_SUPPORT=OFF \ +-DAUTH_ENABLED=OFF \ +-DXRSR_HTTP=OFF \ +-DXRSR_SDT=OFF \ +-DBUILD_CTRLM_FACTORY=OFF \ +-DBUILD_FACTORY_TEST=OFF \ +-DUSE_SAFEC=OFF \ +-DUSE_IARM_POWER_MANAGER=ON \ +-DBREAKPAD=OFF \ +-DFDC_ENABLED=OFF \ +-DENABLE_ASYNC_SRVR_MSG=OFF \ +-DHIDE_NON_EXTERNAL_SYMBOLS=OFF \ +-DBUILD_SYSTEM=NONE \ +-DCTRLM_UTILS_JSON_COMBINE="${GITHUB_WORKSPACE}/xr-voice-sdk/scripts/vsdk_json_combine.py" \ +-DCTRLM_UTILS_JSON_TO_HEADER="${GITHUB_WORKSPACE}/xr-voice-sdk/scripts/vsdk_json_to_header.py" \ +-DCTRLM_CONFIG_JSON_CPC="${EMPTY_JSON}" \ +-DCTRLM_CONFIG_JSON_CPC_SUB="${EMPTY_JSON}" \ +-DCTRLM_CONFIG_JSON_CPC_ADD="${EMPTY_JSON}" \ +-DCTRLM_CONFIG_JSON_MAIN_SUB="${EMPTY_JSON}" \ +-DCTRLM_CONFIG_JSON_MAIN_ADD="${EMPTY_JSON}" \ +-DCMAKE_CXX_FLAGS=" \ +-I ${XRSDK_REAL_HEADERS} \ +-I ${MOCK_DIR} \ +-I ${MOCK_DIR}/devicesettings \ +-I ${HEADERS_DIR} \ +-I ${HEADERS_DIR}/rdk/iarmbus \ +-I ${HEADERS_DIR}/rdk/ds \ +-I ${HEADERS_DIR}/rdk/iarmmgrs-hal \ +-I ${GITHUB_WORKSPACE}/install/usr/include \ +-I /usr/include/libdrm \ +${GLIB_CFLAGS} \ +-include ${XLOG_COMPAT} \ +-include ${MOCK_DIR}/Iarm.h \ +-include ${MOCK_OVERRIDES} \ +-include ${MOCK_DIR}/devicesettings.h \ +-include ${MOCK_DIR}/Rfc.h \ +-Wall -Wno-error \ +-DSAFEC_DUMMY_API \ +-DDISABLE_SECURITY_TOKEN" \ +-DCMAKE_C_FLAGS=" \ +-I ${XRSDK_REAL_HEADERS} \ +-I ${MOCK_DIR} \ +-I ${HEADERS_DIR} \ +-I ${HEADERS_DIR}/rdk/iarmbus \ +-I ${HEADERS_DIR}/rdk/ds \ +-I ${HEADERS_DIR}/rdk/iarmmgrs-hal \ +-I ${GITHUB_WORKSPACE}/install/usr/include \ +-I /usr/include/libdrm \ +${GLIB_CFLAGS} \ +-Wall -Wno-error \ +-DSAFEC_DUMMY_API \ +-DDISABLE_SECURITY_TOKEN" \ +-DCMAKE_EXE_LINKER_FLAGS="-L${GITHUB_WORKSPACE}/install/usr/lib -Wl,--unresolved-symbols=ignore-all" + +# CMakeLists.txt unconditionally appends -Werror via target_compile_options, which +# comes after CMAKE_CXX_FLAGS and overrides -Wno-error. Strip it from the generated +# build files after cmake configure. To remove this, add an ENABLE_WERROR option to +# CMakeLists.txt that appends -Wno-error when OFF, and pass -DENABLE_WERROR=OFF here. +find "${GITHUB_WORKSPACE}/build/control" \( -name "*.ninja" -o -name "flags.make" \) -exec sed -i 's/\(^\|[[:space:]]\)-Werror\([[:space:]]\|$\)/\1\2/g' {} \; + +cmake --build build/control -j$(nproc) 2>&1 +echo "======================================================================================" +echo "control build complete" +exit 0 diff --git a/ci/mocks/devicesettings_ctrlm.patch b/ci/mocks/devicesettings_ctrlm.patch new file mode 100644 index 00000000..d2faf8a8 --- /dev/null +++ b/ci/mocks/devicesettings_ctrlm.patch @@ -0,0 +1,40 @@ +--- a/Tests/mocks/devicesettings.h 2026-04-21 19:12:58.154981897 +0000 ++++ b/Tests/mocks/devicesettings.h 2026-04-21 19:13:50.591192520 +0000 +@@ -72,6 +72,16 @@ + dsAUDIOPORT_TYPE_MAX /**< Maximum index for audio port type. */ + } dsAudioPortType_t; + ++typedef enum _dsAudioDuckingAction_t { ++ dsAUDIO_DUCKINGACTION_START = 0, ++ dsAUDIO_DUCKINGACTION_STOP = 1 ++} dsAudioDuckingAction_t; ++ ++typedef enum _dsAudioDuckingType_t { ++ dsAUDIO_DUCKINGTYPE_ABSOLUTE = 0, ++ dsAUDIO_DUCKINGTYPE_RELATIVE = 1 ++} dsAudioDuckingType_t; ++ + typedef enum _dsVideoPortType_t { + dsVIDEOPORT_TYPE_RF = 0, ///< RF modulator (channel 3/4) video output + dsVIDEOPORT_TYPE_BB, ///< Baseband (composite, RCA) video output +@@ -934,6 +944,11 @@ + void enableARC(dsAudioARCTypes_t type, bool enable); + uint32_t getDolbyVolumeMode() const; + void setStereoMode(const std::string &mode, bool persist); ++ void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, float level) { ++ (void)action; ++ (void)type; ++ (void)level; ++ } + + + +@@ -1420,6 +1435,8 @@ + static ManagerImpl* impl; + + public: ++ static bool IsInitialized; ++ + Manager(); + + static void setImpl(ManagerImpl* newImpl); diff --git a/ci/mocks/safec_lib.h b/ci/mocks/safec_lib.h new file mode 100644 index 00000000..37d75748 --- /dev/null +++ b/ci/mocks/safec_lib.h @@ -0,0 +1,44 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2026 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Compatibility header: maps ctrlm's local include name to the real libsafec + * package headers (libsafec-dev / safec-common-wrapper in production). + * + * In CI this file is copied from ci/mocks/ into ci/headers/ by + * build_dependencies.sh so it is resolved on the generated-headers include + * path used by cov_build.sh. + * + * This exists because ctrlm includes safec_lib.h directly, while the native CI + * environment provides the underlying libsafec package headers instead of that + * project-local wrapper. + */ + +#ifndef CTRLM_CI_SAFEC_LIB_H_ +#define CTRLM_CI_SAFEC_LIB_H_ + +#include +#include +#include + +#ifndef ERR_CHK +#define ERR_CHK(rc) do { (void)(rc); } while(0) +#endif + +#endif /* CTRLM_CI_SAFEC_LIB_H_ */ diff --git a/ci/mocks/testframework_overrides.h b/ci/mocks/testframework_overrides.h new file mode 100644 index 00000000..22b8a0a2 --- /dev/null +++ b/ci/mocks/testframework_overrides.h @@ -0,0 +1,48 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2026 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * CI patch layer for gaps in the entservices-testframework mock headers. + * + * ctrlm needs a few IARM declarations that are missing from the testframework + * headers used by this reduced build. This file adds only those missing pieces + * and can be removed once they exist upstream. + */ +#ifndef CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ +#define CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ + +/* Pinned testframework Iarm.h stops at UNKNOWN; ctrlm also references MAX. */ +#ifndef DEEPSLEEP_WAKEUPREASON_MAX +#define DEEPSLEEP_WAKEUPREASON_MAX (DEEPSLEEP_WAKEUPREASON_UNKNOWN + 1) +#endif + +/* IARM common API string not present in the pinned testframework mock */ +#ifndef IARM_BUS_COMMON_API_PowerPreChange +#define IARM_BUS_COMMON_API_PowerPreChange "PowerPreChange" +#endif + +/* Struct not present in the pinned testframework mock */ +#ifndef CTRLM_IARM_BUS_COMMON_API_POWERPRECHANGE_PARAM_T_DEFINED +#define CTRLM_IARM_BUS_COMMON_API_POWERPRECHANGE_PARAM_T_DEFINED +typedef struct { + IARM_Bus_PWRMgr_PowerState_t newState; + IARM_Bus_PWRMgr_PowerState_t curState; +} IARM_Bus_CommonAPI_PowerPreChange_Param_t; +#endif + +#endif /* CTRLM_CI_TESTFRAMEWORK_OVERRIDES_H_ */ diff --git a/ci/mocks/xlog_ci_compat.h b/ci/mocks/xlog_ci_compat.h new file mode 100644 index 00000000..43836b73 --- /dev/null +++ b/ci/mocks/xlog_ci_compat.h @@ -0,0 +1,42 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2026 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * CI compatibility shim. + * + * The production rdkx_logger.h is included transitively everywhere via + * ctrlm_log.h. In the Yocto build the SDK headers pull several std:: names + * into the global namespace. A handful of ctrlm TUs (e.g. ctrlm_utils.cpp) + * rely on those names being globally visible. This tiny header replicates + * that behaviour for the CI native build. + */ +#ifndef CTRLM_CI_XLOG_COMPAT_H_ +#define CTRLM_CI_XLOG_COMPAT_H_ + +#ifdef __cplusplus +#include +#include +#include +using std::get; +using std::map; +using std::string; +using std::tuple; +#endif + +#endif /* CTRLM_CI_XLOG_COMPAT_H_ */