KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_coroutine.cpp File Reference

Test suite for coroutines. More...

Go to the source code of this file.

Classes

struct  COROUTINE_TEST_EVENT
 An event in a simple coroutine harness. More...
 
class  COROUTINE_INCREMENTING_HARNESS
 Simple coroutine harness that runs a coroutine that increments a number up to a pre-set limit, spitting out coroutine events as it goes. More...
 

Functions

std::ostream & operator<< (std::ostream &os, const COROUTINE_TEST_EVENT &aObj)
 Define a stream function for logging this type.
 
 BOOST_AUTO_TEST_CASE (Increment)
 Declare the test suite.
 

Detailed Description

Test suite for coroutines.

See also the coroutine utility in qa/common_tools for a command line test utility.

Definition in file test_coroutine.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( Increment  )

Declare the test suite.

A basic test to repeatedly call a coroutine and check that it yields values as expected.

Definition at line 149 of file test_coroutine.cpp.

References COROUTINE_INCREMENTING_HARNESS::Run().

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const COROUTINE_TEST_EVENT aObj 
)

Define a stream function for logging this type.

TODO: convert to boost_test_print_type when Boost minver > 1.64

Definition at line 73 of file test_coroutine.cpp.

References COROUTINE_TEST_EVENT::m_type, and COROUTINE_TEST_EVENT::m_value.