[Libreoffice-commits] core.git: config_host/config_test.h.in configure.ac sw/qa vcl/qa

Khaled Hosny khaledhosny at eglug.org
Sat Jul 7 20:27:57 UTC 2018


 config_host/config_test.h.in               |   10 -----
 configure.ac                               |   57 -----------------------------
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx |    1 
 sw/qa/extras/ooxmlexport/ooxmlexport12.cxx |    1 
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx  |    1 
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |    4 +-
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx  |    1 
 sw/qa/extras/ww8export/ww8export.cxx       |    6 +--
 vcl/qa/cppunit/FontFeatureTest.cxx         |    6 +--
 vcl/qa/cppunit/complextext.cxx             |   12 +++---
 vcl/qa/cppunit/pdfexport/pdfexport.cxx     |    1 
 11 files changed, 14 insertions(+), 86 deletions(-)

New commits:
commit 4fe073b563336c1b8bfb97a9addc8fb7a8145858
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sat Jul 7 16:07:05 2018 +0200

    Drop TEST_FONTS_MISSING for HAVE_MORE_FONTS
    
    TEST_FONTS_MISSING is just adding confusion since it tests for hardcoded
    font names, while what we really want (most of time) is to check whether
    bundled fonts are enabled or not, and HAVE_MORE_FONTS just does that.
    
    Change-Id: I1b00d359c37fa49584ca27c319d6d0e937c3b20b
    Reviewed-on: https://gerrit.libreoffice.org/57136
    Tested-by: Jenkins
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>

diff --git a/config_host/config_test.h.in b/config_host/config_test.h.in
deleted file mode 100644
index c310350bb494..000000000000
--- a/config_host/config_test.h.in
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
-Settings for test suite dependencies.
-*/
-
-#ifndef CONFIG_TEST_H
-#define CONFIG_TEST_H
-
-#define TEST_FONTS_MISSING 0
-
-#endif
diff --git a/configure.ac b/configure.ac
index 9a00abdb812f..8c82c17f0ce6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11435,43 +11435,6 @@ fi
 AC_SUBST(OPENSYMBOL_TTF)
 AC_SUBST(FONTFORGE)
 
-TEST_FONTS_MISSING=0
-
-# $1  = font family
-# $2+ = accepted font mappings
-test_font_map()
-{
-    FONT="$1" ; shift
-    FONT_LOWER="$(echo "$FONT" | $AWK '{print tolower($0)}')"
-    AC_MSG_CHECKING([font mapping for '$FONT'])
-    FONTFILE="$(basename `$FCMATCH -f '%{file}' "$FONT"`)"
-    FONTFILE_LOWER="$(echo "$FONTFILE" | $AWK '{print tolower($0)}')"
-
-    CURRENT_FONT_FOUND=0
-    if test "${FONTFILE_LOWER}" = "${FONT_LOWER}".ttf
-    then
-        CURRENT_FONT_FOUND=1
-    else
-        while test "$#" -ge 1 ; do
-            MAPPING_LOWER="$(echo "$1" | $AWK '{print tolower($0)}')"; shift
-            if test \( "${FONTFILE_LOWER}" = "${MAPPING_LOWER}"-regular.ttf \) -o \
-                \( "${FONTFILE_LOWER}" = "${MAPPING_LOWER}".ttf \)
-            then
-                CURRENT_FONT_FOUND=1
-                break
-            fi
-        done
-    fi
-    if test $CURRENT_FONT_FOUND -eq 1
-    then
-        AC_MSG_RESULT([ok])
-    else
-        AC_MSG_RESULT([unknown map '$FONTFILE'])
-        add_warning "unknown map '$FONTFILE' for '$FONT'"
-        TEST_FONTS_MISSING=1
-    fi
-}
-
 dnl ===================================================================
 dnl Test whether to include fonts
 dnl ===================================================================
@@ -11485,27 +11448,8 @@ else
     AC_MSG_RESULT([no])
     WITH_FONTS=
     SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
-    if test "$test_fontconfig" = "yes"; then
-        AC_PATH_PROG([FCMATCH], [fc-match])
-        if test -z "$FCMATCH"; then
-            AC_MSG_WARN([Unable to query installed fonts - unit tests disabled.])
-            TEST_FONTS_MISSING=1
-        else
-            test_font_map 'Calibri' 'Carlito'
-            test_font_map 'DejaVuSans' 'DejaVuSans'
-            test_font_map 'Linux Libertine G' 'LinLibertine_R_G'
-            if test ${TEST_FONTS_MISSING} -eq 1
-            then
-                AC_MSG_WARN([Unknown font mappings - unit tests disabled.])
-                add_warning "Unknown font mappings - unit tests disabled."
-            fi
-        fi
-    else
-        TEST_FONTS_MISSING=1
-    fi
 fi
 AC_SUBST(WITH_FONTS)
-AC_DEFINE_UNQUOTED([TEST_FONTS_MISSING], $TEST_FONTS_MISSING)
 
 
 dnl ===================================================================
@@ -12906,7 +12850,6 @@ AC_CONFIG_HEADERS([config_host/config_gtk3_kde5.h])
 AC_CONFIG_HEADERS([config_host/config_oox.h])
 AC_CONFIG_HEADERS([config_host/config_options.h])
 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
-AC_CONFIG_HEADERS([config_host/config_test.h])
 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
 AC_CONFIG_HEADERS([config_host/config_vendor.h])
 AC_CONFIG_HEADERS([config_host/config_vcl.h])
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index ad30e3d67629..894056d70d94 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -9,7 +9,6 @@
 
 #include <memory>
 #include <sstream>
-#include <config_test.h>
 
 #include <swmodeltestbase.hxx>
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index 6036ba18882b..852e63114769 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -9,7 +9,6 @@
 
 #include <memory>
 #include <sstream>
-#include <config_test.h>
 
 #include <swmodeltestbase.hxx>
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 8cff697d4ca8..4b3a9cf3b7d5 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -8,7 +8,6 @@
  */
 
 #include <memory>
-#include <config_test.h>
 
 #ifdef MACOSX
 #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index a80aff6ce770..6f86c484bd42 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -8,7 +8,7 @@
  */
 
 #include <memory>
-#include <config_test.h>
+#include <config_features.h>
 
 #ifdef MACOSX
 #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
@@ -559,7 +559,7 @@ DECLARE_OOXMLIMPORT_TEST(testGroupshapeChildRotation, "groupshape-child-rotation
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xShape->getPosition().X);
     CPPUNIT_ASSERT_EQUAL(sal_Int32(-5741), xShape->getPosition().Y);
 
-#if ! TEST_FONTS_MISSING
+#if HAVE_MORE_FONTS
     xShape.set(xGroupShape->getByIndex(4), uno::UNO_QUERY);
     // This was 887, i.e. border distances were included in the height.
     CPPUNIT_ASSERT_EQUAL(sal_Int32(686), xShape->getSize().Height);
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 001c188be2fc..7b34c98c3dd3 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -8,7 +8,6 @@
  */
 
 #include <memory>
-#include <config_test.h>
 
 #ifdef MACOSX
 #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index d5a84b2b1ded..295f39b7dc11 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -46,7 +46,7 @@
 #include <view.hxx>
 #include <wrtsh.hxx>
 
-#include <config_test.h>
+#include <config_features.h>
 
 #include <bordertest.hxx>
 
@@ -613,7 +613,7 @@ DECLARE_WW8EXPORT_TEST(testLayoutHanging, "fdo68967.doc")
     // This must not hang in layout
 }
 
-#if !TEST_FONTS_MISSING
+#if HAVE_MORE_FONTS
 DECLARE_WW8EXPORT_TEST(testfdo68963, "fdo68963.doc")
 {
     // The problem was that the text was not displayed.
@@ -1294,7 +1294,7 @@ DECLARE_WW8EXPORT_TEST(testCommentExport, "comment-export.odt")
 }
 
 #if !defined(MACOSX) && !defined(_WIN32)
-#if !TEST_FONTS_MISSING
+#if HAVE_MORE_FONTS
 DECLARE_WW8EXPORT_TEST(testTableKeep, "tdf91083.odt")
 {
     //emulate table "keep with next" -do not split table
diff --git a/vcl/qa/cppunit/FontFeatureTest.cxx b/vcl/qa/cppunit/FontFeatureTest.cxx
index b37cac87a283..879411ac5d1c 100644
--- a/vcl/qa/cppunit/FontFeatureTest.cxx
+++ b/vcl/qa/cppunit/FontFeatureTest.cxx
@@ -8,7 +8,7 @@
  */
 
 #include <test/bootstrapfixture.hxx>
-#include <config_test.h>
+#include <config_features.h>
 #include <cppunit/TestAssert.h>
 #include <cppunit/TestFixture.h>
 
@@ -38,7 +38,7 @@ void FontFeatureTest::testGetFontFeatures()
 {
 // "Linux Libertine G" is a font bundled with LO, but sometimes the
 // bundled fonts aren't available so we need to disable test in that case
-#if !TEST_FONTS_MISSING
+#if HAVE_MORE_FONTS
     ScopedVclPtrInstance<VirtualDevice> aVDev(*Application::GetDefaultDevice(),
                                               DeviceFormat::DEFAULT, DeviceFormat::DEFAULT);
     aVDev->SetOutputSizePixel(Size(10, 10));
@@ -114,7 +114,7 @@ void FontFeatureTest::testGetFontFeatures()
         CPPUNIT_ASSERT_EQUAL(sal_uInt32(2), rParameter2.getCode());
         CPPUNIT_ASSERT(!rParameter2.getDescription().isEmpty());
     }
-#endif // !TEST_FONTS_MISSING
+#endif // HAVE_MORE_FONTS
 }
 
 void FontFeatureTest::testParseFeature()
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index cf1027f0810c..7a8389ffc427 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -7,11 +7,11 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include <config_test.h>
+#include <config_features.h>
 
 #include <ostream>
 #include <vector>
-#if !defined(_WIN32) && !TEST_FONTS_MISSING
+#if !defined(_WIN32) && HAVE_MORE_FONTS
 static std::ostream& operator<<(std::ostream& rStream, const std::vector<long>& rVec);
 #endif
 
@@ -25,7 +25,7 @@ static std::ostream& operator<<(std::ostream& rStream, const std::vector<long>&
 #include <osl/file.hxx>
 #include <osl/process.h>
 
-#if !defined(_WIN32) && !TEST_FONTS_MISSING
+#if !defined(_WIN32) && HAVE_MORE_FONTS
 static std::ostream& operator<<(std::ostream& rStream, const std::vector<long>& rVec)
 {
     rStream << "{ ";
@@ -42,7 +42,7 @@ class VclComplexTextTest : public test::BootstrapFixture
 public:
     VclComplexTextTest() : BootstrapFixture(true, false) {}
 
-#if !TEST_FONTS_MISSING
+#if HAVE_MORE_FONTS
     /// Play with font measuring etc.
     void testArabic();
 #endif
@@ -51,7 +51,7 @@ public:
 #endif
 
     CPPUNIT_TEST_SUITE(VclComplexTextTest);
-#if !TEST_FONTS_MISSING
+#if HAVE_MORE_FONTS
     CPPUNIT_TEST(testArabic);
 #endif
 #if defined(_WIN32)
@@ -60,7 +60,7 @@ public:
     CPPUNIT_TEST_SUITE_END();
 };
 
-#if !TEST_FONTS_MISSING
+#if HAVE_MORE_FONTS
 void VclComplexTextTest::testArabic()
 {
     const unsigned char pOneTwoThreeUTF8[] = {
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 849e87b90f4a..628964bce664 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -8,7 +8,6 @@
  */
 
 #include <config_features.h>
-#include <config_test.h>
 
 #include <com/sun/star/frame/Desktop.hpp>
 #include <com/sun/star/frame/XStorable.hpp>


More information about the Libreoffice-commits mailing list