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

Michael Meeks michael.meeks at collabora.com
Thu Apr 7 19:15:43 UTC 2016


 loolwsd/test/UnitPrefork.cpp |   15 +++++++++++++--
 loolwsd/test/run_unit.sh     |    4 ++--
 2 files changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 8d7a26547912b35b94d65f6bdd06baa9bea74289
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Thu Apr 7 20:15:18 2016 +0100

    Print preload time.

diff --git a/loolwsd/test/UnitPrefork.cpp b/loolwsd/test/UnitPrefork.cpp
index 6bca7b9..4133468 100644
--- a/loolwsd/test/UnitPrefork.cpp
+++ b/loolwsd/test/UnitPrefork.cpp
@@ -10,13 +10,19 @@
 #include <dlfcn.h>
 #include <ftw.h>
 #include <cassert>
+#include <iostream>
+
 #include "Util.hpp"
 #include "Unit.hpp"
 
+#include <Poco/Timestamp.h>
+using Poco::Timestamp;
+
 class UnitPrefork : public UnitHooks
 {
     int _numStarted;
     const int _numToPrefork;
+    Timestamp _startTime;
 public:
     UnitPrefork()
         : _numStarted(0),
@@ -26,14 +32,19 @@ public:
     virtual void preSpawnCount(int &numPrefork) override
     {
         numPrefork = _numToPrefork;
-        Log::error("Hello world");
     }
-
     virtual void newChild() override
     {
         _numStarted++;
         if (_numStarted >= _numToPrefork + 1)
+        {
             exitTest(TestResult::TEST_OK);
+
+            Poco::Timestamp::TimeDiff elapsed = _startTime.elapsed();
+
+            std::cout << "Launched " << _numStarted << " in "
+                      << (1.0 * elapsed)/Poco::Timestamp::resolution() << std::endl;
+        }
     }
 };
 
diff --git a/loolwsd/test/run_unit.sh b/loolwsd/test/run_unit.sh
index 8f2a79a..8c67750 100755
--- a/loolwsd/test/run_unit.sh
+++ b/loolwsd/test/run_unit.sh
@@ -9,8 +9,8 @@ echo > run_unit.sh.trs
 
 for tst in prefork; do
     tst_log="test_output/$tst.log"
-    echo "Running test: $tst | $tst_log";
-    if ../loolwsd --systemplate=${systemplate} --lotemplate="${LO_PATH}" --childroot="${jails}" --unitlib=".libs/unit-$tst.so" >& "$tst_log"; then
+    echo "Running test: $tst | $tst_log ...";
+    if ../loolwsd --systemplate=${systemplate} --lotemplate="${LO_PATH}" --childroot="${jails}" --unitlib=".libs/unit-$tst.so" 2> "$tst_log"; then
 	echo "Test $tst passed."
 	echo ":test-result: PASS $tst" >> run_unit.sh.trs
     else


More information about the Libreoffice-commits mailing list