-
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
Showing
4 changed files
with
87 additions
and
8 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,76 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(leaf) | ||
|
||
# set_target_properties(IEngine PROPERTIES LINKER_LANGUAGE CXX) | ||
|
||
# GoogleTest requires at least C++14 | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
set(TEST_DIR | ||
tests | ||
) | ||
|
||
set(SOURCE_DIR | ||
src | ||
) | ||
|
||
set(SOURCE | ||
${SOURCE_DIR}/main.cpp | ||
) | ||
|
||
project(${PROJECT_NAME}) | ||
|
||
# ######## | ||
# GTest | ||
# ######## | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
googletest | ||
URL https://github.com/google/googletest/archive/e49c6b946a44f9a58586bfc76f75687d8f77e725.zip | ||
) | ||
|
||
# # For Windows: Prevent overriding the parent project's compiler/linker settings | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
|
||
|
||
# ########## | ||
# Project | ||
# ########## | ||
# add_executable(${PROJECT_NAME} ${SOURCE}) | ||
include_directories(${PROJECT_SOURCE_DIR}/src) | ||
|
||
set(SOURCE_FILES | ||
${CMAKE_SOURCE_DIR}/${SOURCE_DIR}/constants.hpp | ||
${CMAKE_SOURCE_DIR}/${SOURCE_DIR}/flametree.hpp | ||
${CMAKE_SOURCE_DIR}/${SOURCE_DIR}/leaffunction.hpp | ||
${CMAKE_SOURCE_DIR}/${SOURCE_DIR}/profiler.hpp | ||
${CMAKE_SOURCE_DIR}/${SOURCE_DIR}/rapl.hpp | ||
) | ||
|
||
add_executable(${PROJECT_NAME} "${SOURCE_FILES}") | ||
|
||
|
||
# ######################### | ||
# TESTING | ||
# ######################### | ||
enable_testing() | ||
|
||
set(TEST_FILES | ||
${TEST_DIR}/test.cpp | ||
) | ||
|
||
add_executable( | ||
profiler_test | ||
"${TEST_FILES}" | ||
) | ||
|
||
target_link_libraries( | ||
profiler_test | ||
GTest::gtest_main | ||
) | ||
|
||
include(GoogleTest) | ||
gtest_discover_tests(profiler_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,2 @@ | ||
* | ||
!.gitignore |
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(HelloTest, BasicAssertions) { | ||
// Expect two strings not to be equal. | ||
EXPECT_STRNE("hello", "world"); | ||
// Expect equality. | ||
EXPECT_EQ(7 * 6, 42); | ||
} |
This file was deleted.
Oops, something went wrong.