-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
c06795d
commit 6c9ca33
Showing
2 changed files
with
45 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(CppEarleyTest VERSION 1.0) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
find_package(GTest REQUIRED) | ||
|
||
#[[ | ||
# Possible override for current test solution - requires hitting the internet each time ? | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
# Specify the commit you depend on and update it regularly. | ||
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip | ||
) | ||
# For Windows: Prevent overriding the parent project's compiler/linker settings | ||
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(app-test main.cpp) | ||
|
||
#target_link_libraries(app-test gtest_main) | ||
target_link_libraries(app-test ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread) | ||
|
||
add_test(NAME example_test COMMAND app-test) | ||
|
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,12 @@ | ||
#include <limits.h> | ||
|
||
#include "gtest/gtest.h" | ||
|
||
namespace { | ||
|
||
TEST(SampleTests, Sample) { | ||
EXPECT_EQ(1, 1); | ||
} | ||
|
||
} | ||
|