Closed isbadawi closed 10 years ago
n.b. I only did cursory testing of this, since e.g. I don't have emscripten installed, and I am on OS X.
Use a lab machine to make sure it works on Linux (you can just test with JavaScript).
Besides the small bug and some stylistic mishaps, this looks good.
Ah yes, sorry! I think I ended up not testing this since it failed before that because of emscripten. I tested the C path. I've updated the commit.
I tried testing just JavaScript but it looks like I can't; running make
fails because of the missing emcc
before generating the plain JS html files.
Summary of changes:
OsxEnvironment
andLinuxEnvironment
classes, each providing aprovision_browser(browser, url)
context manager, which are passed intoBenchmark
.cd()
context manager onBenchmark
, allowing you to writewith self.cd():
run_c_benchmark
andrun_js_benchmark
into generatorsoptparse
allows you to set defaults, and a%default
placeholder in the help text expands to the default value. (Also removed global variables, instead passing options where they need to go).n.b. I use dicts for specifying benchmarks and environments where previously lists were used, so order is not necessarily preserved. If this matters to you, you should use
collections.OrderedDict
s instead.n.b. I only did cursory testing of this, since e.g. I don't have emscripten installed, and I am on OS X.