Commit Graph

1858 Commits

Author SHA1 Message Date
Behdad Esfahbod 99356ea5f0
Merge pull request #3150 from harfbuzz/item-context-tests
[test] Add tests for item context
2021-08-25 17:19:06 -06:00
Behdad Esfahbod 955f86a034 [test-set] Fix compiler warnings 2021-08-24 23:16:24 -06:00
Garret Rieger f2441a4b65 [subset] Remove retain all layout features flag.
Instead use inverted sets to handle requesting all features. Modifies feature collection in subset plan to intersect the set of requested features against the features in the font. This prevents iterating a fully filled feature tag set.
2021-08-24 18:17:07 -06:00
Garret Rieger f84daccb4f [set] include null pool sets in the permutations tested by inverted_operations. 2021-08-24 16:51:11 -06:00
Garret Rieger fb07f8f876 During subset input creation check for set alloc failures and fail if encountered. 2021-08-24 10:59:14 -06:00
Khaled Hosny 33bfe9edd6 [test] Add tests for item context
Test pre-context and post-context in Arabic shaper, as well as
interaction of pre-context with BOT flag.
2021-08-24 02:12:34 +02:00
Qunxin Liu 34e0b28fae [subset] make glyph-names option match fonttools behavior
Don't encode psNames that are contained in standard glyph names set
2021-08-20 01:30:23 -06:00
Behdad Esfahbod 829b0f3353
Merge pull request #3154 from harfbuzz/set-invert
Resurrect hb_set_invert()
2021-08-20 01:28:15 -06:00
Garret Rieger 915550ab19 [set] remove inverted test TODO. 2021-08-19 17:48:38 -07:00
Garret Rieger c4ed582997 [set] add test for inverted set operations.
This test checks all possible set configurations against each operation type.
2021-08-19 17:47:41 -07:00
Garret Rieger 325fd6ddb8 [set] add tests for inverted set equality. 2021-08-19 15:54:31 -07:00
Garret Rieger 287032af6c [set] update set test TODO list. 2021-08-19 15:45:28 -07:00
Garret Rieger 5c003d80a6 [set] add tests for inverted previous iteration. 2021-08-19 15:41:12 -07:00
Garret Rieger 3f2cc582f2 [set] add basic and iteration set inverion tests. 2021-08-19 15:05:10 -07:00
Garret Rieger dc31920bbe Don't serialize null offsets in CPAL.
Fixes https://oss-fuzz.com/testcase-detail/5443213648330752
2021-08-18 16:52:45 -06:00
Garret Rieger cb05c363d7 [subset] add some basic tests for the legacy subset methods. 2021-08-14 10:37:02 -06:00
Garret Rieger 44802c8ec4 [subset] use layout-features=* for layout subsetting tests w/ synthetic test fonts. 2021-08-12 14:57:18 -06:00
Garret Rieger c0f3af91b8 [subset] speed up add_gid_and_children and adjust op limit.
Fix for fuzzer timeout: https://oss-fuzz.com/testcase-detail/5001604901240832.

- Operation limit is per glyph, so 100,000 should still be far more than needed.
- Switches from for(...) to while(...) loop for iteration. for(...) calls it.end() which in this case triggers a complete iteration.
- Cache CompositeGlyph size in the iterator to avoid needing to recalculate it.
2021-08-12 14:50:42 -06:00
Behdad Esfahbod 23282c9c9d [util/hb-subset] Support ranges in --unicodes / --unicodes-file
Fixes https://github.com/harfbuzz/harfbuzz/issues/3109
2021-08-11 22:49:47 -06:00
Behdad Esfahbod 58bfe40794 [util] Move hb-subset away from main-font-text 2021-08-11 20:12:36 -06:00
Behdad Esfahbod 3147e081da Merge branch 'main' into post-parse 2021-08-11 19:33:00 -06:00
Khaled Hosny 43722cc9f4 [test] Add some real reverse sub tests 2021-08-11 19:30:16 -06:00
Behdad Esfahbod e0d7060f80 [test] Rename shaping/ to shape/ 2021-08-11 18:49:59 -06:00
Khaled Hosny f122698810 [test] Improve generate-expected-outputs.py diff output 2021-08-12 02:02:10 +02:00
Khaled Hosny 6ac6a2b27b [test] hb_ot_layout_language_get_feature_tags() 2021-08-11 16:33:37 -06:00
Khaled Hosny e9b743b26d [test] hb_ot_layout_script_get_language_tags() 2021-08-11 16:33:37 -06:00
Khaled Hosny bf438b815f [test] hb_ot_layout_table_get_feature_tags() 2021-08-11 16:33:37 -06:00
Khaled Hosny 2f88ea5a20 [test] hb_ot_layout_table_find_script() 2021-08-11 16:33:37 -06:00
Khaled Hosny f60caad7ff [test] hb_ot_layout_table_get_script_tags() 2021-08-11 16:33:37 -06:00
Garret Rieger c08f1b8903 [map] fix incorrect population count in hash map.
If the same key was set twice the population was being incorrectly incremented.
2021-08-10 14:00:55 -06:00
Garret Rieger e39c3bde7b [subset] fix bug in parsing glyf flags.
the bytes of the flag stream were being treated as signed integers instead of unsigned as specified in the spec.
2021-08-10 12:57:07 -06:00
Behdad Esfahbod f3acb977ec [test/shaping;util] Use ';' instead of ':' to separate test fields
Accept that in --batch mode. Also in batch mode don't send the 0th arg.

Related discussion: https://github.com/harfbuzz/harfbuzz/pull/3102
2021-08-10 11:08:36 -06:00
Behdad Esfahbod b83fd3a564 [util] Refactor batch-processing code into batch.hh 2021-08-10 02:32:55 -06:00
Garret Rieger 8c0c217b5a [subset] fail reference blob in face builder if allocation for table sorting fails.
Fixes https://oss-fuzz.com/testcase-detail/5041767803125760
2021-08-06 15:54:41 -06:00
Garret Rieger c2ee1fdd40 [subset] remove unsed table_entry struct. 2021-08-05 11:47:07 -06:00
Garret Rieger dea0fe5717 [subset] discard extra copies of a table in face builder.
Fixes #2361. Stores tables in the builder in a hashmap so you end up with at most one copy of each table. Table serialization order is now based on tag sort order instead of order of insertion into the builder.
2021-08-05 11:47:07 -06:00
Garret Rieger 2c024dc3cb [subset] prune redundant cmap12 subtables.
If the post subset cmap12 table is equivalent to another cmap subtable don't include the 12 table in the final subset. Matches change https://github.com/fonttools/fonttools/pull/2146 from fontTools.
2021-08-04 17:36:24 -06:00
Khaled Hosny 84946e4d2c [test] Suggest updating the expectation if ttx matches
https://github.com/harfbuzz/harfbuzz/issues/3089#issuecomment-892208892
2021-08-04 17:35:19 -06:00
Behdad Esfahbod 5086e10538 [test] Add failing fuzzer test case
From https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36236
https://oss-fuzz.com/testcase-detail/5061207689134080
2021-08-04 11:55:53 -06:00
Khaled Hosny f698fe5aee [test] Always fail subset tests if hashes don’t match
Regardless of the pre sentience or absence of fonttools.
2021-08-04 10:26:14 -06:00
Khaled Hosny 9f544e5008 [test] Don’t skip subset tests early
Check for FontTools only when the checksums are mismatching.
2021-08-04 04:20:14 +02:00
Khaled Hosny b084153317 [test] Remove subset tests from the slow suite 2021-08-04 04:12:31 +02:00
Khaled Hosny 7ccc52b075 [test] Compare sha256 hash before TTX dumps
Most of time the files are identical, so instead of comparing the TTX
dump we can check sha256 hashes of the files first and if they match, we
don’t have to check the TTX dumps at all, making the subset tests orders
of magnitude faster.

time meson test --suite=subset down from:
real    0m19.418s
user    0m38.171s
sys     0m3.587s

to:
real	0m3.102s
user	0m8.622s
sys	0m1.701s

The expected files have been replaced by hb-subset output so they are
bit-identical where FontTools output might not.

The generate-expected-outputs.py now compares the hb-subset output with
fontttols subset and errors of they don’t match.
2021-08-04 04:10:38 +02:00
Khaled Hosny 770fbd5aa6 Revert "[test] Speed-up subset tests by saving TTX dump"
This reverts commit 278f44dcee.
2021-08-04 04:10:37 +02:00
Khaled Hosny 2cc9ed2b9e [test] More lookup_collect_glyphs() tests 2021-08-03 10:06:27 -06:00
Khaled Hosny 0664037401 [test] More lookup_collect_glyphs() tests 2021-08-03 10:06:27 -06:00
Khaled Hosny ecdd8e3f18 [test] More lookup_collect_glyphs() tests 2021-08-03 10:06:27 -06:00
Khaled Hosny f998d7e1ce [test] Add API test for lookup_collect_glyphs()
We don’t seem to have any tests exercising this API at all, and it is a
good check of GSUB/GPOS code.
2021-08-03 10:06:27 -06:00
Khaled Hosny 10e73d188a [test] Add batch mode to hb-subset and use it
time meson test --suite=subset down from:
real	0m22.822s
user	0m44.561s
sys	0m9.255s

to:
real	0m19.418s
user	0m38.171s
sys	0m3.587s

Does not seem to help much, but it is something.

Part of https://github.com/harfbuzz/harfbuzz/issues/3089
2021-08-01 22:08:28 -06:00
Khaled Hosny 1fd3a261e5 [test] Remove unused shaping tests reference mode 2021-08-01 19:38:39 +02:00