Initial commit
Some checks failed
Bigfoot / Build & Test Debug (push) Successful in 1m21s
Bigfoot / Build & Test RelWithDebInfo (push) Successful in 1m0s
Bigfoot / Build & Test Release (push) Successful in 31s
Bigfoot / Clang Format Checks (push) Failing after 8s
Bigfoot / Sonarqube (push) Successful in 52s
Some checks failed
Bigfoot / Build & Test Debug (push) Successful in 1m21s
Bigfoot / Build & Test RelWithDebInfo (push) Successful in 1m0s
Bigfoot / Build & Test Release (push) Successful in 31s
Bigfoot / Clang Format Checks (push) Failing after 8s
Bigfoot / Sonarqube (push) Successful in 52s
This commit is contained in:
53
Bin2CPP/Tests/Bin2CPPLib/CMakeLists.txt
Normal file
53
Bin2CPP/Tests/Bin2CPPLib/CMakeLists.txt
Normal file
@@ -0,0 +1,53 @@
|
||||
get_filename_component(PackageName ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
project(${PackageName}Tests)
|
||||
|
||||
add_executable(${PROJECT_NAME})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Include)
|
||||
|
||||
file(GLOB_RECURSE TEST_SOURCES
|
||||
CONFIGURE_DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
|
||||
)
|
||||
|
||||
target_sources(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${TEST_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE gtest::gtest Bin2CPPLib)
|
||||
|
||||
include(GoogleTest)
|
||||
gtest_discover_tests(${PROJECT_NAME} XML_OUTPUT_DIR ${CMAKE_BINARY_DIR}/TestResults/)
|
||||
|
||||
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX Src/ FILES ${TEST_SOURCES})
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Tests/Bin2CPP/${ParentFolder})
|
||||
|
||||
##################COPY FIXTURE FOLDER###################
|
||||
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Fixture)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Fixture)
|
||||
endif()
|
||||
|
||||
# Track all fixture files
|
||||
file(GLOB_RECURSE FIXTURE_FILES
|
||||
CONFIGURE_DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Fixture/*
|
||||
)
|
||||
|
||||
add_custom_target(${PROJECT_NAME}Fixture
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory $<TARGET_FILE_DIR:${PROJECT_NAME}>/Fixture
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Fixture $<TARGET_FILE_DIR:${PROJECT_NAME}>/Fixture
|
||||
DEPENDS ${FIXTURE_FILES}
|
||||
COMMENT "Copying Fixture folder for ${PROJECT_NAME}"
|
||||
)
|
||||
|
||||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}Fixture)
|
||||
|
||||
set_target_properties(${PROJECT_NAME}Fixture PROPERTIES FOLDER UtilityTargets/Tests/Bin2CPP/${ParentFolder})
|
||||
|
||||
bin2cpp_setup_dependencies("Tests/Bin2CPP")
|
||||
0
Bin2CPP/Tests/Bin2CPPLib/Fixture/toto.txt
Normal file
0
Bin2CPP/Tests/Bin2CPPLib/Fixture/toto.txt
Normal file
0
Bin2CPP/Tests/Bin2CPPLib/touch.cpp
Normal file
0
Bin2CPP/Tests/Bin2CPPLib/touch.cpp
Normal file
1
Bin2CPP/Tests/CMakeLists.txt
Normal file
1
Bin2CPP/Tests/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Bin2CPPLib)
|
||||
Reference in New Issue
Block a user