Kaydet (Commit) 4fe073b5 authored tarafından Khaled Hosny's avatar Khaled Hosny

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: 's avatarKhaled Hosny <khaledhosny@eglug.org>
üst 614804f0
/*
Settings for test suite dependencies.
*/
#ifndef CONFIG_TEST_H
#define CONFIG_TEST_H
#define TEST_FONTS_MISSING 0
#endif
......@@ -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])
......
......@@ -9,7 +9,6 @@
#include <memory>
#include <sstream>
#include <config_test.h>
#include <swmodeltestbase.hxx>
......
......@@ -9,7 +9,6 @@
#include <memory>
#include <sstream>
#include <config_test.h>
#include <swmodeltestbase.hxx>
......
......@@ -8,7 +8,6 @@
*/
#include <memory>
#include <config_test.h>
#ifdef MACOSX
#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
......
......@@ -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);
......
......@@ -8,7 +8,6 @@
*/
#include <memory>
#include <config_test.h>
#ifdef MACOSX
#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
......
......@@ -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
......
......@@ -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()
......
......@@ -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[] = {
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment