Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/L1-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,23 @@ jobs:
PATH=$GITHUB_WORKSPACE/install/usr/bin:${PATH}
LD_LIBRARY_PATH=$GITHUB_WORKSPACE/install/usr/lib:$GITHUB_WORKSPACE/install/usr/lib/wpeframework/plugins:${LD_LIBRARY_PATH}
GTEST_OUTPUT="json:$(pwd)/rdkL1TestResults.json"
RdkServicesL1Test &&
gdb -batch -ex "set logging file $GITHUB_WORKSPACE/gdb_log.txt" -ex "set logging on" -ex "run" -ex "bt" -ex "info registers" -ex "quit" --args RdkServicesL1Test 2>&1 | tee $GITHUB_WORKSPACE/gdb_output.log &&
cp -rf $(pwd)/rdkL1TestResults.json $GITHUB_WORKSPACE/rdkL1TestResultsWithoutValgrind.json &&
rm -rf $(pwd)/rdkL1TestResults.json

- name: Capture detailed crash info on failure
if: failure()
run: |
echo "Test failed, capturing additional debugging information..."
echo "Core dumps:" >> $GITHUB_WORKSPACE/debug_info.log
find . -name "core*" -type f >> $GITHUB_WORKSPACE/debug_info.log 2>/dev/null || echo "No core dumps found" >> $GITHUB_WORKSPACE/debug_info.log
echo "System info:" >> $GITHUB_WORKSPACE/debug_info.log
uname -a >> $GITHUB_WORKSPACE/debug_info.log
echo "Memory info:" >> $GITHUB_WORKSPACE/debug_info.log
free -h >> $GITHUB_WORKSPACE/debug_info.log
echo "Disk space:" >> $GITHUB_WORKSPACE/debug_info.log
df -h >> $GITHUB_WORKSPACE/debug_info.log

- name: Run unit tests with valgrind
if: ${{ !env.ACT }}
run: >
Expand Down Expand Up @@ -694,7 +707,19 @@ jobs:
path: |
coverage/
valgrind_log
gdb_log.txt # (GDB's internal logging)
gdb_output.log # (captured terminal output)
debug_info.log # (system info on failure)
rdkL1TestResultsWithoutValgrind.json
rdkL1TestResultsWithValgrind.json
if-no-files-found: warn

# The below steps are for uploading full build results for debugging purposes.
- name: Upload build
if: always()
uses: actions/upload-artifact@v4
with:
name: Build results
path: |
./

15 changes: 15 additions & 0 deletions Tests/L1Tests/tests/test_AVInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ TEST_F(AVInputTest, RegisteredMethods)
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("getGameFeatureStatus")));
}

// Deliberate crash test to demonstrate GDB integration
TEST_F(AVInputTest, DeliberateCrashForGDBDemo)
{
std::cout << "About to trigger a deliberate crash for GDB demonstration..." << std::endl;
std::cout << "This will help test the GDB integration in CI/CD pipeline" << std::endl;

// Method 1: Null pointer dereference
int* null_ptr = nullptr;
std::cout << "Attempting null pointer dereference..." << std::endl;
*null_ptr = 42; // This will cause a segmentation fault

// This code should never be reached
FAIL() << "This line should never be executed due to the crash above";
}

TEST_F(AVInputInit, getInputDevices)
{
EXPECT_CALL(*p_hdmiInputImplMock, getNumberOfInputs())
Expand Down
Loading