Skip to content

Commit

Permalink
test output
Browse files Browse the repository at this point in the history
  • Loading branch information
kelbon committed Oct 5, 2024
1 parent 541a84b commit 9592245
Showing 1 changed file with 36 additions and 23 deletions.
59 changes: 36 additions & 23 deletions tests/test_coroutines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ TEST(job_mm) {
std::atomic<size_t> err_c = 0;
auto job_creator = [&](std::atomic<int32_t>& value) -> dd::job {
auto th_id = std::this_thread::get_id();
(void)co_await dd::jump_on(TP);
(void)co_await dd::jump_on(dd::new_thread_executor);
if (th_id == std::this_thread::get_id())
++err_c;
value.fetch_add(1, std::memory_order::release);
Expand Down Expand Up @@ -793,31 +793,44 @@ TEST(when_any_different_ctxts) {
return error_count;
}

#define RUN(TEST_NAME) \
{ \
std::cout << "- " << #TEST_NAME << std::flush; \
size_t c = TEST##TEST_NAME(); \
if (c > 0) { \
std::cerr << " FAIL " << c << '\n'; \
ec += c; \
} else { \
std::cout << " +" << '\n'; \
} \
}

int main() {
srand(time(0));
size_t ec = 0;
ec += TESTgenerator();
ec += TESTzip_generator();
ec += TESTlogical_thread();
ec += TESTcoroutines_integral();
ec += TESTlogical_thread_mm();
ec += TESTgen_mm();
ec += TESTjob_mm();
ec += TESTasync_tasks();
ec += TESTvoid_async_task();
ec += TESTchannel();
ec += TESTallocations();
ec += TESTdetached_tasks();
ec += TESTtask_blocking_wait();
ec += TESTtask_with_exception();
ec += TESTtask_blocking_wait_noexcept();
ec += TESTtask_start_and_detach();
ec += TESTcontexted_task();
ec += TESTcomplex_ret();
ec += TESTwhen_all_same_ctx();
ec += TESTwhen_any();
ec += TESTwhen_all_dynamic();
ec += TESTwhen_any_different_ctxts();
RUN(generator);
RUN(generator);
RUN(zip_generator);
RUN(logical_thread);
RUN(coroutines_integral);
RUN(logical_thread_mm);
RUN(gen_mm);
RUN(job_mm);
RUN(async_tasks);
RUN(void_async_task);
RUN(channel);
RUN(allocations);
RUN(detached_tasks);
RUN(task_blocking_wait);
RUN(task_with_exception);
RUN(task_blocking_wait_noexcept);
RUN(task_start_and_detach);
RUN(contexted_task);
RUN(complex_ret);
RUN(when_all_same_ctx);
RUN(when_any);
RUN(when_all_dynamic);
RUN(when_any_different_ctxts);
return ec;
}
#else
Expand Down

0 comments on commit 9592245

Please sign in to comment.