[subset] Rename hb-fuzzer -> hb-shape-fuzzer.

This commit is contained in:
Garret Rieger 2018-03-15 13:04:31 -07:00 committed by Behdad Esfahbod
parent 1e9bd6d5ff
commit 0ce0f87812
4 changed files with 22 additions and 22 deletions

View File

@ -1,25 +1,25 @@
if (HB_CHECK)
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM)
extract_make_variable (hb_fuzzer_SOURCES ${MAKEFILEAM})
extract_make_variable (hb_shape_fuzzer_SOURCES ${MAKEFILEAM})
extract_make_variable (hb_subset_fuzzer_SOURCES ${MAKEFILEAM})
# TODO: enable these two
#extract_make_variable (FUZZING_CPPFLAGS ${MAKEFILEAM}) # extracting regex fail
#add_executable (hb-fuzzer # it should be run only after ragel execution
#add_executable (hb-shape-fuzzer # it should be run only after ragel execution
# ${project_sources} ${project_extra_sources} ${project_headers}
# ${hb_fuzzer_SOURCES})
# ${hb_shape_fuzzer_SOURCES})
add_executable (hb-fuzzer ${hb_fuzzer_SOURCES})
target_link_libraries (hb-fuzzer harfbuzz)
add_executable (hb-shape-fuzzer ${hb_shape_fuzzer_SOURCES})
target_link_libraries (hb-shape-fuzzer harfbuzz)
add_executable (hb-subset-fuzzer ${hb_subset_fuzzer_SOURCES})
target_link_libraries (hb-subset-fuzzer harfbuzz-subset)
target_compile_definitions(hb-fuzzer PUBLIC ${FUZZING_CPPFLAGS})
target_compile_definitions(hb-shape-fuzzer PUBLIC ${FUZZING_CPPFLAGS})
target_compile_definitions(hb-subset-fuzzer PUBLIC ${FUZZING_CPPFLAGS})
add_test (NAME hb-fuzzer
COMMAND "${PYTHON_EXECUTABLE}" run-fuzzer-tests.py $<TARGET_FILE:hb-fuzzer>
add_test (NAME hb-shape-fuzzer
COMMAND "${PYTHON_EXECUTABLE}" run-shape-fuzzer-tests.py $<TARGET_FILE:hb-shape-fuzzer>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test (NAME hb-subset-fuzzer
COMMAND "${PYTHON_EXECUTABLE}" run-subset-fuzzer-tests.py $<TARGET_FILE:hb-subset-fuzzer>

View File

@ -14,13 +14,13 @@ $(top_builddir)/src/libharfbuzz-fuzzing.la: lib
EXTRA_DIST += \
README \
run-fuzzer-tests.py \
run-shape-fuzzer-tests.py \
run-subset-fuzzer-tests.py \
CMakeLists.txt \
$(NULL)
check_PROGRAMS = \
hb-fuzzer \
hb-shape-fuzzer \
hb-subset-fuzzer \
$(NULL)
@ -33,18 +33,18 @@ LDADD = \
$(top_builddir)/src/libharfbuzz-fuzzing.la \
$(NULL)
hb_fuzzer_SOURCES = \
hb_shape_fuzzer_SOURCES = \
hb-fuzzer.hh \
hb-fuzzer.cc \
hb-shape-fuzzer.cc \
main.cc \
$(NULL)
hb_fuzzer_LDADD = \
hb_shape_fuzzer_LDADD = \
$(LDADD) \
$(NULL)
hb_fuzzer_CPPFLAGS = \
hb_shape_fuzzer_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(NULL)
hb_fuzzer_DEPENDENCIES = \
hb_shape_fuzzer_DEPENDENCIES = \
lib \
$(NULL)
@ -64,7 +64,7 @@ hb_subset_fuzzer_DEPENDENCIES = \
$(NULL)
check:
EXEEXT="$(EXEEXT)" srcdir="$(srcdir)" builddir="$(builddir)" $(srcdir)/run-fuzzer-tests.py
EXEEXT="$(EXEEXT)" srcdir="$(srcdir)" builddir="$(builddir)" $(srcdir)/run-shape-fuzzer-tests.py
EXEEXT="$(EXEEXT)" srcdir="$(srcdir)" builddir="$(builddir)" $(srcdir)/run-subset-fuzzer-tests.py
-include $(top_srcdir)/git.mk

View File

@ -6,23 +6,23 @@ import sys, os, subprocess
srcdir = os.environ.get ("srcdir", ".")
EXEEXT = os.environ.get ("EXEEXT", "")
top_builddir = os.environ.get ("top_builddir", ".")
hb_fuzzer = os.path.join (top_builddir, "hb-fuzzer" + EXEEXT)
hb_shape_fuzzer = os.path.join (top_builddir, "hb-shape-fuzzer" + EXEEXT)
if not os.path.exists (hb_fuzzer):
if not os.path.exists (hb_shape_fuzzer):
if len (sys.argv) == 1 or not os.path.exists (sys.argv[1]):
print ("""Failed to find hb-fuzzer binary automatically,
print ("""Failed to find hb-shape-fuzzer binary automatically,
please provide it as the first argument to the tool""")
sys.exit (1)
hb_fuzzer = sys.argv[1]
hb_shape_fuzzer = sys.argv[1]
print ('hb_fuzzer:', hb_fuzzer)
print ('hb_shape_fuzzer:', hb_shape_fuzzer)
fails = 0
for line in open (os.path.join (srcdir, "..", "shaping", "data", "in-house", "tests", "fuzzed.tests")):
font = line.split (":")[0]
p = subprocess.Popen ([hb_fuzzer, os.path.join (srcdir, "..", "shaping", font)])
p = subprocess.Popen ([hb_shape_fuzzer, os.path.join (srcdir, "..", "shaping", font)])
if p.wait () != 0:
fails = fails + 1