Namespaces | Functions | Variables
stan::test Namespace Reference

Namespaces

 performance
 
 unit
 

Functions

void capture_std_streams ()
 
void reset_std_streams ()
 

Variables

std::streambuf * cout_buf = 0
 
std::streambuf * cerr_buf = 0
 
std::stringstream cout_ss
 
std::stringstream cerr_ss
 

Function Documentation

void stan::test::capture_std_streams ( )

Definition at line 36 of file util.hpp.

References om::cerr, and om::cout.

Referenced by stan::mcmc::TEST(), TEST(), and TEST_F().

36  {
37  cout_ss.str("");
38  cerr_ss.str("");
39 
40  cout_buf = std::cout.rdbuf();
41  cerr_buf = std::cerr.rdbuf();
42 
43  std::cout.rdbuf(cout_ss.rdbuf());
44  std::cerr.rdbuf(cerr_ss.rdbuf());
45  }
OStream cerr
Definition: OStream.cxx:7
std::streambuf * cerr_buf
Definition: util.hpp:31
OStream cout
Definition: OStream.cxx:6
std::streambuf * cout_buf
Definition: util.hpp:30
std::stringstream cerr_ss
Definition: util.hpp:34
std::stringstream cout_ss
Definition: util.hpp:33
void stan::test::reset_std_streams ( )

Definition at line 47 of file util.hpp.

References om::cerr, and om::cout.

Referenced by stan::mcmc::TEST(), TEST(), and TEST_F().

47  {
48  std::cout.rdbuf(cout_buf);
49  std::cerr.rdbuf(cerr_buf);
50  cout_buf = 0;
51  cerr_buf = 0;
52  }
OStream cerr
Definition: OStream.cxx:7
std::streambuf * cerr_buf
Definition: util.hpp:31
OStream cout
Definition: OStream.cxx:6
std::streambuf * cout_buf
Definition: util.hpp:30

Variable Documentation

std::streambuf* stan::test::cerr_buf = 0

Definition at line 31 of file util.hpp.

std::stringstream stan::test::cerr_ss

Definition at line 34 of file util.hpp.

Referenced by stan::mcmc::TEST(), TEST(), and TEST_F().

std::streambuf* stan::test::cout_buf = 0

Definition at line 30 of file util.hpp.

std::stringstream stan::test::cout_ss

Definition at line 33 of file util.hpp.

Referenced by stan::mcmc::TEST(), TEST(), and TEST_F().