[Libreoffice-commits] core.git: tools/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 25 13:17:21 UTC 2019


 tools/qa/cppunit/test_time.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 12764e7decb7dfbd1581be5611f45220d3f31b64
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Jan 25 12:18:31 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Jan 25 14:16:52 2019 +0100

    Disable test for Linux x86 CXXFLAGS=-O1 corner case
    
    Building the LO Flatpak for --arch=i386 (where CFLAGS and CXXFLAGS are both set
    to "-march=i686 -mtune=generic -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2
    -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
    -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection
    -fcf-protection").  Even if that was due to a glitch of not disabling tests
    wholesale for that arch (which has meanwhile been addressed with
    <https://github.com/flathub/org.libreoffice.LibreOffice/pull/67/commits/
    deda15380b436ca8fe62e2ebc1feec8bcb6dd43e> "org.freedesktop.Sdk//18.08 `uname -i`
    always returns 'unknown'"), lets document that failing corner case here.
    
    Change-Id: I8f78cced45e015331e23ae9c86bc286179278076
    Reviewed-on: https://gerrit.libreoffice.org/66904
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/tools/qa/cppunit/test_time.cxx b/tools/qa/cppunit/test_time.cxx
index 39c8476bce75..a21f98d7b4d3 100644
--- a/tools/qa/cppunit/test_time.cxx
+++ b/tools/qa/cppunit/test_time.cxx
@@ -114,8 +114,15 @@ void TimeTest::testClockValues()
     // Expect this to be exact within floating point accuracy.
     // This is a hairy rounding condition, if it yields problems on any
     // platform feel free to disable the test for that platform.
+    // At least when doing a 32-bit build on Linux x86 with GCC 8.2.1, when -Os from
+    // gb_COMPILEROPTFLAGS in solenv/gbuild/platform/LINUX_INTEL_GCC.mk is overridden by -O1 (or
+    // higher) passed into CXXFLAGS, the test fails with an actual value of 0.9136, for reasons not
+    // investigated further:
+#if !(defined __GNUC__ && !defined __clang__ && defined X86 && defined __OPTIMIZE__                \
+      && !defined __OPTIMIZE_SIZE__)
     CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Fraction value.", 0.9135999999999, fFractionOfSecond,
                                          1e-14);
+#endif
 
     fTime = -0.000001;
     Time::GetClock(fTime, nHour, nMinute, nSecond, fFractionOfSecond, 4);


More information about the Libreoffice-commits mailing list