Lines Matching defs:std

69 check_stream(std::ostream& os)
78 throw std::runtime_error("Failed");
90 class tokenizer : public atf::parser::tokenizer< std::istream > {
92 tokenizer(std::istream& is, size_t curline) :
93 atf::parser::tokenizer< std::istream >
106 void got_tc(const std::string& ident, const atf::tests::vars_map& props)
109 throw(std::runtime_error("Duplicate test case " + ident +
114 m_tcs[ident].insert(std::make_pair("has.cleanup", "false"));
117 m_tcs[ident].insert(std::make_pair("timeout", "300"));
121 metadata_reader(std::istream& is) :
148 const std::string& test_case_name;
149 const std::string& test_case_part;
156 const std::string& p_test_case_name,
157 const std::string& p_test_case_part,
174 std::string
193 append_to_vector(std::vector< std::string >& v1,
194 const std::vector< std::string >& v2)
196 std::copy(v2.begin(), v2.end(),
197 std::back_insert_iterator< std::vector< std::string > >(v1));
202 vector_to_argv(const std::vector< std::string >& v)
205 for (std::vector< std::string >::size_type i = 0; i < v.size(); i++) {
215 const std::vector< std::string >& argv)
223 const std::string message = "Failed to execute '" + executable.str() +
224 "': " + std::strerror(errno) + "\n";
226 std::abort();
227 std::exit(EXIT_FAILURE);
231 std::vector< std::string >
234 std::vector< std::string > args;
250 throw std::runtime_error("Could not open /dev/null");
291 std::vector< std::string > argv;
306 const std::pair< int, int > user = impl::get_required_user(
318 std::vector< std::string > argv;
330 tokenize_result(const std::string& line, std::string& out_state,
331 std::string& out_arg, std::string& out_reason)
333 const std::string::size_type pos = line.find_first_of(":(");
334 if (pos == std::string::npos) {
343 const std::string::size_type pos2 = line.find("):", pos);
344 if (pos2 == std::string::npos)
345 throw std::runtime_error("Invalid test case result '" + line +
355 handle_result(const std::string& state, const std::string& arg,
356 const std::string& reason)
361 throw std::runtime_error("The test case result '" + state + "' cannot "
368 handle_result_with_reason(const std::string& state, const std::string& arg,
369 const std::string& reason)
375 throw std::runtime_error("The test case result '" + state + "' must "
382 handle_result_with_reason_and_arg(const std::string& state,
383 const std::string& arg,
384 const std::string& reason)
389 throw std::runtime_error("The test case result '" + state + "' must "
398 } catch (const std::runtime_error&) {
399 throw std::runtime_error("The value '" + arg + "' passed to the '" +
409 detail::atf_tp_reader::atf_tp_reader(std::istream& is) :
420 const std::string& ident ATF_DEFS_ATTRIBUTE_UNUSED,
421 const std::map< std::string, std::string >& md ATF_DEFS_ATTRIBUTE_UNUSED)
431 detail::atf_tp_reader::validate_and_insert(const std::string& name,
432 const std::string& value, const size_t lineno,
433 std::map< std::string, std::string >& md)
441 const std::string ident_regex = "^[_A-Za-z0-9]+$";
442 const std::string integer_regex = "^[0-9]+$";
449 } catch (const std::runtime_error&) {
464 } catch (const std::runtime_error&) {
482 md.insert(std::make_pair(name, value));
491 std::pair< size_t, atf::parser::headers_map > hml =
505 std::map< std::string, std::string > props;
507 const std::string name = t.text();
509 const std::string value = atf::text::trim(p.rest_of_line());
516 const std::map< std::string, std::string >::const_iterator
540 detail::parse_test_case_result(const std::string& line)
542 std::string state, arg, reason;
562 throw std::runtime_error("Unknown test case result type in: " + line);
565 impl::atf_tps_writer::atf_tps_writer(std::ostream& os) :
578 impl::atf_tps_writer::info(const std::string& what, const std::string& val)
592 impl::atf_tps_writer::start_tp(const std::string& tp, size_t ntcs)
601 impl::atf_tps_writer::end_tp(const std::string& reason)
603 PRE(reason.find('\n') == std::string::npos);
613 impl::atf_tps_writer::start_tc(const std::string& tcname)
621 impl::atf_tps_writer::stdout_tc(const std::string& line)
630 impl::atf_tps_writer::stderr_tc(const std::string& line)
639 impl::atf_tps_writer::end_tc(const std::string& state,
640 const std::string& reason)
642 std::string str = ", " + m_tcname + ", " + state;
676 std::ifstream results_file(results_path.c_str());
678 throw std::runtime_error("Failed to open " + results_path.str());
680 std::string line, extra_line;
681 std::getline(results_file, line);
683 throw std::runtime_error("Results file is empty");
685 while (std::getline(results_file, extra_line).good())
707 line_callback(const size_t index, const std::string& line)
727 std::pair< std::string, atf::process::status >
729 const std::string& test_case_name,
730 const std::string& test_case_part,
779 std::string reason;
789 return std::make_pair(reason, status);