Lines Matching +full:tcs +full:- +full:wait

33 #include <sys/wait.h>
48 #include <atf-c++.hpp>
209 return fs::path(tc->get_config_var("srcdir")) / "helpers"; in get_helpers()
217 /// \return Always -1.
223 return -1; in fork_fail()
227 /// Mock open(2) that fails if the 'raise-error' file is opened.
234 /// \return The opened file handle or -1 on error.
239 if (std::strcmp(path, "raise-error") == 0) { in open_fail()
241 return -1; in open_fail()
256 /// \return Always -1.
262 return -1; in pipe_fail()
284 ATF_REQUIRE(pid != -1); in do_inherit_test()
290 if (::dup2(fd, child_fd) == -1) in do_inherit_test()
298 const process::status status = child->wait(); in do_inherit_test()
304 ATF_REQUIRE(::waitpid(pid, &status, 0) != -1); in do_inherit_test()
330 std::istream& output = child->output(); in child__fork_capture__ok()
342 process::status status = child->wait(); in child__fork_capture__ok()
372 std::istream& output = child->output(); in ATF_TEST_CASE_BODY()
375 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
388 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
412 atf::utils::create_file("to-not-be-deleted", ""); in ATF_TEST_CASE_BODY()
418 ::unlink("to-not-be-deleted"); in ATF_TEST_CASE_BODY()
422 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
424 ATF_REQUIRE(fs::exists(fs::path("to-not-be-deleted"))); in ATF_TEST_CASE_BODY()
432 atf::utils::create_file("to-not-be-deleted", ""); in ATF_TEST_CASE_BODY()
436 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
438 ATF_REQUIRE(fs::exists(fs::path("to-not-be-deleted"))); in ATF_TEST_CASE_BODY()
444 ::unlink("to-not-be-deleted"); in ATF_TEST_CASE_BODY()
472 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
495 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
520 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
534 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
558 atf::utils::create_file("to-not-be-deleted", ""); in ATF_TEST_CASE_BODY()
564 ::unlink("to-not-be-deleted"); in ATF_TEST_CASE_BODY()
568 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
570 ATF_REQUIRE(fs::exists(fs::path("to-not-be-deleted"))); in ATF_TEST_CASE_BODY()
578 atf::utils::create_file("to-not-be-deleted", ""); in ATF_TEST_CASE_BODY()
583 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
585 ATF_REQUIRE(fs::exists(fs::path("to-not-be-deleted"))); in ATF_TEST_CASE_BODY()
591 ::unlink("to-not-be-deleted"); in ATF_TEST_CASE_BODY()
619 child_simple_function< 1, 'A' >, fs::path("raise-error"), in ATF_TEST_CASE_BODY()
621 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
624 ATF_REQUIRE(!fs::exists(fs::path("raise-error"))); in ATF_TEST_CASE_BODY()
635 fs::path("raise-error")); in ATF_TEST_CASE_BODY()
636 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
640 ATF_REQUIRE(!fs::exists(fs::path("raise-error"))); in ATF_TEST_CASE_BODY()
648 args.push_back("return-code"); in ATF_TEST_CASE_BODY()
656 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
666 args.push_back("return-code"); in ATF_TEST_CASE_BODY()
669 ATF_REQUIRE(::mkdir("root", 0755) != -1); in ATF_TEST_CASE_BODY()
670 ATF_REQUIRE(::symlink(get_helpers(this).c_str(), "root/helpers") != -1); in ATF_TEST_CASE_BODY()
675 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
685 args.push_back("return-code"); in ATF_TEST_CASE_BODY()
688 ATF_REQUIRE(::symlink(get_helpers(this).c_str(), "helpers") != -1); in ATF_TEST_CASE_BODY()
693 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
705 args.push_back("return-code"); in ATF_TEST_CASE_BODY()
714 ATF_REQUIRE(std::getline(child->output(), line).good()); in ATF_TEST_CASE_BODY()
716 ATF_REQUIRE(!std::getline(child->output(), line)); in ATF_TEST_CASE_BODY()
718 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
732 ATF_REQUIRE(std::getline(child->output(), line).good()); in ATF_TEST_CASE_BODY()
734 ATF_REQUIRE(!std::getline(child->output(), line)); in ATF_TEST_CASE_BODY()
736 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
746 args.push_back("print-args"); in ATF_TEST_CASE_BODY()
753 ATF_REQUIRE(std::getline(child->output(), line).good()); in ATF_TEST_CASE_BODY()
755 ATF_REQUIRE(std::getline(child->output(), line).good()); in ATF_TEST_CASE_BODY()
756 ATF_REQUIRE_EQ("argv[1] = print-args", line); in ATF_TEST_CASE_BODY()
757 ATF_REQUIRE(std::getline(child->output(), line)); in ATF_TEST_CASE_BODY()
759 ATF_REQUIRE(std::getline(child->output(), line)); in ATF_TEST_CASE_BODY()
761 ATF_REQUIRE(std::getline(child->output(), line)); in ATF_TEST_CASE_BODY()
763 ATF_REQUIRE(!std::getline(child->output(), line)); in ATF_TEST_CASE_BODY()
765 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
779 ATF_REQUIRE(std::getline(child->output(), line).good()); in ATF_TEST_CASE_BODY()
782 ATF_REQUIRE(!std::getline(child->output(), line)); in ATF_TEST_CASE_BODY()
784 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
796 const int pid = child->pid(); in ATF_TEST_CASE_BODY()
798 const process::status status = child->wait(); in ATF_TEST_CASE_BODY()
812 ATF_INIT_TEST_CASES(tcs) in ATF_INIT_TEST_CASES() argument
816 ATF_ADD_TEST_CASE(tcs, child__fork_capture__ok_function); in ATF_INIT_TEST_CASES()
817 ATF_ADD_TEST_CASE(tcs, child__fork_capture__ok_functor); in ATF_INIT_TEST_CASES()
818 ATF_ADD_TEST_CASE(tcs, child__fork_capture__catch_exceptions); in ATF_INIT_TEST_CASES()
819 ATF_ADD_TEST_CASE(tcs, child__fork_capture__new_session); in ATF_INIT_TEST_CASES()
820 ATF_ADD_TEST_CASE(tcs, child__fork_capture__pipe_fail); in ATF_INIT_TEST_CASES()
821 ATF_ADD_TEST_CASE(tcs, child__fork_capture__fork_cannot_exit); in ATF_INIT_TEST_CASES()
822 ATF_ADD_TEST_CASE(tcs, child__fork_capture__fork_cannot_unwind); in ATF_INIT_TEST_CASES()
823 ATF_ADD_TEST_CASE(tcs, child__fork_capture__fork_fail); in ATF_INIT_TEST_CASES()
825 ATF_ADD_TEST_CASE(tcs, child__fork_files__ok_function); in ATF_INIT_TEST_CASES()
826 ATF_ADD_TEST_CASE(tcs, child__fork_files__ok_functor); in ATF_INIT_TEST_CASES()
827 ATF_ADD_TEST_CASE(tcs, child__fork_files__catch_exceptions); in ATF_INIT_TEST_CASES()
828 ATF_ADD_TEST_CASE(tcs, child__fork_files__new_session); in ATF_INIT_TEST_CASES()
829 ATF_ADD_TEST_CASE(tcs, child__fork_files__inherit_stdout); in ATF_INIT_TEST_CASES()
830 ATF_ADD_TEST_CASE(tcs, child__fork_files__inherit_stderr); in ATF_INIT_TEST_CASES()
831 ATF_ADD_TEST_CASE(tcs, child__fork_files__fork_cannot_exit); in ATF_INIT_TEST_CASES()
832 ATF_ADD_TEST_CASE(tcs, child__fork_files__fork_cannot_unwind); in ATF_INIT_TEST_CASES()
833 ATF_ADD_TEST_CASE(tcs, child__fork_files__fork_fail); in ATF_INIT_TEST_CASES()
834 ATF_ADD_TEST_CASE(tcs, child__fork_files__create_stdout_fail); in ATF_INIT_TEST_CASES()
835 ATF_ADD_TEST_CASE(tcs, child__fork_files__create_stderr_fail); in ATF_INIT_TEST_CASES()
837 ATF_ADD_TEST_CASE(tcs, child__spawn__absolute_path); in ATF_INIT_TEST_CASES()
838 ATF_ADD_TEST_CASE(tcs, child__spawn__relative_path); in ATF_INIT_TEST_CASES()
839 ATF_ADD_TEST_CASE(tcs, child__spawn__basename_only); in ATF_INIT_TEST_CASES()
840 ATF_ADD_TEST_CASE(tcs, child__spawn__no_path); in ATF_INIT_TEST_CASES()
841 ATF_ADD_TEST_CASE(tcs, child__spawn__no_args); in ATF_INIT_TEST_CASES()
842 ATF_ADD_TEST_CASE(tcs, child__spawn__some_args); in ATF_INIT_TEST_CASES()
843 ATF_ADD_TEST_CASE(tcs, child__spawn__missing_program); in ATF_INIT_TEST_CASES()
845 ATF_ADD_TEST_CASE(tcs, child__pid); in ATF_INIT_TEST_CASES()