diff options
Diffstat (limited to 'scripts/gen_run_tests.py')
-rwxr-xr-x | scripts/gen_run_tests.py | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/scripts/gen_run_tests.py b/scripts/gen_run_tests.py index a414f81..7c3075f 100755 --- a/scripts/gen_run_tests.py +++ b/scripts/gen_run_tests.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys from itertools import combinations @@ -14,14 +14,14 @@ nparallel = cpu_count() * 2 uname = uname()[0] -if "BSD" in uname: +if call("command -v gmake", shell=True) == 0: make_cmd = 'gmake' else: make_cmd = 'make' def powerset(items): result = [] - for i in xrange(len(items) + 1): + for i in range(len(items) + 1): result += combinations(items, i) return result @@ -41,6 +41,7 @@ possible_config_opts = [ '--enable-prof', '--disable-stats', '--enable-opt-safety-checks', + '--with-lg-page=16', ] if bits_64: possible_config_opts.append('--with-lg-vaddr=56') @@ -52,19 +53,20 @@ possible_malloc_conf_opts = [ 'background_thread:true', ] -print 'set -e' -print 'if [ -f Makefile ] ; then %(make_cmd)s relclean ; fi' % {'make_cmd': make_cmd} -print 'autoconf' -print 'rm -rf run_tests.out' -print 'mkdir run_tests.out' -print 'cd run_tests.out' +print('set -e') +print('if [ -f Makefile ] ; then %(make_cmd)s relclean ; fi' % {'make_cmd': + make_cmd}) +print('autoconf') +print('rm -rf run_tests.out') +print('mkdir run_tests.out') +print('cd run_tests.out') ind = 0 for cc, cxx in possible_compilers: for compiler_opts in powerset(possible_compiler_opts): for config_opts in powerset(possible_config_opts): for malloc_conf_opts in powerset(possible_malloc_conf_opts): - if cc is 'clang' \ + if cc == 'clang' \ and '-m32' in possible_compiler_opts \ and '--enable-prof' in config_opts: continue @@ -79,9 +81,9 @@ for cc, cxx in possible_compilers: ) # We don't want to test large vaddr spaces in 32-bit mode. - if ('-m32' in compiler_opts and '--with-lg-vaddr=56' in - config_opts): - continue + if ('-m32' in compiler_opts and '--with-lg-vaddr=56' in + config_opts): + continue # Per CPU arenas are only supported on Linux. linux_supported = ('percpu_arena:percpu' in malloc_conf_opts \ @@ -92,7 +94,7 @@ for cc, cxx in possible_compilers: if (uname == 'Linux' and linux_supported) \ or (not linux_supported and (uname != 'Darwin' or \ not darwin_unsupported)): - print """cat <<EOF > run_test_%(ind)d.sh + print("""cat <<EOF > run_test_%(ind)d.sh #!/bin/sh set -e @@ -120,7 +122,9 @@ run_cmd %(make_cmd)s all tests run_cmd %(make_cmd)s check run_cmd %(make_cmd)s distclean EOF -chmod 755 run_test_%(ind)d.sh""" % {'ind': ind, 'config_line': config_line, 'make_cmd': make_cmd} +chmod 755 run_test_%(ind)d.sh""" % {'ind': ind, 'config_line': config_line, + 'make_cmd': make_cmd}) ind += 1 -print 'for i in `seq 0 %(last_ind)d` ; do echo run_test_${i}.sh ; done | xargs -P %(nparallel)d -n 1 sh' % {'last_ind': ind-1, 'nparallel': nparallel} +print('for i in `seq 0 %(last_ind)d` ; do echo run_test_${i}.sh ; done | xargs' + ' -P %(nparallel)d -n 1 sh' % {'last_ind': ind-1, 'nparallel': nparallel}) |