Comments (10)
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,
from functionalplus.
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.
from functionalplus.
Thanks a lot for doing all this digging work. π
I've just added a remark to the docs about not using doctest 2.4.6
.
from functionalplus.
Thanks for reporting the error.
Can you provide the steps needed to reproduce it, ideally as a Dockerfile
?
from functionalplus.
Docker doesn't support FreeBSD yet.
The problem occurs in the FreeBSD port devel/functionalplus
. This is the script that is run:
/bin/mkdir -p /disk-samsung/freebsd-ports/devel/functionalplus/work/.build/test && cd /disk-samsung/freebsd-ports/devel/functionalplus/work/.build/test && \
\
/usr/bin/env XDG_DATA_HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work XDG_CONFIG_HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work XDG_CACHE_HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work/.cache HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work PATH=/disk-samsung/freebsd-ports/devel/functionalplus/work/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin SHELL=/bin/sh CONFIG_SHELL=/bin/sh /usr/local/bin/cmake -DCMAKE_C_COMPILER:STRING=cc -DCMAKE_CXX_COMPILER:STRING=c++ -DCMAKE_C_FLAGS:STRING=-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -DCMAKE_C_FLAGS_DEBUG:STRING=-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -DCMAKE_C_FLAGS_RELEASE:STRING=-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -DCMAKE_CXX_FLAGS:STRING=-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -DCMAKE_CXX_FLAGS_DEBUG:STRING=-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -DCMAKE_CXX_FLAGS_RELEASE:STRING=-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -DCMAKE_EXE_LINKER_FLAGS:STRING= -fstack-protector-strong -DCMAKE_MODULE_LINKER_FLAGS:STRING= -fstack-protector-strong -DCMAKE_SHARED_LINKER_FLAGS:STRING= -fstack-protector-strong -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_BUILD_TYPE:STRING=Release -DTHREADS_HAVE_PTHREAD_ARG:BOOL=YES -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=YES -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -GNinja /disk-samsung/freebsd-ports/devel/functionalplus/work/FunctionalPlus-0.2.16-p0/test && \
\
/usr/bin/env NINJA_STATUS=[%p %s/%t] XDG_DATA_HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work XDG_CONFIG_HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work XDG_CACHE_HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work/.cache HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work PATH=/disk-samsung/freebsd-ports/devel/functionalplus/work/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES DESTDIR=/disk-samsung/freebsd-ports/devel/functionalplus/work/stage PREFIX=/usr/local LOCALBASE=/usr/local CC=cc CFLAGS=-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing CPP=cpp CPPFLAGS=-fno-omit-frame-pointer LDFLAGS= -fstack-protector-strong LIBS= CXX=c++ CXXFLAGS=-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer MANPREFIX=/usr/local BSD_INSTALL_PROGRAM=install -s -m 555 BSD_INSTALL_LIB=install -s -m 0644 BSD_INSTALL_SCRIPT=install -m 555 BSD_INSTALL_DATA=install -m 0644 BSD_INSTALL_MAN=install -m 444 ninja -v all && \
\
/usr/bin/env NINJA_STATUS=[%p %s/%t] XDG_DATA_HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work XDG_CONFIG_HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work XDG_CACHE_HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work/.cache HOME=/disk-samsung/freebsd-ports/devel/functionalplus/work PATH=/disk-samsung/freebsd-ports/devel/functionalplus/work/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES DESTDIR=/disk-samsung/freebsd-ports/devel/functionalplus/work/stage PREFIX=/usr/local LOCALBASE=/usr/local CC=cc CFLAGS=-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing CPP=cpp CPPFLAGS=-fno-omit-frame-pointer LDFLAGS= -fstack-protector-strong LIBS= CXX=c++ CXXFLAGS=-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer MANPREFIX=/usr/local BSD_INSTALL_PROGRAM=install -s -m 555 BSD_INSTALL_LIB=install -s -m 0644 BSD_INSTALL_SCRIPT=install -m 555 BSD_INSTALL_DATA=install -m 0644 BSD_INSTALL_MAN=install -m 444 ninja -v test
from functionalplus.
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. π¬
from functionalplus.
cmake-3.21.4 is used, which is almost the latest.
/usr/local/lib/cmake/doctest/doctestAddTests.cmake
has these relevant lines:
...
set(add_labels ${TEST_ADD_LABELS})
...
if(${add_labels} EQUAL 1)
...
The last line fails.
Is TEST_ADD_LABELS
supposed to be defined by the project?
from functionalplus.
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 TEST_ADD_LABELS
supposed to be defined by the project?": I don't know. π¬
from functionalplus.
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. π
from functionalplus.
Quick update: Reproduced the bug, found the issue with my setup, and found the related Github issue.
The problem is the doctest_discover_tests
CMake function that is exported by doctest's CMake module.
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 doctest_discover_tests
, if I leave that out, the file compiles and runs fine. But it seems this is a known issue in doctest version 2.4.6, here's the issue in their repo: doctest/doctest#524
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.
from functionalplus.
Related Issues (20)
- error: exception handling disabled, use β-fexceptionsβ to enable HOT 1
- keep_by_idx() returns list of empty elements. HOT 4
- Branch `master` will be renamed to `main` in November HOT 1
- Cannot compile with gcc 11.2 in C++20 mode HOT 3
- make c++ class function to c pointer HOT 7
- Add int overrides for (some) size_t params as a convenience for fplus::fwd? HOT 3
- fplus::compose with yet unknown output type HOT 3
- parallel_for ? (no, this is not the 1st of April ;-) HOT 3
- IO Monad HOT 5
- composition.hpp uses std::result_of HOT 5
- Function to print std::tuple HOT 5
- Some List Functions (in particular, fplus::transform etc.) do not work with custom container. What needs to be added? HOT 6
- Clang 16: incompatible initializer of type (container_common_test) HOT 3
- FunctionalPlus does not compile with C++20 (std::result_of was removed) HOT 3
- CI fails because of missing GLIBC HOT 8
- Conan packages of this library are often outdated HOT 1
- get for `variant` HOT 5
- fwd bind count for `just_with_default` HOT 1
- Methods directly on containers (e.g `maybe`) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functionalplus.