-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ env: | |
BUILD_TYPE: Release | ||
BUILD_PATH: ${{github.workspace}}/communicator/build | ||
SOURCE: ${{github.workspace}}/communicator | ||
TEST_BUILD_PATH: ${{github.workspace}}/communicator/tests/build | ||
|
||
|
||
jobs: | ||
build: | ||
|
@@ -41,8 +43,7 @@ jobs: | |
- name: Pre-commit actions | ||
uses: pre-commit/[email protected] | ||
|
||
# TODO uncomment when tests are added | ||
# - name: Test | ||
# working-directory: ${{env.BUILD_PATH}} | ||
# run: ctest -C ${{env.BUILD_TYPE}} | ||
- name: Test | ||
working-directory: ${{env.TEST_BUILD_PATH}} | ||
run: ctest -C ${{env.BUILD_TYPE}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(CommunicatorGTest) | ||
|
||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG main | ||
) | ||
|
||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
|
||
# Now simply link against gtest or gtest_main as needed. Eg | ||
add_executable(example-gt exampleTest.cpp) | ||
target_link_libraries(example-gt gtest_main) | ||
enable_testing() | ||
add_test(NAME example_test COMMAND example-gt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "gtest/gtest.h" | ||
|
||
// Demonstrate some basic assertions. | ||
TEST(exampleTest, BasicAssertions) { | ||
// Expect two strings not to be equal. | ||
EXPECT_STRNE("hello", "world"); | ||
// Expect equality. | ||
EXPECT_EQ(7 * 6, 42); | ||
} |