Lines Matching +full:stdout +full:- +full:path

26 #include "atf-c++/check.hpp"
42 #include <atf-c++.hpp>
44 #include "atf-c++/detail/fs.hpp"
45 #include "atf-c++/detail/process.hpp"
46 #include "atf-c++/detail/test_helpers.hpp"
47 #include "atf-c++/detail/text.hpp"
48 #include "atf-c++/utils.hpp"
50 // ------------------------------------------------------------------------
52 // ------------------------------------------------------------------------
82 // ------------------------------------------------------------------------
84 // ------------------------------------------------------------------------
141 sfile << "#include \"./non-existent.h\"\n"; in ATF_TEST_CASE_BODY()
178 // ------------------------------------------------------------------------
180 // ------------------------------------------------------------------------
191 ATF_REQUIRE(atf::utils::grep_file("-o test.o", "stdout")); in ATF_TEST_CASE_BODY()
192 ATF_REQUIRE(atf::utils::grep_file("-c test.c", "stdout")); in ATF_TEST_CASE_BODY()
196 ATF_REQUIRE(atf::utils::grep_file("-o test.o", "stdout")); in ATF_TEST_CASE_BODY()
197 ATF_REQUIRE(atf::utils::grep_file("-c test.c", "stdout")); in ATF_TEST_CASE_BODY()
211 ATF_REQUIRE(atf::utils::grep_file("-o.*test.p", "stdout")); in ATF_TEST_CASE_BODY()
212 ATF_REQUIRE(atf::utils::grep_file("test.c", "stdout")); in ATF_TEST_CASE_BODY()
217 ATF_REQUIRE(atf::utils::grep_file("-o test.p", "stdout")); in ATF_TEST_CASE_BODY()
218 ATF_REQUIRE(atf::utils::grep_file("test.c", "stdout")); in ATF_TEST_CASE_BODY()
220 ATF_REQUIRE(atf::utils::grep_file("non-existent.h", "stderr")); in ATF_TEST_CASE_BODY()
232 ATF_REQUIRE(atf::utils::grep_file("-o test.o", "stdout")); in ATF_TEST_CASE_BODY()
233 ATF_REQUIRE(atf::utils::grep_file("-c test.cpp", "stdout")); in ATF_TEST_CASE_BODY()
237 ATF_REQUIRE(atf::utils::grep_file("-o test.o", "stdout")); in ATF_TEST_CASE_BODY()
238 ATF_REQUIRE(atf::utils::grep_file("-c test.cpp", "stdout")); in ATF_TEST_CASE_BODY()
251 std::auto_ptr< atf::fs::path > out; in ATF_TEST_CASE_BODY()
252 std::auto_ptr< atf::fs::path > err; in ATF_TEST_CASE_BODY()
256 do_exec(this, "exit-success"); in ATF_TEST_CASE_BODY()
257 out.reset(new atf::fs::path(r->stdout_path())); in ATF_TEST_CASE_BODY()
258 err.reset(new atf::fs::path(r->stderr_path())); in ATF_TEST_CASE_BODY()
276 do_exec(this, "exit-success"); in ATF_TEST_CASE_BODY()
277 ATF_REQUIRE(r->exited()); in ATF_TEST_CASE_BODY()
278 ATF_REQUIRE(!r->signaled()); in ATF_TEST_CASE_BODY()
279 ATF_REQUIRE_EQ(r->exitcode(), EXIT_SUCCESS); in ATF_TEST_CASE_BODY()
284 do_exec(this, "exit-failure"); in ATF_TEST_CASE_BODY()
285 ATF_REQUIRE(r->exited()); in ATF_TEST_CASE_BODY()
286 ATF_REQUIRE(!r->signaled()); in ATF_TEST_CASE_BODY()
287 ATF_REQUIRE_EQ(r->exitcode(), EXIT_FAILURE); in ATF_TEST_CASE_BODY()
292 do_exec(this, "exit-signal"); in ATF_TEST_CASE_BODY()
293 ATF_REQUIRE(!r->exited()); in ATF_TEST_CASE_BODY()
294 ATF_REQUIRE(r->signaled()); in ATF_TEST_CASE_BODY()
295 ATF_REQUIRE_EQ(r->termsig(), SIGKILL); in ATF_TEST_CASE_BODY()
301 check_lines(const std::string& path, const char* outname, in check_lines() argument
304 std::ifstream f(path.c_str()); in check_lines()
319 set_md_var("descr", "Tests that exec properly captures the stdout " in ATF_TEST_CASE_HEAD()
325 do_exec(this, "stdout-stderr", "result1"); in ATF_TEST_CASE_BODY()
326 ATF_REQUIRE(r1->exited()); in ATF_TEST_CASE_BODY()
327 ATF_REQUIRE_EQ(r1->exitcode(), EXIT_SUCCESS); in ATF_TEST_CASE_BODY()
330 do_exec(this, "stdout-stderr", "result2"); in ATF_TEST_CASE_BODY()
331 ATF_REQUIRE(r2->exited()); in ATF_TEST_CASE_BODY()
332 ATF_REQUIRE_EQ(r2->exitcode(), EXIT_SUCCESS); in ATF_TEST_CASE_BODY()
334 const std::string out1 = r1->stdout_path(); in ATF_TEST_CASE_BODY()
335 const std::string out2 = r2->stdout_path(); in ATF_TEST_CASE_BODY()
336 const std::string err1 = r1->stderr_path(); in ATF_TEST_CASE_BODY()
337 const std::string err2 = r2->stderr_path(); in ATF_TEST_CASE_BODY()
349 ATF_REQUIRE(out1.find("/stdout") != std::string::npos); in ATF_TEST_CASE_BODY()
350 ATF_REQUIRE(out2.find("/stdout") != std::string::npos); in ATF_TEST_CASE_BODY()
357 check_lines(out1, "stdout", "result1"); in ATF_TEST_CASE_BODY()
358 check_lines(out2, "stdout", "result2"); in ATF_TEST_CASE_BODY()
366 set_md_var("descr", "Tests that running a non-existing binary " in ATF_TEST_CASE_HEAD()
372 argv.push_back("/foo/bar/non-existent"); in ATF_TEST_CASE_BODY()
376 ATF_REQUIRE(r->exited()); in ATF_TEST_CASE_BODY()
377 ATF_REQUIRE_EQ(r->exitcode(), 127); in ATF_TEST_CASE_BODY()
380 // ------------------------------------------------------------------------
382 // ------------------------------------------------------------------------