[Libreoffice-commits] core.git: sal/cppunittester sw/qa

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 25 09:17:37 UTC 2020


 sal/cppunittester/cppunittester.cxx |    3 ++-
 sw/qa/inc/swmodeltestbase.hxx       |    5 +----
 sw/qa/unit/swmodeltestbase.cxx      |    2 ++
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 34894211362ade76580eddf7e4f3a23da3872a98
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Wed Sep 23 15:32:33 2020 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Sep 25 11:17:01 2020 +0200

    cppunittester: [_RUN_____] indicates unit test start
    
    -visual: so that the human eye can easily find it
    -at start: to identify the last test if it ends abruptly
    -no spaces: easy scripting | grep RUN | awk '{print $2}'
    
    A visually unique, eye-catching start banner
    will be helpful when browsing through logs,
    or when adding asserts and running a make sw.check.
    
    [I frequently look for existing unit tests that match
    a certain condition in the 15 ooxmlexport tests.]
    
    Previously, the tests ran in the order that they existed
    in the file. So if one asserted/crashed in the middle of
    the run, you could easily guess which test it was
    by finding the name of the test that just finished OK.
    
    However, since
       2f2246d22e2a8ccbc1dc3e6f5243734a61edf270
       Author: Stephan Bergmann on Sat Aug 8 12:00:23 2020
          external/cppunit: Run tests in deterministic order
    the tests are sorted by name and run in
    alphabetical order - which is not at all obvious or
    intuitive. It certainly makes it harder to guess
    what the next alphabetical name will be.
    
    P.S. For consistency, I considered adding [____DONE_]
    as well, but existing tooling might search for
    "finished in:" and grab the first string (the test name)
    so I don't want to break anything doing that.
    
    Change-Id: I5521e681cd9f8304842290680f0389256fe3fe43
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103268
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index d325808198b7..468b54ca9ecc 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -98,8 +98,9 @@ public:
     TimingListener(const TimingListener&) = delete;
     TimingListener& operator=(const TimingListener&) = delete;
 
-    void startTest( CppUnit::Test *) override
+    void startTest( CppUnit::Test *test) override
     {
+        std::cout << "[_RUN_____] " << test->getName() << std::endl;
         m_nStartTime = osl_getGlobalTimer();
     }
 
diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx
index 20fdbd608099..cff9a4ca14c1 100644
--- a/sw/qa/inc/swmodeltestbase.hxx
+++ b/sw/qa/inc/swmodeltestbase.hxx
@@ -338,10 +338,7 @@ protected:
     /// Get TextFrame by name
     css::uno::Reference<css::drawing::XShape> getTextFrameByName(const OUString& aName);
 
-    void header()
-    {
-        std::cout << "File tested,Execution Time (ms)" << std::endl;
-    }
+    void header();
 
     void load(const OUString& pDir, const char* pName, const char* pPassword = nullptr)
     {
diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx
index 709d47321617..306e03476cef 100644
--- a/sw/qa/unit/swmodeltestbase.cxx
+++ b/sw/qa/unit/swmodeltestbase.cxx
@@ -479,6 +479,8 @@ void SwModelTestBase::setTestInteractionHandler(const char* pPassword,
     rFilterOptions[0].Value <<= xInteraction;
 }
 
+void SwModelTestBase::header() {}
+
 void SwModelTestBase::loadURL(OUString const& rURL, const char* pName, const char* pPassword)
 {
     if (mxComponent.is())


More information about the Libreoffice-commits mailing list