релиз
This commit is contained in:
24
templates/tests/CMakeLists.txt.jinja
Normal file
24
templates/tests/CMakeLists.txt.jinja
Normal file
@@ -0,0 +1,24 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project({{ project_name_cmake }}-tests)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
find_package(GTest REQUIRED)
|
||||
|
||||
set(default_build_type "Release")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0") # -fprofile-arcs -ftest-coverage
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -s")
|
||||
|
||||
message(${CMAKE_CXX_FLAGS})
|
||||
|
||||
include_directories(../include)
|
||||
|
||||
add_executable(${PROJECT_NAME}
|
||||
main.cpp
|
||||
test-{{ namespace }}.cpp
|
||||
../include/{{ include_header }}
|
||||
../src/{{ namespace }}.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} GTest::gtest)
|
6
templates/tests/main.cpp.jinja
Normal file
6
templates/tests/main.cpp.jinja
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
7
templates/tests/test-lib.cpp.jinja
Normal file
7
templates/tests/test-lib.cpp.jinja
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <{{ include_header }}>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST({{ project_name_code }}, {{ namespace }}_example) {
|
||||
{{ namespace }}::func();
|
||||
SUCCEED();
|
||||
}
|
Reference in New Issue
Block a user