diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-21 12:40:33 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:34 +0200 |
commit | a36a5042a35ddf5e8e32dd351168d9e71cd761f2 (patch) | |
tree | ca72753b99cb7b97751f43b81b5b876f5b2313fc | |
parent | 6cf30885f0d91da534871f2e6ddeca7a8a52b415 (diff) |
Test runner review
-rw-r--r-- | build2/test/script/runner.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx index 01c9f4f..abd1ef3 100644 --- a/build2/test/script/runner.cxx +++ b/build2/test/script/runner.cxx @@ -35,7 +35,7 @@ namespace build2 // a pattern, cancel the file removal if the match fails (so the // output is available for troubleshooting). // - class stream_cache: public ifdstream + class stream_cache: public ifdstream // @@ Open for output? { public: using path_type = butl::path; @@ -121,6 +121,8 @@ namespace build2 // Check if the test command output matches the pattern (redirect value). // + // @@ Expected result | expected output + // static void check_output (const process_path& program, stream_cache& sc, @@ -146,6 +148,8 @@ namespace build2 path dp ("diff"); process_path pp (run_search (dp, true)); + //@@ Need to compare both as files. + cstrings args { pp.recall_string (), "--strip-trailing-cr", @@ -175,6 +179,8 @@ namespace build2 // Here-document is always endline-terminated. // + // @@ newline + // if (rd.type == redirect_type::here_string) os << endl; @@ -189,7 +195,7 @@ namespace build2 // Output doesn't match the pattern string. Keep non-empty output // and save the pattern for troubleshooting. // - path p (sc.path + ".pattern"); + path p (sc.path + ".pattern"); // @@ .orig try { @@ -247,18 +253,7 @@ namespace build2 run (const command& c, size_t ci, const location& cl) { if (verb >= 3) - { - // @@ When running multiple threads will need to synchronize - // printing the diagnostics so it don't overlap for concurrent - // tests. Alternatively we can not bother with that and expect a - // user to re-run test operation in the single-thread mode. - // - // @@ No indentation performed for here-documents. If to fix then - // probably need to do on diag_record level in a way similar to - // butl::pager approach. - // text << c; - } // Pre-search the program path so it is reflected in the failure // diagnostics. The user can see the original path running the test @@ -359,6 +354,8 @@ namespace build2 // termination and getting the real exit status into // libbutl::process? // + // Yes, sounds good. + // #ifndef _WIN32 abnorm = !WIFEXITED (pr.status); status = abnorm ? 1 : WEXITSTATUS (pr.status); |