[test] Simplify test runner

Always pass hb-shape as first argument to run-tests.py.

Also require automake 1.13.
This commit is contained in:
Behdad Esfahbod 2018-01-09 23:15:54 +01:00
parent 141db8b7a3
commit 504f913654
3 changed files with 8 additions and 35 deletions

View File

@ -9,8 +9,7 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/harfbuzz.pc.in])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.11.1 gnits tar-ustar dist-bzip2 no-dist-gzip -Wall no-define color-tests -Wno-portability])
AM_CONDITIONAL(AUTOMAKE_OLDER_THAN_1_13, test $am__api_version = 1.11 -o $am__api_version = 1.12)
AM_INIT_AUTOMAKE([1.13.0 gnits tar-ustar dist-bzip2 no-dist-gzip -Wall no-define color-tests -Wno-portability])
AM_SILENT_RULES([yes])
# Initialize libtool

View File

@ -79,22 +79,8 @@ TESTS = \
data/in-house/tests/zero-width-marks.tests \
$(NULL)
TEST_EXTENSIONS = \
.tests \
$(NULL)
TEST_EXTENSIONS = .tests
AM_TESTS_ENVIRONMENT = \
EXEEXT="$(EXEEXT)"; \
export EXEEXT; \
$(NULL)
if AUTOMAKE_OLDER_THAN_1_13
TESTS_ENVIRONMENT = \
$(AM_TESTS_ENVIRONMENT) \
$(TESTS_LOG_COMPILER) \
$(NULL)
endif
TESTS_LOG_COMPILER = $(srcdir)/run-tests.py
TESTS_LOG_COMPILER = $(srcdir)/run-tests.py $(top_builddir)/util/hb-shape$(EXEEXT)
-include $(top_srcdir)/git.mk

View File

@ -18,25 +18,13 @@ def cmd(command):
return p.stdout.read ().decode ("utf-8"), p.returncode
builddir = os.environ.get ("builddir", ".")
top_builddir = os.environ.get ("top_builddir",
os.path.normpath (os.path.join (builddir, "..", "..")))
utildir = os.environ.get ("utildir", "util")
EXEEXT = os.environ.get ("EXEEXT", "")
args = sys.argv[1:]
if not args or sys.argv[1].find('hb-shape') == -1 or not os.path.exists (sys.argv[1]):
print ("""First argument does not seem to point to usable hb-shape.""")
sys.exit (1)
hb_shape, args = args[0], args[1:]
extra_options = "--verify"
hb_shape = os.path.join (top_builddir, utildir, "hb-shape" + EXEEXT)
args = sys.argv[1:]
if not os.path.exists (hb_shape):
if len (sys.argv) == 1 or sys.argv[1].find('hb-shape') == -1 or not os.path.exists (sys.argv[1]):
print ("""Failed to find hb-shape binary automatically,
please provide it as the first argument to the tool""")
sys.exit (1)
hb_shape = args[0]
args = args[1:]
fails = 0