test/shaping/data/in-house/Makefile.sources  |    2 
 test/shaping/data/in-house/tests/macos.tests |    2 
 test/shaping/run-tests.py                    |   61 ++++++++++++++++-----------
 3 files changed, 41 insertions(+), 24 deletions(-)

New commits:
commit ea9512e61a7ed333b810918e74cce4c8bd2291b9
Author: Behdad Esfahbod <beh...@behdad.org>
Date:   Sat Nov 24 15:49:33 2018 -0500

    [tests] Redo test runner logging a  bit

diff --git a/test/shaping/run-tests.py b/test/shaping/run-tests.py
index 4c7fee1e..959d08f9 100755
--- a/test/shaping/run-tests.py
+++ b/test/shaping/run-tests.py
@@ -27,7 +27,7 @@ process = subprocess.Popen ([hb_shape, '--batch'],
                            stdout=subprocess.PIPE,
                            stderr=sys.stdout)
 
-ran_once = False
+passes = 0
 fails = 0
 skips = 0
 
@@ -69,13 +69,13 @@ for filename in args:
                                with open (fontfile, 'rb') as ff:
                                        actual_hash = hashlib.sha1 
(ff.read()).hexdigest ().strip ()
                                        if actual_hash != expected_hash:
-                                               print ('different versions of 
the font is found, expected %s hash was %s but got %s, skip' %
+                                               print ('different version of %s 
found; Expected hash %s, got %s; skipping.' %
                                                           (fontfile, 
expected_hash, actual_hash))
-                                               skips = skips + 1
+                                               skips += 1
                                                continue
                        except:
-                               print ('%s is not found, skip.' % fontfile)
-                               skips = skips + 1
+                               print ('%s not found, skip.' % fontfile)
+                               skips += 1
                                continue
                else:
                        cwd = os.path.dirname(filename)
@@ -108,12 +108,12 @@ for filename in args:
                        fontfile] + extra_options + ["--unicodes",
                        unicodes] + (options.split (' ') if options else []))
 
-               ran_once = True
-
                if glyphs1 != glyphs2 and glyphs_expected != '*':
                        print ("FT funcs: " + glyphs1) # file=sys.stderr
                        print ("OT funcs: " + glyphs2) # file=sys.stderr
-                       fails = fails + 1
+                       fails += 1
+               else:
+                       passes += 1
 
                if reference:
                        print (":".join ([fontfile, options, unicodes, 
glyphs1]))
@@ -122,18 +122,20 @@ for filename in args:
                if glyphs1.strip() != glyphs_expected and glyphs_expected != 
'*':
                        print ("Actual:   " + glyphs1) # file=sys.stderr
                        print ("Expected: " + glyphs_expected) # file=sys.stderr
-                       fails = fails + 1
+                       fails += 1
+               else:
+                       passes += 1
 
-if fails != 0 or skips != 0:
-       if not reference:
-               print ("%d tests are failed and %d tests are skipped." % 
(fails, skips)) # file=sys.stderr
-       if fails != 0:
-               sys.exit (1)
-       sys.exit (77)
-else:
-       if not ran_once:
-               if not reference:
-                       print ("No tests ran.")
-               sys.exit (77)
-       elif not reference:
+if not reference:
+       print ("%d tests passed; %d failed; %d skipped." % (passes, fails, 
skips)) # file=sys.stderr
+       if not (fails + passes):
+               print ("No tests ran.")
+       elif not (fails + skips):
                print ("All tests passed.")
+
+if fails:
+       sys.exit (1)
+elif passes:
+       sys.exit (0)
+else:
+       sys.exit (77)
commit 5020affc3877d39377506245ecaf01a659eef82a
Author: Behdad Esfahbod <beh...@behdad.org>
Date:   Sat Nov 24 15:42:11 2018 -0500

    [tests] Minor

diff --git a/test/shaping/data/in-house/tests/macos.tests 
b/test/shaping/data/in-house/tests/macos.tests
index 6841ef93..4788f256 100644
--- a/test/shaping/data/in-house/tests/macos.tests
+++ b/test/shaping/data/in-house/tests/macos.tests
@@ -1,3 +1,5 @@
+
+# 10.12:
 /Library/Fonts/Khmer 
MN.ttc@5f5b1072df99b7355d3066ea85fe82969d13c94a::U+17A2,U+1780,U+17D2,U+179F,U+179A,U+1781,U+17D2,U+1798,U+17C2,U+179A:[km_qa=0+1025|km_ka=1+1025|km_sa.sub=1+517|km_ro=4+593|km_vs_ae=5+605|km_kha=5+1025|km_mo.sub=5+0|km_ro=9+593]
 /Library/Fonts/Tamil 
MN.ttc@37a2020c3f86ebcc45e02c1de5fdf81e2676989d::U+0BA4,U+0BCA,U+0B95,U+0BC1,U+0B95,U+0BCD,U+0B95,U+0BAA,U+0BCD,U+0BAA,U+0B9F,U+0BCD,U+0B9F,U+0BC1:[tgm_e=0+1702|tgc_ta=0+1598|tgm_aa=0+1074|tgc_ka=2@-74,0+1518|tgm_u=2+1205|tgc_ka=4+1592|tgm_pulli=4+503|tgc_ka=6+1592|tgc_pa=7+1370|tgm_pulli=7+503|tgc_pa=9+1370|tgc_tta=10+1566|tgm_pulli=10+503|tgc_tta=12+1566|tgm_u=12+1205]
 
/System/Library/Fonts/Times.dfont@39c954614d3f3317b28564db06d5b7b7a6ff0e39::U+0041,U+0066,U+0300,U+0066,U+0069,U+005A:[A=0+1479|f=1+682|gravecmb=1@-480,588+0|fi=3+1139|Z=5+1251]
commit ee3a3e10d45f5df1a74b65fbe3df77f8dd8f902e
Author: Behdad Esfahbod <beh...@behdad.org>
Date:   Sat Nov 24 15:37:01 2018 -0500

    [tests/shaping] Allow comments in test files
    
    Line should start with "# ".

diff --git a/test/shaping/run-tests.py b/test/shaping/run-tests.py
index c22d45c4..4c7fee1e 100755
--- a/test/shaping/run-tests.py
+++ b/test/shaping/run-tests.py
@@ -47,6 +47,20 @@ for filename in args:
                f = open (filename)
 
        for line in f:
+               comment = False
+               if line.startswith ("#"):
+                       comment = True
+                       line = line[1:]
+
+                       if line.startswith (' '):
+                               if not reference:
+                                       print ("#%s" % line)
+                               continue
+
+               line = line.strip ()
+               if not line:
+                       continue
+
                fontfile, options, unicodes, glyphs_expected = line.split (":")
                if fontfile.startswith ('/') or fontfile.startswith ('"/'):
                        fontfile, expected_hash = fontfile.split('@')
@@ -68,11 +82,10 @@ for filename in args:
                        fontfile = os.path.normpath (os.path.join (cwd, 
fontfile))
 
                extra_options = ["--shaper=ot"]
-               glyphs_expected = glyphs_expected.strip()
                if glyphs_expected != '*':
                        extra_options.append("--verify")
 
-               if line.startswith ("#"):
+               if comment:
                        if not reference:
                                print ("# %s %s --unicodes %s" % (hb_shape, 
fontfile, unicodes))
                        continue
commit ed900ee9afa0dabdbf6bf9d2af46c2343a16773f
Author: Behdad Esfahbod <beh...@behdad.org>
Date:   Sat Nov 24 15:22:09 2018 -0500

    [tests] Rename

diff --git a/test/shaping/data/in-house/Makefile.sources 
b/test/shaping/data/in-house/Makefile.sources
index 209de079..d548e961 100644
--- a/test/shaping/data/in-house/Makefile.sources
+++ b/test/shaping/data/in-house/Makefile.sources
@@ -33,7 +33,7 @@ TESTS = \
        tests/khmer-misc.tests \
        tests/language-tags.tests \
        tests/ligature-id.tests \
-       tests/macos-10.12.tests \
+       tests/macos.tests \
        tests/mark-attachment.tests \
        tests/mark-filtering-sets.tests \
        tests/mongolian-variation-selector.tests \
diff --git a/test/shaping/data/in-house/tests/macos-10.12.tests 
b/test/shaping/data/in-house/tests/macos.tests
similarity index 100%
rename from test/shaping/data/in-house/tests/macos-10.12.tests
rename to test/shaping/data/in-house/tests/macos.tests
_______________________________________________
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Reply via email to