| 1 |
# Distributed under the original FontForge BSD 3-clause license |
| 2 |
|
| 3 |
# Note that you should invoke the `check` target instead of |
| 4 |
# the `test` target so that test-specific prerequisites are checked. |
| 5 |
|
| 6 |
include(TestUtils) |
| 7 |
|
| 8 |
if(NOT ENABLE_NATIVE_SCRIPTING AND NOT ENABLE_PYTHON_SCRIPTING_RESULT) |
| 9 |
return() |
| 10 |
endif() |
| 11 |
|
| 12 |
# systestdriver - standalone C++ test driver (no FontForge dependencies) |
| 13 |
add_executable(systestdriver systestdriver.cpp) |
| 14 |
target_link_libraries(systestdriver PRIVATE cxxopts) |
| 15 |
set_target_properties(systestdriver PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) |
| 16 |
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") |
| 17 |
target_compile_options(systestdriver PRIVATE -Wall -pedantic) |
| 18 |
endif() |
| 19 |
if(MSVC) |
| 20 |
target_compile_options(systestdriver PRIVATE /W4) |
| 21 |
endif() |
| 22 |
|
| 23 |
# Downloaded files |
| 24 |
add_download_target("NotoSans-Regular.ttc" "https://github.com/fontforge/debugfonts/raw/master/NotoSans-Regular.ttc") |
| 25 |
add_download_target("MunhwaGothic-Bold" "https://github.com/fontforge/debugfonts/raw/master/MunhwaGothic-Bold") |
| 26 |
|
| 27 |
add_custom_target(test_dependencies |
| 28 |
DEPENDS |
| 29 |
"${CMAKE_CURRENT_BINARY_DIR}/fonts/NotoSans-Regular.ttc" |
| 30 |
"${CMAKE_CURRENT_BINARY_DIR}/fonts/MunhwaGothic-Bold" |
| 31 |
) |
| 32 |
|
| 33 |
add_custom_target(check |
| 34 |
COMMAND "${CMAKE_CTEST_COMMAND}" "--output-on-failure" "--force-new-ctest-process" |
| 35 |
DEPENDS |
| 36 |
test_dependencies |
| 37 |
systestdriver |
| 38 |
VERBATIM |
| 39 |
USES_TERMINAL |
| 40 |
) |
| 41 |
|
| 42 |
# fontforgeexe is only available when not building a wheel |
| 43 |
if(NOT BUILDING_WHEEL) |
| 44 |
add_dependencies(check fontforgeexe) |
| 45 |
endif() |
| 46 |
|
| 47 |
if(ENABLE_PYTHON_SCRIPTING_RESULT AND ENABLE_PYTHON_EXTENSION_RESULT) |
| 48 |
add_dependencies(check fontforge_pyhook psMat_pyhook) |
| 49 |
endif() |
| 50 |
|
| 51 |
if(ENABLE_NATIVE_SCRIPTING AND NOT BUILDING_WHEEL) |
| 52 |
add_ff_test(test001.pe "Caliban.sfd" "Zapfino-4.0d3.dfont" "Zapfino-4.1d6.dfont" "Generate a few font files") |
| 53 |
add_ff_test(test002.pe "HanSans-Bold.otf" "OTF CID font check") |
| 54 |
add_ff_test(test003.pe "MunhwaGothic-Bold" "Non-OTF CID font check") |
| 55 |
add_ff_test(test004.pe "mingliu.ttc" "Chunk of memory check") |
| 56 |
add_ff_test(test005.pe "VKern.sfd" "Kerning information checks") |
| 57 |
add_ff_test(test006.pe "mingliu.ttc" "GillSans.dfont" "ItalicHand.sfd" "ItalicHand.svg" "MunhwaGothic-Bold" "Caliban.otf" "Incorrect names and count checks") |
| 58 |
add_ff_test(test007.pe "FormalScript.sfd" "dvng10a-crash.sfd" "Contextual chaining tables don't crash") |
| 59 |
add_ff_test(test008.pe "n019003l.pfb" "Contextual chaining tables don't crash") |
| 60 |
add_ff_test(test009.pe "Ambrosia.sfd" "Read and generate Type3 fonts") |
| 61 |
add_ff_test(test010.pe "GillSans.dfont" "Generate some error messages") |
| 62 |
add_ff_test(test101.pe "Check for unexpected") |
| 63 |
add_ff_test(test102.pe "AHBugs.sfd" "Infinite loop test on 0 length spline") |
| 64 |
add_ff_test(test103.pe "Copy/Paste clipboard test for crash") |
| 65 |
add_ff_test(test104.pe "SplineOverlapBug1.sfd" "Remove overlap test #1") |
| 66 |
add_ff_test(test105.pe "while loop check loop 10x") |
| 67 |
add_ff_test(test106.pe "OmittedCharBugs.sfd" "Simple 'Bad Kerning' check") |
| 68 |
add_ff_test(test107.pe "Ambrosia.sfd" "AmbrosiaBold.sfd" "AmbrosiaItalic.sfd" "Generate a font family") # also calls 'helper107.pe' |
| 69 |
add_ff_test(test108.pe "ItalicHand.sfd" "Make GPOS GSUB morx without crashing") |
| 70 |
add_ff_test(test109.pe "OverlapBugs.sfd" "feta20.pfb" "Remove overlap test #2") |
| 71 |
add_ff_test(test110.pe "SimplifyBugs.sfd" "Test simplify") |
| 72 |
add_ff_test(test111.pe "cmbsy10.pfb" "Test merge fonts") |
| 73 |
add_ff_test(test112.pe "CourierNew.ttf" "Test quadratic conversion") |
| 74 |
add_ff_test(test113.pe "CourierNew.ttf" "Count contour points properly") |
| 75 |
add_ff_test(test114.pe "CaslonMM.sfd" "Generate save and open a .pfa file") |
| 76 |
add_ff_test(test115.pe "n019003l.pfb" "Replace with reference") |
| 77 |
add_ff_test(test116.pe "merged.cff" "Merged") |
| 78 |
add_ff_test(test117.pe "ecrm1000.pfb" "ecrm1000.tfm" "Merge kern") |
| 79 |
add_ff_test(test118.pe "NimbusLGCUni-Regular.sfd" "Test Unicode encodings") # also uses helper118A.pe helper118B.pe |
| 80 |
add_ff_test(test119.pe "DejaVuSerif.sfd" "The 'i' glyph test") |
| 81 |
add_ff_test(test120.pe "NumberPoints.sfd" "Another deja-vu point number") |
| 82 |
add_ff_test(test121.pe "AddExtremumTest.sfd" "Don't distort the curve (by much)") |
| 83 |
#add_ff_test(test122.pe "Hinting.sfd" "Check AutoHint works and retains hints") |
| 84 |
add_ff_test(test123.pe "MinionPro-Regular.otf" "Produce equivalent font in CFF check") |
| 85 |
add_ff_test(test124.pe "Check that detach glyph works #1") |
| 86 |
add_ff_test(test125.pe "MinionPro-Regular.fea" "Check that detach glyph works #2") |
| 87 |
add_ff_test(test126.pe "DataURI.sfd" "Try SVG and PT3") |
| 88 |
add_ff_test(test127.pe "Ambrosia.sfd" "Test generation of TrueType instructions") |
| 89 |
#add_ff_test(svg2ttf.pe "") |
| 90 |
add_ff_test(test128.pe "Test StrSplit overrun") |
| 91 |
add_ff_test(test130.pe "NotoSans-Regular.ttc" "TTC loading") |
| 92 |
add_ff_test(test131.pe "libnameslist checks") |
| 93 |
if(ENABLE_WOFF2_RESULT) |
| 94 |
add_ff_test(test132.pe "CantarellMin.woff2" "WOFF2 round tripping") |
| 95 |
endif() |
| 96 |
add_ff_test(test133.pe "test133.fea" "Allowed characters in glyph class names") |
| 97 |
add_ff_test(test134.pe "test134.fea" "Short-hand contextual multiple substitution") |
| 98 |
add_ff_test(test135.pe "test135.fea" "GDEF glyph classes") |
| 99 |
add_ff_test(test136.pe "test136.fea" "Re-using mark filtering set") |
| 100 |
add_ff_test(test137.pe "Ambrosia.sfd" "file:// protocol") |
| 101 |
add_ff_test(test138.pe "Array sanity checking") |
| 102 |
add_ff_test(test139.pe "StrokeTests.sfd" "ExpandStroke parameters") |
| 103 |
endif() |
| 104 |
|
| 105 |
if(ENABLE_PYTHON_SCRIPTING_RESULT) |
| 106 |
add_py_test(test0001.py "Ambrosia.sfd" "FontForge .sfd file open check") |
| 107 |
add_py_test(test0002.py "AGL For New Fonts.txt" "Loading duplicate name list") |
| 108 |
add_py_test(test0003.py "BoxesAndBounds.sfd" "Bounding box sanity tests") |
| 109 |
add_py_test(test0004.py "OpenType script tag tests") |
| 110 |
add_py_test(test0101.py "NotoSans-Regular.ttc" "FontForge .ttc file open check") |
| 111 |
add_py_test(test1001a.py "Zapfino-4.0d3.dfont" "Point count check") |
| 112 |
add_py_test(test1001b.py "Zapfino-4.1d6.dfont" "Odd morx test without crashing") |
| 113 |
add_py_test(test1001c.py "Make new font") |
| 114 |
add_py_test(test1002.py "nuvo-medium-woff-demo.woff" "WOFF major minor meta check") |
| 115 |
add_py_test(test1003.py "StrokeTests.sfd" "Various stroke tests") |
| 116 |
add_py_test(test1004.py "DirectionTest.sfd" "Clockwise direction test") |
| 117 |
add_py_test(test1005.py "AddExtremaTest2.sfd" "Generate duplicate fonts test") |
| 118 |
add_py_test(test1006.py "Math table test") |
| 119 |
add_py_test(test1007.py "ayn+meem.init.svg" "Check for splinestroke 0 len fail") |
| 120 |
add_py_test(test1008.py "OverlapBugs.sfd" "PythonAPI: font glyph iteration") |
| 121 |
add_py_test(test1010.py "libnameslist checks") |
| 122 |
add_py_test(test1011.py "test1011.fea" "Feature file kerning with r2l lookup flag") |
| 123 |
add_py_test(test1012.py "test1012.otf" "GPOS kerning with r2l lookup flag") |
| 124 |
add_py_test(test1013.py "NotoSerifTibetan-Regular.ttf" "Read glyph names from unusual post table") |
| 125 |
add_py_test(test1014.py "PfEd layers round tripping") |
| 126 |
add_py_test(test1015.py "Caliban.sfd" "Reverse chaining tables") |
| 127 |
add_py_test(test1016.py "CMAPEncTest.sfd" "TrueType CMAP Encoding") |
| 128 |
add_py_test(test1017.py "test1017.fea" "Ignore invalid substitutions in feature file") |
| 129 |
add_py_test(test1018.py "Ambrosia.sfd" "non linear transform anchors") |
| 130 |
add_py_test(test_math_device_table.py "Ambrosia.sfd" "MATH device table properties") |
| 131 |
add_py_test(test_style_set_names.py "getter and setter of font.style_set_names including errors") |
| 132 |
add_py_test(test1021.py "deleting points from contour") |
| 133 |
#add_py_test(findoverlapbugs.py "find overlap bug") |
| 134 |
add_py_test(test926.py "DejaVuSerif.sfd" "Validate WOFF output") |
| 135 |
if(ENABLE_WOFF2_RESULT) |
| 136 |
add_py_test(test927.py "CantarellMin.woff2" "WOFF2 round tripping") |
| 137 |
endif() |
| 138 |
add_py_test(test928.py "DejaVuSerif.sfd" "String Conversion") |
| 139 |
add_py_test(test929.py "NotoSans-Regular.ttc" "Open Subfonts") |
| 140 |
add_py_test(test930.py "Point, contour, and Layer fidelity") |
| 141 |
add_py_test(test931.py "Point type conversion tests") |
| 142 |
add_py_test(test932.py "Round-trip point selection tests") |
| 143 |
add_py_test(test933.py "Test for SplineSetJoin Expand Stroke logic") |
| 144 |
add_py_test(test934.py "SFDBitmapParsing.sfd" "Parsing of a malformed SFD") |
| 145 |
add_py_test(test_persistent_payload.py "Round-trip font/glyph persistent payload via SFD") |
| 146 |
add_py_test(test_generate.py "Caliban.sfd" "Generate several font files") |
| 147 |
add_py_test(test_fea_hyphens.py "Ambrosia.sfd" "Feature file with hyphens in glyph names") |
| 148 |
add_py_test(test_sfd_suppl_plane.py "Save TTF Names with emoji Unicode characters to SFD") |
| 149 |
add_py_test(test_fea_context_sub.py "Ambrosia.sfd" "Export contextual lookups to FEA") |
| 150 |
add_py_test(test_contextual_multirule.py "PythonAPI: contextual subtable with multiple rules") |
| 151 |
add_py_test(test_py_invalid_objs.py "Ambrosia.sfd" "Accessing invalid objects") |
| 152 |
add_py_test(test_sfnt_name.py "Ambrosia.sfd" "Testing font.appendSFNTName() function") |
| 153 |
add_py_test(test_logging.py "Sanitization of logging functions") |
| 154 |
add_py_test(test_font_mark_classes_and_sets.py "font.markClasses, font.markSets getters and setters") |
| 155 |
add_py_test(test_font_hooks.py "Set and activate Python hooks") |
| 156 |
add_py_test(test_export.py "Export referenced glyph to SVG and read text") |
| 157 |
add_py_test(test_open_zip.py "Ambrosia.sfd" "Open zipped SFD and validate metadata") |
| 158 |
add_py_test(test_italicize.py "Ambrosia.sfd" "Italicize a font with condense settings") |
| 159 |
add_py_test(test_bitmap_export.py "courB18.sfd" "Caliban.sfd" "Bitmap export in various formats and bitdepths") |
| 160 |
endif() |