Boost logo

Boost Users :

From: Sean Shubin (sean.shubin_at_[hidden])
Date: 2002-11-01 17:34:43


My version of C++ builder does not pause to let me see console output. This makes it difficult to use boost/test while I am running the program from the IDE. The solution I found most useful, is to make the last test wait for the user to press enter. If anyone has solved this a different way, I would like to hear about it.

#include <boost/test/unit_test.hpp>

using boost::unit_test_framework::test_suite;

using std::cout;
using std::cin;
using std::endl;

void waitForUserToPressEnter() {
  cout << "Press <ENTER> to continue..." << endl;
  cin.get();
}

test_suite* init_unit_test_suite(int argc, char* argv[]) {
  test_suite* test = BOOST_TEST_SUITE("Master test suite");

  //add other tests here

  test->add(BOOST_TEST_CASE(&waitForUserToPressEnter));
  return test;
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net