Skip to content

Commit

Permalink
Add Tests for Mapping Binary Heap (#23)
Browse files Browse the repository at this point in the history
* Add tests for mapping binary heap

Changes to be committed:
	new file:   tests/DataStructures/Container/TestMappingBinaryHeap.cpp
	new file:   tests/DataStructures/Container/TestMappingBinaryHeap.hpp

* Enable the tests for MappingBinaryHeap within the framework
* Run test in single threaded mode to avoid Google Testframework Death Test warning

What?
Warning: NG] /Users/runner/work/egoa/egoa/external/GoogleTestFramework/googletest/src/gtest-death-test.cc:1102:: Death tests use fork(), which is unsafe particularly in a threaded context. For this test, Google Test detected 3 threads. See https://github.com/google/googletest/blob/main/docs/advanced.md#death-tests-and-threads for more explanation and suggested solutions, especially if this is the last message you see before your test times out.

* Update test with assertion and exception handling differentiation
* Rename some TestFixtureNames
* Renaming some TestNames
* Change from parallel to j
* Add missing namespace ::testing::MatchesRegex
* Forgot an round brackets escape
  • Loading branch information
franziska-wegner committed Dec 11, 2023
1 parent 94d0156 commit aeec600
Show file tree
Hide file tree
Showing 4 changed files with 1,067 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,13 @@ jobs:
working-directory: ${{ steps.strings.outputs.build-output-dir }}
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --verbose --build-config ${{ matrix.build_type }}
# The tests are run single threaded due to the fact that the Google Testframework uses forks in the Death Tests. The following warning
# we try to avoid:
# Warning: NG] /Users/runner/work/egoa/egoa/external/GoogleTestFramework/googletest/src/gtest-death-test.cc:1102::
# Death tests use fork(), which is unsafe particularly in a threaded context. For this test, Google Test detected
# 3 threads. See https://github.com/google/googletest/blob/main/docs/advanced.md#death-tests-and-threads for more
# explanation and suggested solutions, especially if this is the last message you see before your test times out.
run: ctest --verbose -j1 --build-config ${{ matrix.build_type }}

- name: Generate documentation
if: startsWith(matrix.os,'ubuntu-')
Expand Down
6 changes: 3 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ add_executable(TestBinaryHeap DataStructures/Container/TestBinaryHeap.cpp)
target_link_libraries(TestBinaryHeap EGOA gtest gtest_main gmock_main)
add_test(NAME TestBinaryHeap COMMAND TestBinaryHeap)

# add_executable(TestMappingBinaryHeap DataStructures/Container/TestMappingBinaryHeap.cpp)
# target_link_libraries(TestMappingBinaryHeap EGOA gtest gtest_main gmock_main)
# add_test(NAME TestMappingBinaryHeap COMMAND TestMappingBinaryHeap)
add_executable(TestMappingBinaryHeap DataStructures/Container/TestMappingBinaryHeap.cpp)
target_link_libraries(TestMappingBinaryHeap EGOA gtest gtest_main gmock_main)
add_test(NAME TestMappingBinaryHeap COMMAND TestMappingBinaryHeap)

# add_executable(TestBucket DataStructures/Container/TestBucket.cpp)
# target_link_libraries(TestBucket EGOA gtest gtest_main gmock_main)
Expand Down
Loading

0 comments on commit aeec600

Please sign in to comment.