Skip to content

Commit addca15

Browse files
committedJan 7, 2014
refactor lua benchmark
1 parent b7417dc commit addca15

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed
 

‎tests/test_benchmark.py

+11-13
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ def run(self, args):
122122
# Benchmarkers
123123
benchmarkers = [
124124
#NativeBenchmarker('clang', CLANG_CC, CLANG),
125-
#NativeBenchmarker('clang-3.2', os.path.join(LLVM_3_2, 'clang'), os.path.join(LLVM_3_2, 'clang++')),
126-
#NativeBenchmarker('clang-3.3', os.path.join(LLVM_3_3, 'clang'), os.path.join(LLVM_3_3, 'clang++')),
127-
#NativeBenchmarker('clang-3.4', os.path.join(LLVM_3_4, 'clang'), os.path.join(LLVM_3_4, 'clang++')),
125+
NativeBenchmarker('clang-3.2', os.path.join(LLVM_3_2, 'clang'), os.path.join(LLVM_3_2, 'clang++')),
126+
NativeBenchmarker('clang-3.3', os.path.join(LLVM_3_3, 'clang'), os.path.join(LLVM_3_3, 'clang++')),
127+
NativeBenchmarker('clang-3.4', os.path.join(LLVM_3_4, 'clang'), os.path.join(LLVM_3_4, 'clang++')),
128128
#NativeBenchmarker('gcc', 'gcc', 'g++'),
129129
#JSBenchmarker('sm-f32', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2']),
130130
JSBenchmarker('sm-f32-3.2', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_2 }),
@@ -465,17 +465,15 @@ def test_zzz_java_nbody(self): # tests xmlvm compiled java, including bitcasts o
465465

466466
def lua(self, benchmark, expected, output_parser=None, args_processor=None):
467467
shutil.copyfile(path_from_root('tests', 'lua', benchmark + '.lua'), benchmark + '.lua')
468-
#shutil.copyfile(path_from_root('tests', 'lua', 'binarytrees.lua'), 'binarytrees.lua')
469-
#shutil.copyfile(path_from_root('tests', 'lua', 'scimark.lua'), 'scimark.lua')
470-
emcc_args = self.get_library('lua', [os.path.join('src', 'lua'), os.path.join('src', 'liblua.a')], make=['make', 'generic'], configure=None) + \
471-
['--embed-file', benchmark + '.lua']
472-
#['--embed-file', 'binarytrees.lua', '--embed-file', 'scimark.lua'] + ['--minify', '0']
473-
shutil.copyfile(emcc_args[0], emcc_args[0] + '.bc')
474-
emcc_args[0] += '.bc'
475-
native_args = self.get_library('lua_native', [os.path.join('src', 'lua'), os.path.join('src', 'liblua.a')], make=['make', 'generic'], configure=None, native=True)
476-
468+
def lib_builder(name, native, env_init):
469+
ret = self.get_library('lua', [os.path.join('src', 'lua'), os.path.join('src', 'liblua.a')], make=['make', 'generic'], configure=None, native=native, cache_name_extra=name, env_init=env_init)
470+
if native: return ret
471+
shutil.copyfile(ret[0], ret[0] + '.bc')
472+
ret[0] += '.bc'
473+
return ret
477474
self.do_benchmark('lua_' + benchmark, '', expected,
478-
force_c=True, args=[benchmark + '.lua', DEFAULT_ARG], emcc_args=emcc_args, native_args=native_args, native_exec=os.path.join('building', 'lua_native', 'src', 'lua'),
475+
force_c=True, args=[benchmark + '.lua', DEFAULT_ARG], emcc_args=['--embed-file', benchmark + '.lua'],
476+
lib_builder=lib_builder, native_exec=os.path.join('building', 'lua_native', 'src', 'lua'),
479477
output_parser=output_parser, args_processor=args_processor)
480478

481479
def test_zzz_lua_scimark(self):

0 commit comments

Comments
 (0)