Skip to content

Commit 6344b5c

Browse files
committed
make benchmark suite more robust to settings changes
1 parent 2fd4cb8 commit 6344b5c

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

tests/test_benchmark.py

+22-15
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,26 @@ def run(self, args):
119119
return run_js(self.filename, engine=self.engine, args=args, stderr=PIPE, full_output=True)
120120

121121
# Benchmarkers
122-
benchmarkers = [
123-
#NativeBenchmarker('clang', CLANG_CC, CLANG),
124-
NativeBenchmarker('clang-3.2', os.path.join(LLVM_3_2, 'clang'), os.path.join(LLVM_3_2, 'clang++')),
125-
#NativeBenchmarker('clang-3.3', os.path.join(LLVM_3_3, 'clang'), os.path.join(LLVM_3_3, 'clang++')),
126-
#NativeBenchmarker('clang-3.4', os.path.join(LLVM_3_4, 'clang'), os.path.join(LLVM_3_4, 'clang++')),
127-
#NativeBenchmarker('gcc', 'gcc', 'g++'),
128-
JSBenchmarker('sm-f32', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2']),
129-
#JSBenchmarker('sm-f32-3.2', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_2 }),
130-
#JSBenchmarker('sm-f32-3.3', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_3 }),
131-
#JSBenchmarker('sm-f32-3.4', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_4 }),
132-
#JSBenchmarker('sm-fc', SPIDERMONKEY_ENGINE, env={ 'EMCC_FAST_COMPILER': '1' }),
133-
#JSBenchmarker('sm-noasm', SPIDERMONKEY_ENGINE + ['--no-asmjs']),
134-
#JSBenchmarker('sm-noasm-f32', SPIDERMONKEY_ENGINE + ['--no-asmjs'], ['-s', 'PRECISE_F32=2']),
135-
#JSBenchmarker('v8', V8_ENGINE)
136-
]
122+
try:
123+
benchmarkers_error = ''
124+
benchmarkers = [
125+
#NativeBenchmarker('clang', CLANG_CC, CLANG),
126+
NativeBenchmarker('clang-3.2', os.path.join(LLVM_3_2, 'clang'), os.path.join(LLVM_3_2, 'clang++')),
127+
#NativeBenchmarker('clang-3.3', os.path.join(LLVM_3_3, 'clang'), os.path.join(LLVM_3_3, 'clang++')),
128+
#NativeBenchmarker('clang-3.4', os.path.join(LLVM_3_4, 'clang'), os.path.join(LLVM_3_4, 'clang++')),
129+
#NativeBenchmarker('gcc', 'gcc', 'g++'),
130+
JSBenchmarker('sm-f32', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2']),
131+
#JSBenchmarker('sm-f32-3.2', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_2 }),
132+
#JSBenchmarker('sm-f32-3.3', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_3 }),
133+
#JSBenchmarker('sm-f32-3.4', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_4 }),
134+
#JSBenchmarker('sm-fc', SPIDERMONKEY_ENGINE, env={ 'EMCC_FAST_COMPILER': '1' }),
135+
#JSBenchmarker('sm-noasm', SPIDERMONKEY_ENGINE + ['--no-asmjs']),
136+
#JSBenchmarker('sm-noasm-f32', SPIDERMONKEY_ENGINE + ['--no-asmjs'], ['-s', 'PRECISE_F32=2']),
137+
#JSBenchmarker('v8', V8_ENGINE)
138+
]
139+
except Exception, e:
140+
benchmarkers_error = str(e)
141+
benchmarkers = []
137142

138143
class benchmark(RunnerCore):
139144
save_dir = True
@@ -171,6 +176,8 @@ def setUpClass(self):
171176
Building.COMPILER_TEST_OPTS = []
172177

173178
def do_benchmark(self, name, src, expected_output='FAIL', args=[], emcc_args=[], native_args=[], shared_args=[], force_c=False, reps=TEST_REPS, native_exec=None, output_parser=None, args_processor=None, lib_builder=None):
179+
if len(benchmarkers) == 0: raise Exception('error, no benchmarkers: ' + benchmarkers_error)
180+
174181
args = args or [DEFAULT_ARG]
175182
if args_processor: args = args_processor(args)
176183

0 commit comments

Comments
 (0)