out_inlined.hpp 788 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef BOOST_CONTRACT_TEST_OUT_INLINED_HPP_
  2. #define BOOST_CONTRACT_TEST_OUT_INLINED_HPP_
  3. // Copyright (C) 2008-2018 Lorenzo Caminiti
  4. // Distributed under the Boost Software License, Version 1.0 (see accompanying
  5. // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
  6. // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
  7. #include "out.hpp"
  8. #include <iostream>
  9. namespace boost { namespace contract { namespace test { namespace detail {
  10. namespace out_ {
  11. std::string out;
  12. }
  13. std::string out() { return out_::out; }
  14. void out(std::string const& text) {
  15. if(text == "") out_::out = "";
  16. else {
  17. out_::out = out_::out + text;
  18. std::clog << text;
  19. std::clog.flush();
  20. }
  21. }
  22. } } } }
  23. #endif // #include guard