-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/setup ci #5
Open
ClausKlein
wants to merge
7
commits into
develop
Choose a base branch
from
feature/setup-ci
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8a82286
setup image for ci
ClausKlein 9b3378c
Enable more sanitizer checks
ClausKlein e932f05
OSX does not support ENABLE_SANITIZER_LEAK
ClausKlein 27d8c19
update git config settings for gitlab CI
ClausKlein 3e282e3
Install with pip -U
ClausKlein b96c595
Refactory cmake preset
ClausKlein c354fdd
Use /dev/random for test data
ClausKlein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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 |
---|---|---|
|
@@ -31,7 +31,6 @@ include(GNUInstallDirs) | |
# COMPONENTS filesystem asio headers | ||
# REQUIRED | ||
# ) | ||
|
||
# ---- Add other dependencies via CPM ---- | ||
# see https://github.com/cpm-cmake/CPM.cmake for more info | ||
|
||
|
@@ -67,19 +66,54 @@ target_include_directories( | |
) | ||
|
||
if(PROJECT_IS_TOP_LEVEL AND CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
# ProjectOptions will be used for compiler settings and appropriate CMake options | ||
# NOTE(CK): Set GIT_SUBMODULES to empty string to NOT initializes submodules! | ||
cmake_policy(SET CMP0097 NEW) | ||
CPMAddPackage( | ||
NAME ProjectOptions | ||
GIT_TAG v0.32.1 | ||
GITHUB_REPOSITORY | ||
aminya/project_options | ||
GIT_SUBMODULES | ||
"docs" # NOTE(CK): Workaround existing dir to prevent load of submodule | ||
) | ||
if(ProjectOptions_SOURCE_DIR) | ||
message(DEBUG "${ProjectOptions_SOURCE_DIR} added") | ||
list(APPEND CMAKE_MODULE_PATH ${ProjectOptions_SOURCE_DIR}/src) | ||
endif() | ||
|
||
# Enable sanitizers and static analyzers when running the tests | ||
set(ENABLE_CLANG_TIDY NO) | ||
if(DEFINED ENV{CI}) | ||
set(ENABLE_CLANG_TIDY "ENABLE_CLANG_TIDY") | ||
set(ENABLE_SANITIZER_THREAD "ENABLE_SANITIZER_THREAD") | ||
else() | ||
check_sanitizers_support( | ||
ENABLE_SANITIZER_ADDRESS ENABLE_SANITIZER_UNDEFINED_BEHAVIOR ENABLE_SANITIZER_LEAK | ||
ENABLE_SANITIZER_THREAD ENABLE_SANITIZER_MEMORY | ||
) | ||
endif() | ||
|
||
if(APPLE) | ||
set(ENABLE_SANITIZER_LEAK NO) | ||
endif() | ||
|
||
project_options( | ||
PREFIX | ||
${PROJECT_NAME} | ||
ENABLE_CACHE | ||
ENABLE_COVERAGE | ||
ENABLE_CLANG_TIDY | ||
ENABLE_SANITIZER_ADDRESS | ||
ENABLE_SANITIZER_UNDEFINED_BEHAVIOR | ||
# ENABLE_SANITIZER_LEAK | ||
# ENABLE_SANITIZER_THREAD | ||
# ENABLE_SANITIZER_MEMORY | ||
${ENABLE_CLANG_TIDY} | ||
${ENABLE_SANITIZER_ADDRESS} | ||
${ENABLE_SANITIZER_LEAK} | ||
${ENABLE_SANITIZER_MEMORY} | ||
${ENABLE_SANITIZER_THREAD} | ||
${ENABLE_SANITIZER_UNDEFINED_BEHAVIOR} | ||
ENABLE_CONTROL_FLOW_PROTECTION | ||
ENABLE_STACK_PROTECTION | ||
ENABLE_OVERFLOW_PROTECTION | ||
ENABLE_INCLUDE_WHAT_YOU_USE | ||
# XXX NO! WARNINGS_AS_ERRORS | ||
# ENABLE_INCLUDE_WHAT_YOU_USE | ||
) | ||
|
||
target_link_libraries( | ||
|
@@ -94,6 +128,9 @@ endif() | |
# Install and export tftpd-targets | ||
#--------------------------------------------------------------------------------------- | ||
if(NOT CMAKE_SKIP_INSTALL_RULES) | ||
# PackageProject.cmake will be used to make our target installable | ||
CPMAddPackage("gh:TheLartians/[email protected]") | ||
|
||
packageProject( | ||
NAME ${PROJECT_NAME} | ||
VERSION ${PROJECT_VERSION} | ||
|
@@ -136,17 +173,19 @@ if(NETKIT_TFTP_TESTS) | |
enable_testing() | ||
|
||
add_executable(option_test option_test.cpp async_tftpd_server.hpp) | ||
#NO! CK target_include_directories(option_test SYSTEM PRIVATE include) | ||
target_link_libraries(option_test PRIVATE tftpd) | ||
add_test(NAME option_test COMMAND option_test) | ||
|
||
if(NOT DEFINED ENV{CI}) | ||
add_test(NAME option_test COMMAND option_test) | ||
endif() | ||
|
||
add_executable(tftpd_test tftpd_test.cpp async_tftpd_server.hpp) | ||
target_link_libraries(tftpd_test PRIVATE tftpd) | ||
|
||
if(UNIX) | ||
add_test( | ||
NAME tftpd_test | ||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test.sh | ||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test.sh $<TARGET_FILE:tftpd_test> | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
) | ||
endif() | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rem duplicate line!