test/test.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
New commits: commit 92603013de1a44153a9855bbfd9fc9ae9a92f834 Author: Michael Meeks <[email protected]> AuthorDate: Sat May 4 20:16:36 2019 +0100 Commit: Michael Meeks <[email protected]> CommitDate: Sat May 4 22:57:00 2019 +0100 test: recommend --verbose mode, and interleave output chronologically. Avoids a number of unpleasant attempts to interleave output. Change-Id: I84b25e338b576d88f7f5fc47fbfcae34c3d377fd diff --git a/test/test.cpp b/test/test.cpp index 39b726352..31a248d84 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -82,17 +82,24 @@ bool isStandalone() } static std::mutex errorMutex; +static bool IsVerbose = false; static std::stringstream errors; void tstLog(const std::ostringstream &stream) { - std::lock_guard<std::mutex> lock(errorMutex); - errors << stream.str(); + if (IsVerbose) + std::cerr << stream.str() << std::endl; + else + { + std::lock_guard<std::mutex> lock(errorMutex); + errors << stream.str(); + } } // returns true on success bool runClientTests(bool standalone, bool verbose) { + IsVerbose = verbose; IsStandalone = standalone; CPPUNIT_NS::TestResult controller; @@ -129,7 +136,6 @@ bool runClientTests(bool standalone, bool verbose) if (!verbose) { - // redirect std::cerr temporarily runner.run(controller); // output the errors we got during the testing @@ -150,7 +156,7 @@ bool runClientTests(bool standalone, bool verbose) { std::cerr << "\nTo reproduce the first test failure use:\n\n"; #ifndef UNIT_CLIENT_TESTS - std::cerr << "(cd test; CPPUNIT_TEST_NAME=\"" << (*failures.begin())->failedTestName() << "\" ./run_unit.sh)\n\n"; + std::cerr << "(cd test; CPPUNIT_TEST_NAME=\"" << (*failures.begin())->failedTestName() << "\" ./run_unit.sh --verbose)\n\n"; #else std::cerr << "(cd test; CPPUNIT_TEST_NAME=\"" << (*failures.begin())->failedTestName() << "\" make check)\n\n"; #endif _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
