test2.cpp 1014 B

1234567891011121314151617181920212223242526272829
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // test2.cpp
  3. //
  4. // Copyright 2008 Eric Niebler. Distributed under the Boost
  5. // Software License, Version 1.0. (See accompanying file
  6. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. #include <algorithm>
  8. #include "./test2.hpp"
  9. ///////////////////////////////////////////////////////////////////////////////
  10. // test_main
  11. // read the tests from the input file and execute them
  12. void test_main()
  13. {
  14. typedef std::string::const_iterator iterator_type;
  15. boost::iterator_range<xpr_test_case<iterator_type> const *> rng = get_test_cases<iterator_type>();
  16. std::for_each(rng.begin(), rng.end(), test_runner<iterator_type>());
  17. }
  18. ///////////////////////////////////////////////////////////////////////////////
  19. // init_unit_test_suite
  20. //
  21. test_suite* init_unit_test_suite( int argc, char* argv[] )
  22. {
  23. test_suite *test = BOOST_TEST_SUITE("test2");
  24. test->add(BOOST_TEST_CASE(&test_main));
  25. return test;
  26. }