[Libreoffice-commits] online.git: test/test.cpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed May 1 21:14:22 UTC 2019


 test/test.cpp |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 95e1034d27e39e080ac25ddd88099e12db89d3d3
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Wed May 1 22:12:56 2019 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Wed May 1 23:14:04 2019 +0200

    test: help people run just the one that matters.
    
    Change-Id: I1916e250613f8d50377180e38505045f71f51fd0
    Reviewed-on: https://gerrit.libreoffice.org/71642
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/test/test.cpp b/test/test.cpp
index 0b905fb54..91e3251c7 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -18,6 +18,7 @@
 #include <cppunit/BriefTestProgressListener.h>
 #include <cppunit/CompilerOutputter.h>
 #include <cppunit/TestResult.h>
+#include <cppunit/TestFailure.h>
 #include <cppunit/TestResultCollector.h>
 #include <cppunit/TestRunner.h>
 #include <cppunit/TextTestProgressListener.h>
@@ -144,6 +145,13 @@ bool runClientTests(bool standalone, bool verbose)
     outputter.setNoWrap();
     outputter.write();
 
+    const std::deque<CPPUNIT_NS::TestFailure *> &failures = result.failures();
+    if (!envar && failures.size() > 0)
+    {
+        std::cerr << "\nTo reproduce the first test failure use:\n\n";
+        std::cerr << "(cd test; CPPUNIT_TEST_NAME=\"" << (*failures.begin())->failedTestName() << "\" ./run_unit.sh)\n\n";
+    }
+
     return result.wasSuccessful();
 }
 


More information about the Libreoffice-commits mailing list