googletest: Test project /home/andrew/x86/win32/p2pClient/buildNo tests were found!!!
I coded this p2p client application with librats and now I want to test it with googletest but after running ctest into the build directory I got this exception:
Test project /home/andrew/x86/win32/p2pClient/build
No tests were found!!!
My cMakeLists.txt:
cmake_minimum_required(
VERSION
3.14)
project(p2pClient)
# GoogleTest requires at least C++17
set(
CMAKE_CXX_STANDARD
17)
set(
CMAKE_CXX_STANDARD_REQUIRED
ON)
include(FetchContent)
enable_testing()
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)cmake_minimum_required(VERSION 3.14)
project(p2pClient)
# GoogleTest requires at least C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent)
enable_testing()
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
and this is the result after running cmake -S . -B build:
cmake -S . -B build
-- The C compiler identification is GNU 16.2.0
-- The CXX compiler identification is GNU 16.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at /usr/share/cmake-4.3/Modules/FetchContent.cmake:1386 (message):
The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
not set. The policy's OLD behavior will be used. When using a URL
download, the timestamps of extracted files should preferably be that of
the time of extraction, otherwise code that depends on the extracted
contents might not be rebuilt if the URL changes. The OLD behavior
preserves the timestamps from the archive instead, but this is usually not
what you want. Update your project to the NEW behavior or specify the
DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
robustness issue.
Call Stack (most recent call first):
CMakeLists.txt:10 (FetchContent_Declare)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/andrew/x86/win32/p2pClient/build