Lines Matching refs:tools

60 namespace impl = tools::test_program;
61 namespace detail = tools::test_program::detail;
83 static const tools::parser::token_type eof_type = 0;
84 static const tools::parser::token_type nl_type = 1;
85 static const tools::parser::token_type text_type = 2;
86 static const tools::parser::token_type colon_type = 3;
87 static const tools::parser::token_type dblquote_type = 4;
89 class tokenizer : public tools::parser::tokenizer< std::istream > {
92 tools::parser::tokenizer< std::istream > in tokenizer()
134 const tools::fs::path& executable;
137 get_metadata_params(const tools::fs::path& p_executable, in get_metadata_params()
146 const tools::fs::path& executable;
151 const tools::fs::path& resfile;
152 const tools::fs::path& workdir;
154 test_case_params(const tools::fs::path& p_executable, in test_case_params()
159 const tools::fs::path& p_resfile, in test_case_params()
160 const tools::fs::path& p_workdir) : in test_case_params()
213 exec_or_exit(const tools::fs::path& executable, in exec_or_exit()
255 prepare_child(const tools::fs::path& workdir) in prepare_child()
262 for (int i = 1; i <= tools::signals::last_signo; i++) in prepare_child()
263 tools::signals::reset(i); in prepare_child()
265 tools::env::set("HOME", workdir.str()); in prepare_child()
266 tools::env::unset("LANG"); in prepare_child()
267 tools::env::unset("LC_ALL"); in prepare_child()
268 tools::env::unset("LC_COLLATE"); in prepare_child()
269 tools::env::unset("LC_CTYPE"); in prepare_child()
270 tools::env::unset("LC_MESSAGES"); in prepare_child()
271 tools::env::unset("LC_MONETARY"); in prepare_child()
272 tools::env::unset("LC_NUMERIC"); in prepare_child()
273 tools::env::unset("LC_TIME"); in prepare_child()
274 tools::env::set("TZ", "UTC"); in prepare_child()
276 tools::env::set("__RUNNING_INSIDE_ATF_RUN", "internal-yes-value"); in prepare_child()
278 tools::fs::change_directory(workdir); in prepare_child()
305 const std::pair< int, int > user = tools::get_required_user( in run_test_case_child()
308 tools::fs::change_ownership(params->workdir, user); in run_test_case_child()
309 tools::user::drop_privileges(user); in run_test_case_child()
314 const tools::fs::path absolute_executable = params->executable.to_absolute(); in run_test_case_child()
342 out_reason = tools::text::trim(line.substr(pos + 1)); in tokenize_result()
350 out_reason = tools::text::trim(line.substr(pos2 + 2)); in tokenize_result()
398 value = tools::text::to_type< int >(arg); in handle_result_with_reason_and_arg()
436 using tools::parser::parse_error; in validate_and_insert()
449 (void)tools::text::to_bool(value); in validate_and_insert()
455 if (!tools::text::match(value, ident_regex)) in validate_and_insert()
464 (void)tools::text::to_bytes(value); in validate_and_insert()
472 if (!tools::text::match(value, integer_regex)) in validate_and_insert()
489 using tools::parser::parse_error; in read()
492 std::pair< size_t, tools::parser::headers_map > hml = in read()
493 tools::parser::read_headers(m_is, 1); in read()
494 tools::parser::validate_content_type(hml.second, in read()
498 tools::parser::parser< tokenizer > p(tkz); in read()
501 tools::parser::token t = p.expect(text_type, "property name"); in read()
510 const std::string value = tools::text::trim(p.rest_of_line()); in read()
569 tools::parser::headers_map hm; in atf_tps_writer()
570 tools::parser::attrs_map ct_attrs; in atf_tps_writer()
573 tools::parser::header_entry("Content-Type", "application/X-atf-tps", in atf_tps_writer()
575 tools::parser::write_headers(hm, m_os); in atf_tps_writer()
651 impl::get_metadata(const tools::fs::path& executable, in get_metadata()
655 tools::process::child child = in get_metadata()
656 tools::process::fork(get_metadata_child, in get_metadata()
657 tools::process::stream_capture(), in get_metadata()
658 tools::process::stream_inherit(), in get_metadata()
661 tools::io::pistream outin(child.stdout_fd()); in get_metadata()
666 const tools::process::status status = child.wait(); in get_metadata()
668 throw tools::parser::format_error("Test program returned failure " in get_metadata()
675 impl::read_test_case_result(const tools::fs::path& results_path) in read_test_case_result()
704 class child_muxer : public tools::io::muxer {
728 std::pair< std::string, tools::process::status >
729 impl::run_test_case(const tools::fs::path& executable, in run_test_case()
734 const tools::fs::path& resfile, in run_test_case()
735 const tools::fs::path& workdir, in run_test_case()
743 tools::process::child child = in run_test_case()
744 tools::process::fork(run_test_case_child, in run_test_case()
745 tools::process::stream_capture(), in run_test_case()
746 tools::process::stream_capture(), in run_test_case()
754 tools::text::to_type< unsigned int >((*iter).second); in run_test_case()
758 tools::io::file_handle outfh = child.stdout_fd(); in run_test_case()
759 tools::io::file_handle errfh = child.stderr_fd(); in run_test_case()
778 tools::process::status status = child.wait(); in run_test_case()
786 reason = "Test case timed out after " + tools::text::to_string(timeout) + in run_test_case()