Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions include/stdexec/__detail/__basic_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,20 @@ namespace STDEXEC
return __sexpr_impl<_Tag>::__get_env(__index_t(), const_cast<_State const &>(__state_));
}

constexpr explicit __rcvr(_State& __state) noexcept
: __state_(__state)
{}

STDEXEC_ATTRIBUTE(always_inline)
constexpr __rcvr(__rcvr const & __other) noexcept
: __state_(__other.__state_)
{}

STDEXEC_ATTRIBUTE(always_inline)
constexpr __rcvr(__rcvr&& __other) noexcept
: __state_(__other.__state_)
{}

_State& __state_;
};

Expand Down
143 changes: 0 additions & 143 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,68 +23,7 @@ function(add_compile_diagnostics TARGET)
endfunction()

set(stdexec_test_sources
test_main.cpp
stdexec/cpos/test_cpo_bulk.cpp
stdexec/cpos/test_cpo_receiver.cpp
stdexec/cpos/test_cpo_start.cpp
stdexec/cpos/test_cpo_connect.cpp
stdexec/cpos/test_cpo_connect_awaitable.cpp
stdexec/cpos/test_cpo_schedule.cpp
stdexec/cpos/test_cpo_upon_error.cpp
stdexec/cpos/test_cpo_upon_stopped.cpp
stdexec/concepts/test_concept_scheduler.cpp
stdexec/concepts/test_concepts_receiver.cpp
stdexec/concepts/test_concept_operation_state.cpp
stdexec/concepts/test_concepts_sender.cpp
stdexec/concepts/test_concepts_stop_tokens.cpp
stdexec/concepts/test_concepts_scope_association.cpp
stdexec/concepts/test_concepts_scope_token.cpp
stdexec/concepts/test_awaitables.cpp
stdexec/algos/factories/test_just.cpp
stdexec/algos/factories/test_transfer_just.cpp
stdexec/algos/factories/test_just_error.cpp
stdexec/algos/factories/test_just_stopped.cpp
stdexec/algos/factories/test_read.cpp
stdexec/algos/factories/test_schedule.cpp
stdexec/algos/adaptors/test_associate.cpp
stdexec/algos/adaptors/test_starts_on.cpp
stdexec/algos/adaptors/test_on.cpp
stdexec/algos/adaptors/test_on2.cpp
stdexec/algos/adaptors/test_on3.cpp
stdexec/algos/adaptors/test_continues_on.cpp
stdexec/algos/adaptors/test_finally.cpp
stdexec/algos/adaptors/test_then.cpp
stdexec/algos/adaptors/test_upon_error.cpp
stdexec/algos/adaptors/test_upon_stopped.cpp
stdexec/algos/adaptors/test_let_value.cpp
stdexec/algos/adaptors/test_let_error.cpp
stdexec/algos/adaptors/test_let_stopped.cpp
stdexec/algos/adaptors/test_bulk.cpp
stdexec/algos/adaptors/test_when_all.cpp
stdexec/algos/adaptors/test_transfer_when_all.cpp
stdexec/algos/adaptors/test_into_variant.cpp
stdexec/algos/adaptors/test_sequence.cpp
stdexec/algos/adaptors/test_stopped_as_optional.cpp
stdexec/algos/adaptors/test_stopped_as_error.cpp
stdexec/algos/adaptors/test_write_env.cpp
stdexec/algos/adaptors/test_stop_when.cpp
stdexec/algos/adaptors/test_spawn_future.cpp
stdexec/algos/consumers/test_sync_wait.cpp
stdexec/algos/consumers/test_spawn.cpp
stdexec/detail/test_any.cpp
stdexec/detail/test_common_domain.cpp
stdexec/detail/test_completion_signatures.cpp
stdexec/detail/test_demangle.cpp
stdexec/detail/test_utility.cpp
stdexec/detail/test_intrusive_mpsc_queue.cpp
stdexec/schedulers/test_task_scheduler.cpp
stdexec/schedulers/test_parallel_scheduler.cpp
stdexec/queries/test_env.cpp
stdexec/queries/test_get_forward_progress_guarantee.cpp
stdexec/queries/test_get_completion_behavior.cpp
stdexec/queries/test_forwarding_queries.cpp
stdexec/types/test_task.cpp
stdexec/types/test_counting_scopes.cpp
)

add_library(common_test_settings INTERFACE)
Expand All @@ -94,7 +33,6 @@ set_target_properties(common_test_settings PROPERTIES
CXX_EXTENSIONS OFF
MSVC_DEBUG_INFORMATION_FORMAT Embedded
)
target_include_directories(common_test_settings INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
target_compile_definitions(common_test_settings INTERFACE
STDEXEC_NAMESPACE=std::execution
$<$<PLATFORM_ID:Windows>:NOMINMAX>
Expand All @@ -104,93 +42,12 @@ target_compile_options(common_test_settings INTERFACE
$<$<CXX_COMPILER_ID:GNU>:-Wno-maybe-uninitialized> # warnings being emitted from stdlib headers, why?
$<$<CXX_COMPILER_ID:Clang>:-Wno-gnu-line-marker>
)
target_link_libraries(common_test_settings INTERFACE $<TARGET_NAME_IF_EXISTS:TBB::tbb>)
# target_compile_definitions(
# common_test_settings INTERFACE
# $<$<NOT:$<AND:$<CXX_COMPILER_ID:NVHPC>,$<COMPILE_LANGUAGE:CXX>>>:STDEXEC_ENABLE_EXTRA_TYPE_CHECKING>)

add_executable(test.stdexec ${stdexec_test_sources})
add_compile_diagnostics(test.stdexec)
target_link_libraries(test.stdexec
PUBLIC
STDEXEC::stdexec
stdexec_executable_flags
Catch2::Catch2WithMain
PRIVATE
common_test_settings)

if(STDEXEC_BUILD_PARALLEL_SCHEDULER)
add_executable(test.parallel_scheduler_replacement
test_main.cpp
stdexec/schedulers/test_parallel_scheduler_replacement.cpp)
add_compile_diagnostics(test.parallel_scheduler_replacement)
target_link_libraries(test.parallel_scheduler_replacement
PUBLIC
STDEXEC::stdexec
STDEXEC::parallel_scheduler
stdexec_executable_flags
Catch2::Catch2WithMain
PRIVATE
common_test_settings)
endif()

add_executable(test.scratch test_main.cpp test_scratch.cpp)
add_compile_diagnostics(test.scratch)
target_link_libraries(test.scratch
PUBLIC
STDEXEC::stdexec
$<TARGET_NAME_IF_EXISTS:STDEXEC::tbbexec>
stdexec_executable_flags
Catch2::Catch2WithMain
PRIVATE
common_test_settings)

# Discover the Catch2 test built by the application
include(${Catch2_SOURCE_DIR}/extras/Catch.cmake)

# For testing that builds fail as expected
include(${icm_SOURCE_DIR}/icm_build_failure_testing.cmake)

catch_discover_tests(test.stdexec PROPERTIES TIMEOUT 30)

catch_discover_tests(test.scratch PROPERTIES TIMEOUT 30)

if(STDEXEC_BUILD_PARALLEL_SCHEDULER AND NOT STDEXEC_ENABLE_CUDA)
catch_discover_tests(test.parallel_scheduler_replacement PROPERTIES TIMEOUT 30)
endif()

add_subdirectory(exec)

if(STDEXEC_ENABLE_CUDA)
add_subdirectory(nvexec)
endif()

# build failure tests: tests which parse a source file for an expected error
# message
icm_add_build_failure_test(
NAME test_let_fail1
TARGET test_let_fail1
SOURCES PARSE stdexec/algos/adaptors/test_let_fail1.cpp
LIBRARIES stdexec
FOLDER test
)

icm_add_build_failure_test(
NAME test_then_fail1
TARGET test_then_fail1
SOURCES PARSE stdexec/algos/adaptors/test_then_fail1.cpp
LIBRARIES stdexec
FOLDER test
)

if(STDEXEC_BUILD_RELACY_TESTS)
add_subdirectory(rrd)
endif()

# # Adding multiple tests with a glob
# icm_glob_build_failure_tests(
# PATTERN *_fail*.cpp
# LIBRARIES stdexec
# PREFIX stdexec
# FOLDER test/stdexec/algos/adaptors
# )
Loading
Loading