Skip to content

Commit

Permalink
Maxtest Integration (#10)
Browse files Browse the repository at this point in the history
* added Maxtest to unit test

* fixed CMakeLists.txt

* added PRIVATE specifier to CMakeLists.txt
  • Loading branch information
johnpatek authored Dec 22, 2024
1 parent a03a0aa commit 4d7a5a1
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 441 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2024 John R Patek Sr
Copyright (c) 2024 Maxtek Consulting

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
71 changes: 36 additions & 35 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
# add_executable(
# unit
# unit.cpp
# ${SIGFN_SOURCES})
include(FetchContent)
FetchContent_Declare(
Maxtest
GIT_REPOSITORY https://github.com/maxtek6/maxtest.git
GIT_TAG master
)
FetchContent_MakeAvailable(Maxtest)

# target_include_directories(unit PRIVATE ${SIGFN_INCLUDE} ${CMAKE_CURRENT_SOURCE_DIR}/../src)
add_executable(
unit
unit.cpp
${SIGFN_SOURCES})

# if(SIGFN_COVER)
# if(WIN32)
# message("skipping code coverage for windows")
# else()
# target_compile_options(unit PRIVATE -fprofile-arcs -ftest-coverage -g -O0)
# target_link_libraries(unit PRIVATE gcov "--coverage")
# add_custom_target(
# cover
# DEPENDS unit)
# add_custom_command(
# TARGET cover
# COMMAND gcovr -r ${CMAKE_CURRENT_SOURCE_DIR}/.. -e ${CMAKE_CURRENT_SOURCE_DIR})
# endif()
# endif()
target_include_directories(unit PRIVATE ${SIGFN_INCLUDE} ${CMAKE_CURRENT_SOURCE_DIR}/../src)

# add_test(NAME sigfn_handle COMMAND unit sigfn_handle )
# add_test(NAME sigfn_ignore COMMAND unit sigfn_ignore)
# add_test(NAME sigfn_reset COMMAND unit sigfn_reset)
# add_test(NAME sigfn_error COMMAND unit sigfn_error)
# add_test(NAME sigfn::handle COMMAND unit sigfn::handle)
# add_test(NAME sigfn::ignore COMMAND unit sigfn::ignore)
# add_test(NAME sigfn::reset COMMAND unit sigfn::reset)
if(SIGFN_COVER)
if(WIN32)
message("skipping code coverage for windows")
target_link_libraries(unit PRIVATE Maxtest::Maxtest)
else()
target_compile_options(unit PRIVATE -fprofile-arcs -ftest-coverage -g -O0)
target_link_libraries(unit PRIVATE Maxtest::Maxtest gcov "--coverage")
add_custom_target(
cover
DEPENDS unit)
add_custom_command(
TARGET cover
COMMAND gcovr -r ${CMAKE_CURRENT_SOURCE_DIR}/.. -e ${CMAKE_CURRENT_SOURCE_DIR})
endif()
else()
target_link_libraries(unit PRIVATE Maxtest::Maxtest)
endif()

add_library(threadpool_a STATIC threadpool.cpp)
target_include_directories(threadpool_a PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(threadpool SHARED threadpool.cpp)
target_include_directories(threadpool PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(threadpool INTERFACE)

target_include_directories(threadpool INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
maxtest_add_test(unit sigfn_handle "")
maxtest_add_test(unit sigfn_ignore "")
maxtest_add_test(unit sigfn_reset "")
maxtest_add_test(unit sigfn_error "")
maxtest_add_test(unit sigfn::handle "")
maxtest_add_test(unit sigfn::ignore "")
maxtest_add_test(unit sigfn::reset "")
83 changes: 0 additions & 83 deletions tests/Threadpool.cpp

This file was deleted.

124 changes: 0 additions & 124 deletions tests/Threadpool.hpp

This file was deleted.

Loading

0 comments on commit 4d7a5a1

Please sign in to comment.