39 |
39 |
40 // ************************************************************************** // |
40 // ************************************************************************** // |
41 // ************** compiler_log_formatter ************** // |
41 // ************** compiler_log_formatter ************** // |
42 // ************************************************************************** // |
42 // ************************************************************************** // |
43 |
43 |
44 void |
44 EXPORT_C void |
45 compiler_log_formatter::log_start( std::ostream& output, counter_t test_cases_amount ) |
45 compiler_log_formatter::log_start( std::ostream& output, counter_t test_cases_amount ) |
46 { |
46 { |
47 if( test_cases_amount > 0 ) |
47 if( test_cases_amount > 0 ) |
48 output << "Running " << test_cases_amount << " test " |
48 output << "Running " << test_cases_amount << " test " |
49 << (test_cases_amount > 1 ? "cases" : "case") << "...\n"; |
49 << (test_cases_amount > 1 ? "cases" : "case") << "...\n"; |
50 } |
50 } |
51 |
51 |
52 //____________________________________________________________________________// |
52 //____________________________________________________________________________// |
53 |
53 |
54 void |
54 EXPORT_C void |
55 compiler_log_formatter::log_finish( std::ostream& ) |
55 compiler_log_formatter::log_finish( std::ostream& ) |
56 { |
56 { |
57 // do nothing |
57 // do nothing |
58 } |
58 } |
59 |
59 |
60 //____________________________________________________________________________// |
60 //____________________________________________________________________________// |
61 |
61 |
62 void |
62 EXPORT_C void |
63 compiler_log_formatter::log_build_info( std::ostream& output ) |
63 compiler_log_formatter::log_build_info( std::ostream& output ) |
64 { |
64 { |
65 output << "Platform: " << BOOST_PLATFORM << '\n' |
65 output << "Platform: " << BOOST_PLATFORM << '\n' |
66 << "Compiler: " << BOOST_COMPILER << '\n' |
66 << "Compiler: " << BOOST_COMPILER << '\n' |
67 << "STL : " << BOOST_STDLIB << '\n' |
67 << "STL : " << BOOST_STDLIB << '\n' |
70 << BOOST_VERSION % 100 << std::endl; |
70 << BOOST_VERSION % 100 << std::endl; |
71 } |
71 } |
72 |
72 |
73 //____________________________________________________________________________// |
73 //____________________________________________________________________________// |
74 |
74 |
75 void |
75 EXPORT_C void |
76 compiler_log_formatter::test_unit_start( std::ostream& output, test_unit const& tu ) |
76 compiler_log_formatter::test_unit_start( std::ostream& output, test_unit const& tu ) |
77 { |
77 { |
78 output << "Entering test " << tu.p_type_name << " \"" << tu.p_name << "\"" << std::endl; |
78 output << "Entering test " << tu.p_type_name << " \"" << tu.p_name << "\"" << std::endl; |
79 } |
79 } |
80 |
80 |
81 //____________________________________________________________________________// |
81 //____________________________________________________________________________// |
82 |
82 |
83 void |
83 EXPORT_C void |
84 compiler_log_formatter::test_unit_finish( std::ostream& output, test_unit const& tu, unsigned long elapsed ) |
84 compiler_log_formatter::test_unit_finish( std::ostream& output, test_unit const& tu, unsigned long elapsed ) |
85 { |
85 { |
86 output << "Leaving test " << tu.p_type_name << " \"" << tu.p_name << "\""; |
86 output << "Leaving test " << tu.p_type_name << " \"" << tu.p_name << "\""; |
87 |
87 |
88 if( elapsed > 0 ) { |
88 if( elapsed > 0 ) { |
96 output << std::endl; |
96 output << std::endl; |
97 } |
97 } |
98 |
98 |
99 //____________________________________________________________________________// |
99 //____________________________________________________________________________// |
100 |
100 |
101 void |
101 EXPORT_C void |
102 compiler_log_formatter::test_unit_skipped( std::ostream& output, test_unit const& tu ) |
102 compiler_log_formatter::test_unit_skipped( std::ostream& output, test_unit const& tu ) |
103 { |
103 { |
104 output << "Test " << tu.p_type_name << " \"" << tu.p_name << "\"" << "is skipped" << std::endl; |
104 output << "Test " << tu.p_type_name << " \"" << tu.p_name << "\"" << "is skipped" << std::endl; |
105 } |
105 } |
106 |
106 |
107 //____________________________________________________________________________// |
107 //____________________________________________________________________________// |
108 |
108 |
109 void |
109 EXPORT_C void |
110 compiler_log_formatter::log_exception( std::ostream& output, log_checkpoint_data const& checkpoint_data, const_string explanation ) |
110 compiler_log_formatter::log_exception( std::ostream& output, log_checkpoint_data const& checkpoint_data, const_string explanation ) |
111 { |
111 { |
112 print_prefix( output, BOOST_TEST_L( "unknown location" ), 0 ); |
112 print_prefix( output, BOOST_TEST_L( "unknown location" ), 0 ); |
113 output << "fatal error in \"" << framework::current_test_case().p_name << "\": "; |
113 output << "fatal error in \"" << framework::current_test_case().p_name << "\": "; |
114 |
114 |
129 output << std::endl; |
129 output << std::endl; |
130 } |
130 } |
131 |
131 |
132 //____________________________________________________________________________// |
132 //____________________________________________________________________________// |
133 |
133 |
134 void |
134 EXPORT_C void |
135 compiler_log_formatter::log_entry_start( std::ostream& output, log_entry_data const& entry_data, log_entry_types let ) |
135 compiler_log_formatter::log_entry_start( std::ostream& output, log_entry_data const& entry_data, log_entry_types let ) |
136 { |
136 { |
137 switch( let ) { |
137 switch( let ) { |
138 case BOOST_UTL_ET_INFO: |
138 case BOOST_UTL_ET_INFO: |
139 print_prefix( output, entry_data.m_file_name, entry_data.m_line_num ); |
139 print_prefix( output, entry_data.m_file_name, entry_data.m_line_num ); |
156 } |
156 } |
157 } |
157 } |
158 |
158 |
159 //____________________________________________________________________________// |
159 //____________________________________________________________________________// |
160 |
160 |
161 void |
161 EXPORT_C void |
162 compiler_log_formatter::log_entry_value( std::ostream& output, const_string value ) |
162 compiler_log_formatter::log_entry_value( std::ostream& output, const_string value ) |
163 { |
163 { |
164 output << value; |
164 output << value; |
165 } |
165 } |
166 |
166 |
167 //____________________________________________________________________________// |
167 //____________________________________________________________________________// |
168 |
168 |
169 void |
169 EXPORT_C void |
170 compiler_log_formatter::log_entry_finish( std::ostream& output ) |
170 compiler_log_formatter::log_entry_finish( std::ostream& output ) |
171 { |
171 { |
172 output << std::endl; |
172 output << std::endl; |
173 } |
173 } |
174 |
174 |
175 //____________________________________________________________________________// |
175 //____________________________________________________________________________// |
176 |
176 |
177 void |
177 EXPORT_C void |
178 compiler_log_formatter::print_prefix( std::ostream& output, const_string file, std::size_t line ) |
178 compiler_log_formatter::print_prefix( std::ostream& output, const_string file, std::size_t line ) |
179 { |
179 { |
180 output << file << '(' << line << "): "; |
180 output << file << '(' << line << "): "; |
181 } |
181 } |
182 |
182 |