Skip to content

Commit d491d70

Browse files
committed
restore installation test
1 parent aaba2a9 commit d491d70

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

examples/intro-2-hello-async.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ int main() {
2424
ex::when_all(
2525
timer.run(),
2626
ex::when_all(
27-
timer.resume_after(3s)
27+
timer.resume_after(30ms)
2828
| ex::then([] { std::cout << "h\n"; return std::string("hello"); }),
29-
timer.resume_after(1s)
29+
timer.resume_after(10ms)
3030
| ex::then([] { std::cout << ",\n"; return std::string(", "); }),
31-
timer.resume_after(2s)
31+
timer.resume_after(20ms)
3232
| ex::then([] { std::cout << "w\n"; return std::string("world"); })
3333
) | ex::then([](auto const& s1, auto const& s2, auto const& s3) { return s1 + s2 + s3; })
3434
)

examples/intro-timer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ struct intro::timer {
123123

124124
auto run() { return run_sender{this}; }
125125

126-
template <typename T>
127-
auto resume_after(std::chrono::duration<T> d) {
126+
template <typename T, typename P>
127+
auto resume_after(std::chrono::duration<T, P> d) {
128128
auto ms(std::chrono::duration_cast<std::chrono::milliseconds>(d));
129129
return sender{this, ms};
130130
}

tests/beman/execution/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,26 @@ foreach(test ${execution_tests})
100100
target_link_libraries(${TEST_EXE} PRIVATE beman::execution)
101101
add_test(NAME ${TEST_EXE} COMMAND $<TARGET_FILE:${TEST_EXE}>)
102102
endforeach()
103+
104+
if(NOT PROJECT_IS_TOP_LEVEL AND BEMAN_EXECUTION_ENABLE_TESTING)
105+
# test if the targets are findable from the build directory
106+
# cmake-format: off
107+
add_test(NAME find-package-test
108+
COMMAND ${CMAKE_CTEST_COMMAND}
109+
# --verbose
110+
--output-on-failure
111+
-C $<CONFIG>
112+
--build-and-test
113+
"${CMAKE_CURRENT_SOURCE_DIR}"
114+
"${CMAKE_CURRENT_BINARY_DIR}/find-package-test"
115+
--build-generator ${CMAKE_GENERATOR}
116+
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
117+
--build-options
118+
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
119+
"-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
120+
"-DCMAKE_BUILD_TYPE=$<CONFIG>"
121+
"-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
122+
# TODO(CK): Needed too? "--config $<CONFIG>"
123+
)
124+
# cmake-format: on
125+
endif()

0 commit comments

Comments
 (0)