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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 29 07:01:22 UTC 2019


 test/test.cpp |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 38e06bf94efe6a86a154faf47a5428289ee15161
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Aug 29 09:00:16 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Aug 29 09:00:16 2019 +0200

    test: add --debugrun switch
    
    Normally we use getgrp() to find out which lool* processes are ours when
    running 'make check', to support running multiple of these in parallel.
    
    However, in case you try to debug a failure, it's handy to start loolwsd
    manually and invoke ./test manually in two different shells.
    
    So add a switch which allows this: the result is that the failing test
    doesn't fail early in an uninteresting way (complaining that it can't
    find any loolkit processes) but fails the same way as during 'make
    check'.
    
    Let's call this --debugrun, since core has similar
    gb_UITest_DEBUGRUN/gb_JunitTest_DEBUGRUN switches, which also allow
    connecting to an already running "main" process.
    
    Change-Id: Ic7e29eb143ae70f199ef3a09ec9d6b6f8ee0650d

diff --git a/test/test.cpp b/test/test.cpp
index 6fb933dde..b04555ac7 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -64,9 +64,12 @@ bool filterTests(CPPUNIT_NS::TestRunner& runner, CPPUNIT_NS::Test* testRegistry,
     return haveTests;
 }
 
+static bool IsDebugrun = false;
+
 int main(int argc, char** argv)
 {
     const bool verbose = (argc > 1 && std::string("--verbose") == argv[1]);
+    IsDebugrun = (argc > 2 && std::string("--debugrun") == argv[2]);
     const char* loglevel = verbose ? "trace" : "error";
 
     Log::initialize("tst", loglevel, true, false, {});
@@ -203,7 +206,8 @@ std::vector<int> getProcPids(const char* exec_filename)
                 {
                     // We could have several make checks running at once.
                     int kidGrp = std::atoi(tokens[4].c_str());
-                    if (kidGrp != grp)
+                    // Don't require matching grp for --debugrun invocations.
+                    if (kidGrp != grp && !IsDebugrun)
                         continue;
 
                     switch (tokens[2].c_str()[0])


More information about the Libreoffice-commits mailing list