[tests] Use HAVE_FREETYPE itself instead NO_FT_FUNCS

This commit is contained in:
Ebrahim Byagowi 2020-07-06 11:57:45 +04:30 committed by GitHub
parent d5238c1833
commit 2013babcbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 4 deletions

View File

@ -15,6 +15,11 @@ EXTRA_DIST = \
$(NULL) $(NULL)
TEST_EXTENSIONS = .tests TEST_EXTENSIONS = .tests
if HAVE_FREETYPE
TESTS_ENVIRONMENT = HAVE_FREETYPE=1
else
TESTS_ENVIRONMENT = HAVE_FREETYPE=0
endif
TESTS_LOG_COMPILER = $(srcdir)/../../run-tests.py $(top_builddir)/util/hb-shape$(EXEEXT) TESTS_LOG_COMPILER = $(srcdir)/../../run-tests.py $(top_builddir)/util/hb-shape$(EXEEXT)
include Makefile.sources include Makefile.sources

View File

@ -14,6 +14,11 @@ EXTRA_DIST = \
$(NULL) $(NULL)
TEST_EXTENSIONS = .tests TEST_EXTENSIONS = .tests
if HAVE_FREETYPE
TESTS_ENVIRONMENT = HAVE_FREETYPE=1
else
TESTS_ENVIRONMENT = HAVE_FREETYPE=0
endif
TESTS_LOG_COMPILER = $(srcdir)/../../run-tests.py $(top_builddir)/util/hb-shape$(EXEEXT) TESTS_LOG_COMPILER = $(srcdir)/../../run-tests.py $(top_builddir)/util/hb-shape$(EXEEXT)
include Makefile.sources include Makefile.sources

View File

@ -20,6 +20,11 @@ EXTRA_DIST = \
$(NULL) $(NULL)
TEST_EXTENSIONS = .tests TEST_EXTENSIONS = .tests
if HAVE_FREETYPE
TESTS_ENVIRONMENT = HAVE_FREETYPE=1
else
TESTS_ENVIRONMENT = HAVE_FREETYPE=0
endif
TESTS_LOG_COMPILER = $(srcdir)/../../run-tests.py $(top_builddir)/util/hb-shape$(EXEEXT) TESTS_LOG_COMPILER = $(srcdir)/../../run-tests.py $(top_builddir)/util/hb-shape$(EXEEXT)
include Makefile.sources include Makefile.sources

View File

@ -6,7 +6,7 @@ subdir('data/text-rendering-tests') # text_rendering_tests
shaping_run_tests_py = find_program('run-tests.py') shaping_run_tests_py = find_program('run-tests.py')
env = environment() env = environment()
env.set('NO_FT_FUNCS', conf.get('HAVE_FREETYPE', 0) == 1 ? '0' : '1') env.set('HAVE_FREETYPE', '@0@'.format(conf.get('HAVE_FREETYPE', 0)))
foreach file_name : in_house_tests foreach file_name : in_house_tests
test_name = file_name.split('.')[0].underscorify() test_name = file_name.split('.')[0].underscorify()

View File

@ -15,7 +15,7 @@ if len (args) and args[0] == "--reference":
reference = True reference = True
args = args[1:] args = args[1:]
no_ft_funcs = bool(int(os.getenv ('NO_FT_FUNCS', '0'))) have_freetype = bool(int(os.getenv ('HAVE_FREETYPE', '1')))
if not args or args[0].find('hb-shape') == -1 or not os.path.exists (args[0]): if not args or args[0].find('hb-shape') == -1 or not os.path.exists (args[0]):
sys.exit ("""First argument does not seem to point to usable hb-shape.""") sys.exit ("""First argument does not seem to point to usable hb-shape.""")
@ -103,11 +103,11 @@ for filename in args:
shutil.copyfile(fontfile, new_fontfile) shutil.copyfile(fontfile, new_fontfile)
fontfile = new_fontfile fontfile = new_fontfile
if "--font-funcs=ft" in options and no_ft_funcs: if "--font-funcs=ft" in options and not have_freetype:
skips += 1 skips += 1
continue continue
if "--font-funcs=ot" in options or no_ft_funcs: if "--font-funcs=ot" in options or not have_freetype:
glyphs1 = cmd ([hb_shape, "--font-funcs=ot", fontfile] + extra_options + ["--unicodes", unicodes] + options) glyphs1 = cmd ([hb_shape, "--font-funcs=ot", fontfile] + extra_options + ["--unicodes", unicodes] + options)
else: else:
glyphs1 = cmd ([hb_shape, "--font-funcs=ft", fontfile] + extra_options + ["--unicodes", unicodes] + options) glyphs1 = cmd ([hb_shape, "--font-funcs=ft", fontfile] + extra_options + ["--unicodes", unicodes] + options)