[test] Don’t test against system fonts
This might once have been a good idea, but it is such an unreliable
thing to have by default.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index dfee70f..95948e2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -27,10 +27,6 @@
if: matrix.os == 'windows-latest'
run: rm.exe "c:/windows/system32/bash.exe"
- - name: Ubuntu Setup
- if: matrix.os == 'ubuntu-latest'
- run: sudo apt-get install fonts-inconsolata fonts-takao-gothic fonts-takao-mincho fonts-takao-pgothic
-
- name: MSVC Setup
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
diff --git a/meson.build b/meson.build
index a58447e..b3c9e3d 100644
--- a/meson.build
+++ b/meson.build
@@ -193,10 +193,8 @@
install: true,
)
install_man('docs/ots-idempotent.1')
- test_good_fonts = find_program('tests/test_good_fonts.sh')
test('test_good_fonts',
- test_good_fonts,
- timeout: 9999,
+ find_program('tests/test_good_fonts.sh'),
env: [
'top_srcdir=@0@'.format(meson.current_source_dir()),
'top_builddir=@0@'.format(meson.current_build_dir()),
@@ -278,7 +276,7 @@
test('test_fuzzed_fonts',
find_program('tests/test_fuzzed_fonts.sh'),
- timeout: 9999,
+ timeout: 120,
env: [
'top_srcdir=@0@'.format(meson.current_source_dir()),
'top_builddir=@0@'.format(meson.current_build_dir()),
diff --git a/tests/BLOCKLIST.txt b/tests/BLOCKLIST.txt
deleted file mode 100644
index 7f4180e..0000000
--- a/tests/BLOCKLIST.txt
+++ /dev/null
@@ -1,138 +0,0 @@
-# Required table(s) are missing.
-Gungseouche.ttf
-HeadlineA.ttf
-LastResort.ttf
-LastResort.otf
-NISC18030.ttf
-PCmyoungjo.ttf
-Pilgiche.ttf
-
-# Bad vhea version 10001.
-AppleGothic.ttf
-AppleMyungjo.ttf
-
-# cmap: Range glyph reference too high
-InaiMathi.ttf
-
-# The length field of a table is weird.
-homa.ttf
-nazli.ttf
-titr.ttf
-ume-tgc4.ttf
-ume-tgs4.ttf
-ume-tgc5.ttf
-ume-tgs5.ttf
-ume-tms3.ttf
-
-# Table(s) are not 4-byte aligned.
-UnBatang.ttf
-UnBom.ttf
-UnDotum.ttf
-UnGraphic.ttf
-UnGungseo.ttf
-UnJamoBatang.ttf
-UnJamoDotum.ttf
-UnJamoNovel.ttf
-UnJamoSora.ttf
-UnPenheulim.ttf
-UnPen.ttf
-UnPilgiBold.ttf
-UnPilgi.ttf
-UnShinmun.ttf
-UnTaza.ttf
-UnYetgul.ttf
-
-# Tables are not sorted by table tags.
-f500.ttf
-
-# Malformed SFNT table; unexpected entry selector
-misakimn.ttf
-misaki.ttf
-
-# Malformed CMAP table; Subtables are not sorted by platform ID
-ani.ttf
-Caliban.ttf
-
-# Malformed CMAP table; Entries in a 3-0-4 or 3-1-4 subtable are not sorted.
-LucidaSansOblique.ttf
-LucidaTypewriterOblique.ttf
-bkai00mp.ttf
-bsmi00lp.ttf
-modelwor.ttf
-
-# Malformed CMAP table; "search range" in a 3-0-4 or 3-1-4 subtable are invalid.
-cmmi10.ttf
-cmsy10.ttf
-msam10.ttf
-
-# Malformed CMAP table; The 3-10-12 table is too short.
-BPG_Chveulebrivi.ttf
-BPG_Chveulebrivi_bold.ttf
-
-# No supported cmap subtable found
-Apple Chancery.ttf
-Apple Color Emoji.ttf
-Apple Symbols.ttf
-BigCaslon.ttf
-DroidSansFallback.ttf
-DroidSansJapanese.ttf
-华文宋体.ttf
-华文楷体.ttf
-Apple Symbols.ttc
-
-# Malformed HMTX table; The table is too short.
-mona.ttf
-
-# CMAP glyph id is out of range.
-Chalkduster.ttf
-Diwan Thuluth.ttf
-Optima.ttc
-Osaka.ttf
-OsakaMono.ttf
-Samyak-Oriya.ttf
-ZapfDingbats.ttf
-
-# Unsupported CFF table; "supplemental encoding" is not supported at the moment. This should be fixed in the future.
-Walbf___.otf
-
-# GDEF MarkAttachClassDef offset is invalid.
-ManchuFont.ttf
-arianamu.ttf
-summersby.ttf
-
-# Bad glyph flag
-DroidSansFallbackFull.ttf
-Skia.ttf
-
-# incorrect entrySelector for table directory
-NanumMyeongjo.ttf
-NanumMyeongjoBold.ttf
-
-# CFF parsing failure.
-Yu Gothic Bold.otf
-Yu Gothic Medium.otf
-YuppySC-Regular.otf
-YuppyTC-Regular.otf
-
-# XXX: check why those are failing
-SagarNormal.ttf
-oriya.ttf
-GohaTibebZemen.ttf
-malayalam.ttf
-AkaashNormal.ttf
-
-# XXX check those Apple fonts too
-Arial Unicode.ttf
-Damascus.ttc
-Didot.ttc
-Iowan Old Style.ttc
-Phosphate.ttc
-Seravek.ttc
-Shree714.ttc
-AquaKana.ttc
-
-# Failed to sanitize previous output!
-LucidaGrande.ttc
-
-# FFTM: misaligned table
-wqy-microhei.ttc
diff --git a/tests/test_bad_fonts.sh b/tests/test_bad_fonts.sh
index 12f3c6f..5710449 100755
--- a/tests/test_bad_fonts.sh
+++ b/tests/test_bad_fonts.sh
@@ -20,7 +20,7 @@
if [ $# -eq 0 ] ; then
# No font file is specified. Apply this script to all TT/OT files under the
# BASE_DIR.
- if [ ! -d $BASE_DIR ] ; then
+ if [ ! -d "$BASE_DIR" ] ; then
echo "$BASE_DIR does not exist."
exit 1
fi
@@ -50,11 +50,10 @@
# Confirm that the bad font file is rejected by OTS.
$CHECKER "$1" 2>&1
-RET=$?
-if [ $RET != 0 ]; then
- echo "PASSED: $1"
- exit 0
-else
+if [ $? = 0 ]; then
echo "FAILED: $1"
exit 1
+else
+ echo "PASSED: $1"
+ exit 0
fi
diff --git a/tests/test_good_fonts.sh b/tests/test_good_fonts.sh
index 8b786bd..240cf80 100755
--- a/tests/test_good_fonts.sh
+++ b/tests/test_good_fonts.sh
@@ -10,50 +10,26 @@
# Usage: ./test_good_fonts.sh [ttf_or_otf_file_name]
BASE_DIR=$top_srcdir/tests/fonts/good/
-BLOCKLIST=$top_srcdir/tests/BLOCKLIST.txt
CHECKER=$top_builddir/ots-idempotent$EXEEXT
-if [ ! -r "$BLOCKLIST" ] ; then
- echo "$BLOCKLIST is not found."
- exit 1
-fi
-
if [ ! -x "$CHECKER" ] ; then
echo "$CHECKER is not found."
exit 1
fi
if [ $# -eq 0 ] ; then
- # No font file is specified. Apply this script to all TT/OT files we can find
- # on the system.
-
+ # No font file is specified. Apply this script to all TT/OT files under the
+ # BASE_DIR.
if [ ! -d "$BASE_DIR" ] ; then
echo "$BASE_DIR does not exist."
exit 1
fi
- if [ x"$FONTS" = x ];
- then
- # Mac OS X
- FONTS=$"$FONTS"$'\n'"$(find /System/Library/Fonts/ -type f -name '*tf' -o -name '*tc')"
- fi
-
-
- if [ x"$FONTS" = x ] && $(command fc-list &>/dev/null);
- then
- echo $FONTS
- CFF=$(fc-list --format="%{file}\n" :fontformat=CFF | sort -u)
- TTF=$(fc-list --format="%{file}\n" :fontformat=TrueType | sort -u)
- FONTS="$FONTS"$'\n'"$CFF"$'\n'"$TTF"
- fi
-
- FONTS="$FONTS"$'\n'"$(find $BASE_DIR -type f)"
-
+ FONTS=$(find $BASE_DIR -type f)
# Recursively call this script.
FAILS=0
IFS=$'\n'
for f in $FONTS; do
- if [[ $f == *.dfont ]]; then continue; fi # Ignore .dfont’s
$0 "$f"
FAILS=$((FAILS+$?))
done
@@ -72,17 +48,12 @@
exit 1
fi
-# Check the font file using idempotent if the font is not blacklisted.
-BASE=`basename "$1"`
-SKIP=`egrep -i -e "^$BASE" "$BLOCKLIST"`
-
-if [ "x$SKIP" = "x" ]; then
- $CHECKER "$1" 2>&1
- RET=$?
- if [ $RET != 0 ]; then
- echo "FAILED: $1"
- else
- echo "PASSED: $1"
- fi
- exit $RET
+# Confirm that the good font file is accepted by OTS.
+$CHECKER "$1" 2>&1
+if [ $? != 0 ]; then
+ echo "FAILED: $1"
+ exit 1
+else
+ echo "PASSED: $1"
+ exit 0
fi