summaryrefslogtreecommitdiff
path: root/tests/test-layout.c
Commit message (Collapse)AuthorAgeFilesLines
* test-layout: Make --fonts work as expectedMatthias Clasen2021-11-291-2/+5
| | | | We want to use this without initializing tests.
* tests: Fix font setup for EmojiMatthias Clasen2021-11-261-6/+5
| | | | We need to copy the scale hack for bitmaps.
* test-layout: Fix up comparison directionMatthias Clasen2021-11-251-1/+1
| | | | This makes more sense.
* test-layout: Use an fc fontmapMatthias Clasen2021-11-251-1/+13
| | | | | | | Our new, more precise font checks rely on data from fontconfig to identify fonts uniquely. So make sure that we use a custom fc fontmap, if we have one.
* Make test-layout use included fontsMatthias Clasen2021-11-251-51/+59
| | | | | | | | | Add Cantarell, DejaVu Sans and a subset of Noto Color Emoji to git, and make test-layout use just those fonts. This should help with keeping the ci from breaking due to different system fonts. Update tests.
* test-layout: Drop the --show-font optionMatthias Clasen2021-11-241-6/+0
| | | | Not used anymore.
* Update test-layoutMatthias Clasen2021-11-241-254/+32
| | | | | | Use the new output serialization in test-layout to store both the input and output in the same file.
* Add flags to serialize and deserializeMatthias Clasen2021-11-241-1/+1
| | | | | | | This gives us some room to add more things to these apis, e.g. a way to store not just the input part of a layout, but also the output.
* Make test-layout use layout serializationMatthias Clasen2021-11-181-259/+18
| | | | | Now that we have this api, lets use it for our tests.
* test-layout: Add a --show-fonts optionbaseline-shiftMatthias Clasen2021-08-311-0/+15
| | | | A bit more natural than the environment variable.
* test-layout: Disable fragile checksMatthias Clasen2021-08-311-175/+0
| | | | | | | I added these for improved coverage, but they get in the way, Should probably just move these kind of checks to another place and leave this test focused on dumps.
* tests: Only print known analysis flagsMatthias Clasen2021-08-281-1/+5
| | | | We're going to steal one bit for private purposes.
* Remove some check from test-layoutMatthias Clasen2021-08-101-18/+4
| | | | | | | Some of these aren't reliable, and were only added for test coverage. Fixes: #576
* Small correction to test-layoutMatthias Clasen2021-08-061-1/+8
| | | | | We need to apply trailing properly, by skipping characters.
* itemize: Ignore width in horizontal contextignore-width-in-horizontal2Matthias Clasen2021-08-031-0/+14
| | | | | | | | | Changes in width only need to break runs in vertical context. Update tests and add a new test. Fixes: #503
* Try harder to skip tests on MacOsMatthias Clasen2021-07-211-0/+24
| | | | | | For tests where the wrong fonts break things, check that we have Cantarell, and skip them if not.
* tests: Fix an assertionMatthias Clasen2021-07-211-3/+4
| | | | | We were rounding things differently, giving us off-by-one errors on MacOs.
* tests: Locale handling fixesMatthias Clasen2021-07-211-4/+6
| | | | | The return value of setlocale is only good until the next call. Also, consistently use en_US.UTF-8.
* Quiet another compiler warningMatthias Clasen2021-07-101-1/+1
|
* tests: Add a way to show fonts in test-layoutMatthias Clasen2021-07-101-1/+5
| | | | | | | This is sometimes useful, even if we want to avoid it in ci. So add an environment variable, PANGO_TEST_SHOW_FONT to make it show the actual font instead of 'OMITTED'.
* tests: Add more glyph item testsMatthias Clasen2021-07-061-0/+30
|
* tests: Check more layout propertiesMatthias Clasen2021-07-061-29/+395
| | | | | | | | Allow setting more layout properties in test-layout, and check their values after setting them. Also print out directions and cursor positions. Update existing tests, and add more.
* tests: Avoid extraneous markup in outputMatthias Clasen2021-05-081-1/+1
| | | | | | When using test-layout FILE to generate expected output, we don't want to prepend an extraneous '#' to every line.
* Revert "testsuite: Don't use g_test_skip"Simon McVittie2021-01-031-3/+0
| | | | | | | | | | | When versions of Meson with bug https://github.com/mesonbuild/meson/issues/7515 are no longer widespread, the Pango test suite should diagnose which tests are skipped again. Versions 0.55.0 to 0.55.2 inclusive have the bug; version 0.55.3 is OK. This reverts commit 440f9c2609b7f5f9d8f65619b029a5eb660de88b. Signed-off-by: Simon McVittie <smcv@debian.org>
* Merge branch 'matthiasc/for-master' into 'master'Matthias Clasen2020-09-171-3/+5
|\ | | | | | | | | misc fixes See merge request GNOME/pango!242
| * Make test-layout work for generating data againMatthias Clasen2020-09-171-3/+8
| | | | | | | | This was broken in f6032b754fd76ebbf0ae6.
* | tests: Fix memory leaksMatthias Clasen2020-09-121-1/+1
| | | | | | | | These were showing up as errors from lsan.
* | tests: Make test-layout work standaloneMatthias Clasen2020-09-121-0/+3
|/ | | | This broke when I recently reshuffled things.
* testsuite: Don't use g_test_skipMatthias Clasen2020-07-301-0/+3
| | | | | | | meson 0.55 considers tests using it to be FAIL. I disagree, but lets quietly skip until 0.55.1 is available.
* tests: Update the locale useEmmanuele Bassi2020-06-081-3/+4
| | | | | Create the PangoContext for the test after resetting the locale, and use the en_US.utf8 name, as it seems to be the name used by Fedora.
* tests: Ensure we respect the TAP output formatEmmanuele Bassi2020-06-081-3/+11
| | | | | When dumping the diff between the computed and expected results, we need to respect the TAP format and place "#" in front of each line.
* Skip layout tests if the en_US locale is not availableEmmanuele Bassi2020-06-081-3/+12
| | | | | There's no point in running a tests if we know the locale isn't there. The reason gets logged, so the developer can decide to install it.
* tests: Use the appropriate GTest APIEmmanuele Bassi2020-04-141-8/+5
| | | | | | | | Do not use homegrown assertion and failure macros, when GTest has perfectly functional API to deal with all the cases Pango covers. Using GTest also allows us to rely on appropriate formatting for results and logging.
* test-layout: Be robust against odd runsMatthias Clasen2019-07-141-16/+4
| | | | | This causes some changes in the output. Update expected output.
* Some test updatesMatthias Clasen2019-07-141-4/+4
| | | | | Share the attribute printing code between all the tests, update expected output to match.
* layout test: Use a better localeMatthias Clasen2019-06-031-1/+2
| | | | | We need to use a Unicode locale in order to test Emoji and similar glyphs.
* Revert "Replace PangoScript by GUnicodeScript"Michael Catanzaro2019-05-271-1/+1
| | | This reverts commit 3e754defc364a89b2136894399b3463976840156
* Replace PangoScript by GUnicodeScriptMatthias Clasen2019-05-251-1/+1
| | | | | | | | | This commit replaces the PangoScript enum by a typedef to GUnicodeScript, and preserves the old enum values as defines. This depends on adding an enum type for GUnicodeScript in gobject.
* Restore scaling of CoreText fonts.John Ralls2018-05-081-10/+1
| | | | Fixes bug 787867.
* CoreText: Remove absolute size and scaling to screen resolution.John Ralls2017-08-151-1/+10
| | | | | | | | | | | | | Cairo's CGFont backend already handles scaling fonts to the display resolution, so scaling to the screen screen resolution in Pango's CoreText backend generates double-sized text on a Retina display. The layout test depended on providing a (bogus) resolution of 96DPI and scaling the font to it in order to obtain the "expected" layout results. This is replaced by adjusting the font size in test-layout.c if Pango is compiled for CoreText. https://bugzilla.gnome.org/show_bug.cgi?id=782393
* tests: Don't include unistd.h unconditionallyChun-wei Fan2017-08-081-1/+4
| | | | | | | Don't include unistd.h on Windows, and include io.h if necessary, as Windows compilers may not ship with it. https://bugzilla.gnome.org/show_bug.cgi?id=783274
* Silence a few coverity warningsMatthias Clasen2015-07-171-1/+3
| | | | | | | coverity says: Using uninitialized value "index2". It didn't notice that the only time we can reach the index = index2 assignment with index2 still uninitialized is when we are never going to look at index again.
* Split out some test functionsMatthias Clasen2015-03-131-169/+7
| | | | These will be reused later.
* Don't compare fonts in the layout testMatthias Clasen2014-09-191-1/+1
| | | | | For some reason (that I haven't been able to track down), this fails in the installed tests on build.gnome.org.
* Try to fix the test on build.gnome.orgMatthias Clasen2014-09-061-4/+6
| | | | | | For some reason, the test-layout test does not show the font size when run on build.gnome.org. Try harder to make it use the Cantarell 11 font that I want it to use.
* test-layout: Better error reportingMatthias Clasen2014-09-031-8/+62
| | | | | Run diff over the output to give a meaningful error if the comparison fails.
* Add tests for PangoLayoutMatthias Clasen2014-08-301-0/+487
This tests works similar to the markup parser tests - we populate a layout with known data, and then compare a dump of its properties with expected output.