[tests] Replace space with colon in batch mode
This commit is contained in:
parent
2013babcbf
commit
ba810ce83d
|
@ -1,10 +1,11 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import sys, os, subprocess, hashlib, tempfile, shutil
|
import sys, os, subprocess, hashlib
|
||||||
|
|
||||||
def cmd(command):
|
def cmd(command):
|
||||||
|
print (command)
|
||||||
global process
|
global process
|
||||||
process.stdin.write ((' '.join (command) + '\n').encode ("utf-8"))
|
process.stdin.write ((':'.join (command) + '\n').encode ("utf-8"))
|
||||||
process.stdin.flush ()
|
process.stdin.flush ()
|
||||||
return process.stdout.readline().decode ("utf-8").strip ()
|
return process.stdout.readline().decode ("utf-8").strip ()
|
||||||
|
|
||||||
|
@ -97,21 +98,15 @@ for filename in args:
|
||||||
print ('%s "%s" %s %s --unicodes %s' %
|
print ('%s "%s" %s %s --unicodes %s' %
|
||||||
(hb_shape, fontfile, ' '.join(extra_options), options, unicodes))
|
(hb_shape, fontfile, ' '.join(extra_options), options, unicodes))
|
||||||
|
|
||||||
# hack to support fonts with space on run-tests.py, after several other tries...
|
|
||||||
if ' ' in fontfile:
|
|
||||||
new_fontfile = os.path.join (tempfile.gettempdir (), 'tmpfile')
|
|
||||||
shutil.copyfile(fontfile, new_fontfile)
|
|
||||||
fontfile = new_fontfile
|
|
||||||
|
|
||||||
if "--font-funcs=ft" in options and not have_freetype:
|
if "--font-funcs=ft" in options and not have_freetype:
|
||||||
skips += 1
|
skips += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "--font-funcs=ot" in options or not have_freetype:
|
if "--font-funcs=ot" in options or not have_freetype:
|
||||||
glyphs1 = cmd ([hb_shape, "--font-funcs=ot", fontfile] + extra_options + ["--unicodes", unicodes] + options)
|
glyphs1 = cmd ([hb_shape, fontfile, "--font-funcs=ot"] + extra_options + ["--unicodes", unicodes] + options)
|
||||||
else:
|
else:
|
||||||
glyphs1 = cmd ([hb_shape, "--font-funcs=ft", fontfile] + extra_options + ["--unicodes", unicodes] + options)
|
glyphs1 = cmd ([hb_shape, fontfile, "--font-funcs=ft"] + extra_options + ["--unicodes", unicodes] + options)
|
||||||
glyphs2 = cmd ([hb_shape, "--font-funcs=ot", fontfile] + extra_options + ["--unicodes", unicodes] + options)
|
glyphs2 = cmd ([hb_shape, fontfile, "--font-funcs=ot"] + extra_options + ["--unicodes", unicodes] + options)
|
||||||
|
|
||||||
if glyphs1 != glyphs2 and glyphs_expected != '*':
|
if glyphs1 != glyphs2 and glyphs_expected != '*':
|
||||||
print ("FT funcs: " + glyphs1, file=sys.stderr)
|
print ("FT funcs: " + glyphs1, file=sys.stderr)
|
||||||
|
|
|
@ -170,12 +170,15 @@ main (int argc, char **argv)
|
||||||
argc = 0;
|
argc = 0;
|
||||||
char *p = buf, *e;
|
char *p = buf, *e;
|
||||||
args[argc++] = p;
|
args[argc++] = p;
|
||||||
while ((e = strchr (p, ' ')) && argc < (int) (int) ARRAY_LENGTH (args))
|
unsigned start_offset = 0;
|
||||||
|
while ((e = strchr (p + start_offset, ':')) && argc < (int) ARRAY_LENGTH (args))
|
||||||
{
|
{
|
||||||
*e++ = '\0';
|
*e++ = '\0';
|
||||||
while (*e == ' ')
|
while (*e == ':')
|
||||||
e++;
|
e++;
|
||||||
args[argc++] = p = e;
|
args[argc++] = p = e;
|
||||||
|
/* Skip 2 first bytes on first argument if is Windows path, "C:\..." */
|
||||||
|
start_offset = argc == 2 && p[0] != '\0' && p[0] != ':' && p[1] == ':' && (p[2] == '\\' || p[2] == '/') ? 2 : 0;
|
||||||
}
|
}
|
||||||
ret |= driver.main (argc, args);
|
ret |= driver.main (argc, args);
|
||||||
fflush (stdout);
|
fflush (stdout);
|
||||||
|
|
Loading…
Reference in New Issue