Skip to content
Open
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,19 @@
.vs
build
.idea/
### CMake ###
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps

### CMake Patch ###
# External projects
*-prefix/
18 changes: 15 additions & 3 deletions extras/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ cmake_minimum_required(VERSION 2.8)

project(testArduinoIoTCloud)

Include(FetchContent)

FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.4.0
)

FetchContent_MakeAvailable(Catch2)

##########################################################################

include_directories(include)
include_directories(../../src)
include_directories(../../src/cbor)
include_directories(../../src/property)
include_directories(../../src/utility/time)
include_directories(external/catch/v2.13.10/include)
include_directories(external/fakeit/v2.0.5/include)

##########################################################################

Expand Down Expand Up @@ -45,6 +53,7 @@ set(TEST_SRCS
src/test_writeOnly.cpp
src/test_writeOnDemand.cpp
src/test_writeOnChange.cpp
src/test_TimedAttempt.cpp
)

set(TEST_UTIL_SRCS
Expand All @@ -53,6 +62,7 @@ set(TEST_UTIL_SRCS
)

set(TEST_DUT_SRCS
../../src/utility/time/TimedAttempt.cpp
../../src/property/Property.cpp
../../src/property/PropertyContainer.cpp
../../src/cbor/CBORDecoder.cpp
Expand Down Expand Up @@ -84,7 +94,7 @@ set(TEST_TARGET_SRCS

##########################################################################

add_compile_definitions(HOST)
add_compile_definitions(HOST HAS_TCP)
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
add_compile_options(-Wno-cast-function-type)

Expand All @@ -98,5 +108,7 @@ add_executable(
${TEST_TARGET_SRCS}
)

target_link_libraries( ${TEST_TARGET} Catch2WithMain )

##########################################################################

Loading
Loading