2020-05-31 10:27:26 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import sys, os, subprocess, shutil
|
|
|
|
|
2020-07-04 11:42:55 +02:00
|
|
|
os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
|
2020-05-31 10:27:26 +02:00
|
|
|
|
|
|
|
git = shutil.which ('git'); assert git
|
|
|
|
make = shutil.which ('make'); assert make
|
|
|
|
java = shutil.which ('java'); assert java
|
2021-07-28 14:35:23 +02:00
|
|
|
cxx = shutil.which ('c++'); assert cxx
|
2020-05-31 10:27:26 +02:00
|
|
|
|
|
|
|
pull = False
|
|
|
|
if not os.path.exists ('aots'):
|
|
|
|
subprocess.run ([git, 'clone', 'https://github.com/adobe-type-tools/aots'], check=True)
|
|
|
|
pull = True
|
|
|
|
|
|
|
|
if pull or 'pull' in sys.argv:
|
|
|
|
subprocess.run ([git, 'pull'], cwd='aots', check=True)
|
|
|
|
subprocess.run ([make, '-C', 'aots'], check=True)
|
|
|
|
subprocess.run ([make, '-C', 'aots/harfbuzz'], check=True)
|
|
|
|
|
|
|
|
shutil.copy ('hb-aots-tester.cpp', 'aots/harfbuzz')
|
|
|
|
# TODO: remove *nix assumptions
|
2021-07-28 14:35:23 +02:00
|
|
|
subprocess.run ([cxx, '-std=c++11', '-Wno-narrowing', 'aots/harfbuzz/hb-aots-tester.cpp',
|
2020-05-31 10:27:26 +02:00
|
|
|
'../../../../src/harfbuzz.cc', '-DHB_NO_MT', '-fno-exceptions', '-lm',
|
|
|
|
'-I../../../../src', '-o', 'aots/harfbuzz/aots'], check=True)
|
|
|
|
shutil.rmtree ('tests')
|
|
|
|
os.mkdir ('tests')
|
|
|
|
subprocess.run (['./aots'], cwd='aots/harfbuzz', check=True)
|