-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
0.2.16-p0: Tests fail to build: "EQUAL" "1" Unknown arguments specified #250
Comments
Thanks for reporting the error. Can you provide the steps needed to reproduce it, ideally as a |
Docker doesn't support FreeBSD yet. The problem occurs in the FreeBSD port
|
Ah, ok. 👍 As a workaround for installing FunctionalPlus, of course you can simply copy the FunctionalPlus header files to your target directory without invoking CMake at all. Apart from that, I currently can only guess: Maybe the CMake version can be updated, and that would help. 😬 |
cmake-3.21.4 is used, which is almost the latest.
The last line fails. Is |
Does building (i.e. installing) FunctionalPlus work when you don't build/run the tests, i.e., without needing doctest? If the problem is only with doctest, maybe you can reproduce the problem with doctest alone and ask in its repo. Edit: To answer your question ("Is |
I got the same error only when building the tests, using FunctionalPlus outside of that works fine. I also got that error in a different side project where I wanted to try doctest, where FunctionalPlus wasn't a dependency. So this seems to be an issue isolated to doctest. |
In case anybody of you guys opens an issue in the doctest repo, it would be cool if you could post the link here, so future readers of this can easily find it. 🙂 |
Yep, I will, once I figure out a minimal example for that supposed bug. The super minimal example in their tutorial works, but something breaks in my setup in the aforementioned side project (that doesn't involve FunctionalPlus). Tbf, it could still be that some thing isn't set correctly in the doctest setup in this library, and that the source of that error is the same that I see in my other side project. In that case I guess this could still be considered a bug in FunctionalPlus, and I see if I can fix it same way I'm going to fix it in that other project, |
Quick update: Reproduced the bug, found the issue with my setup, and found the related Github issue. The problem is the Just for completeness sake, this is the CMake file: cmake_minimum_required(VERSION 3.20)
project(doctestest LANGUAGES CXX VERSION 0.0.1)
#######################################
# Conan Block BEGIN
#######################################
# setup conan.cmake if it does not exist
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.16.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
EXPECTED_HASH SHA256=396e16d0f5eabdc6a14afddbcfff62a54a7ee75c6da23f32f7a31bc85db23484
TLS_VERIFY ON)
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_configure(
REQUIRES
doctest/2.4.6
GENERATORS
cmake_paths
cmake_find_package
)
conan_cmake_autodetect(settings)
# download deps in conanfile.txt
conan_cmake_install(PATH_OR_REFERENCE .
BUILD missing
REMOTE conancenter
SETTINGS ${settings}
)
# add paths of conan managed packages
include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
#######################################
# Conan Block END
#######################################
find_package(doctest REQUIRED)
include(doctest)
add_executable(tests main.cpp)
target_compile_features(tests PRIVATE cxx_std_17)
target_link_libraries(tests PRIVATE doctest::doctest)
doctest_discover_tests(tests) And this is the source file: #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest/doctest.h>
int factorial(int number) {
return number <= 1 ? number : factorial(number - 1) * number;
}
TEST_CASE("testing the factorial function") {
CHECK(factorial(1) == 1);
CHECK(factorial(2) == 2);
CHECK(factorial(3) == 6);
CHECK(factorial(10) == 3628800);
} As I said, the culprit is the line This is fixed in their dev branch, and the bug's been introduced in 2.4.6, so it runs fine in 2.4.5 (I just tested that too). The only consequence for FunctionalPlus then is that, at least in some circumstances, it cannot be doctest'ed with doctest version 2.4.6 specifically. Dunno if that should be noted anywhere. So indeed this wasn't a FunctionalPlus issue, or at least not directly. |
Thanks a lot for doing all this digging work. 👍 I've just added a remark to the docs about not using doctest |
The text was updated successfully, but these errors were encountered: