diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ff959ed..b647673e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.0) cmake_policy(SET CMP0017 NEW) # need include() with .cmake project(pip) set(_PIP_MAJOR 1) -set(_PIP_MINOR 24) +set(_PIP_MINOR 23) set(_PIP_REVISION 0) set(_PIP_SUFFIX ) set(_PIP_COMPANY SHS) set(_PIP_DOMAIN org.SHS) - +set(TESTS=true) if ("x${CMAKE_MODULE_PATH}" STREQUAL "x") set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") endif() @@ -35,7 +35,7 @@ option(STD_IOSTREAM "Building with std iostream operators support" OFF) option(INTROSPECTION "Build with introspection" OFF) option(LIB "System install" ON) option(STATIC_LIB OFF) -option(TESTS "Build tests and perform their before install step" OFF) +option(TESTS "Build tests and perform their before install step" ON) set(PIP_UTILS 1) if(LIBPROJECT) set(PIP_UTILS ${UTILS}) @@ -86,6 +86,7 @@ set(PHDRS) if (TESTS) set(PIP_SRC_CONCURRENT_TEST "lib/concurrent/test") + set(PIP_SRC_MATH_TEST "lib/main/math/test") endif() if (DEFINED ENV{QNX_HOST} OR PIP_FREERTOS) @@ -275,10 +276,14 @@ endif() if (TESTS) include(DownloadGTest) set(CONCURRENT_TESTS 1) #"Enable tests for concurrent library" + set(MATH_TESTS 1) #"Enable tests for concurrent library" else() set(CONCURRENT_TESTS 0) + set(MATH_TESTS 0) endif() + + # Check if std::iostream operators support if(STD_IOSTREAM) add_definitions(-DPIP_STD_IOSTREAM) @@ -600,8 +605,13 @@ if (NOT CROSSTOOLS) target_link_libraries(pip_concurrent_test gtest_main gmock_main pip_concurrent) add_test(NAME pip_concurrent_test COMMAND tests) add_custom_target(pip_concurrent_test_perform ALL COMMAND pip_concurrent_test) - endif() - + endif() + if(MATH_TESTS) + add_executable(pip_math_test ${CPP_MATH_TEST}) + target_link_libraries(pip_math_test gtest_main gmock_main pip_math) + add_test(NAME pip_math_test COMMAND tests) + add_custom_target(pip_math_test_perform ALL COMMAND pip_math_test) + endif() # Build cloud library if crypt enabled if(sodium_FOUND) diff --git a/lib/main/math/test/testpimathmatrix.cpp b/lib/main/math/test/testpimathmatrix.cpp new file mode 100644 index 00000000..e69de29b