Skip to content

Commit

Permalink
Merge pull request #1 from mrsobakin/master
Browse files Browse the repository at this point in the history
Add memory leaks test
  • Loading branch information
bialger authored Jan 17, 2024
2 parents bf8e281 + 3e555e8 commit 763997b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Create CMake cash
- name: Create CMake cache
run: |
cmake -S . -B cmake-build
Expand Down Expand Up @@ -67,3 +67,26 @@ jobs:
else
./cpp_tests_tests
fi
memory-leaks:
name: Memory leaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install valgrind
run: |
sudo apt-get update && sudo apt-get -y install valgrind
- name: Create CMake cache
run: |
cmake -S . -B cmake-build
- name: Build tests target
run: |
cmake --build cmake-build --target cpp_tests_tests
- name: Run valgrind
working-directory: ./cmake-build/tests
run: |
valgrind --leak-check=full --track-origins=yes --error-exitcode=1 ./cpp_tests_tests
2 changes: 1 addition & 1 deletion tests/main_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ TEST(BasicTestSuite, BasicTest1) {
std::ostringstream out;
out << "Hello, World!";
ASSERT_EQ(out.str(), "Hello, World!");
}
}

0 comments on commit 763997b

Please sign in to comment.