[oden] Grab my incomplete QuickJS wrapper
This commit is contained in:
parent
aa70df41a3
commit
898b1fe129
114 changed files with 244181 additions and 0 deletions
42
oden-js-sys/quickjs/tests/bench-v8/run_harness.js
Normal file
42
oden-js-sys/quickjs/tests/bench-v8/run_harness.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* run_harness.js */
|
||||
var print = console.log;
|
||||
|
||||
function Run() {
|
||||
BenchmarkSuite.RunSuites({ NotifyStep: ShowProgress,
|
||||
NotifyError: AddError,
|
||||
NotifyResult: AddResult,
|
||||
NotifyScore: AddScore });
|
||||
}
|
||||
|
||||
var harnessErrorCount = 0;
|
||||
|
||||
function ShowProgress(name) {
|
||||
print('PROGRESS', name);
|
||||
}
|
||||
|
||||
function AddError(name, error) {
|
||||
print('ERROR', name, error);
|
||||
print(error.stack);
|
||||
harnessErrorCount++;
|
||||
}
|
||||
|
||||
function AddResult(name, result) {
|
||||
print('RESULT', name, result);
|
||||
}
|
||||
|
||||
function AddScore(score) {
|
||||
print('SCORE', score);
|
||||
}
|
||||
|
||||
try {
|
||||
Run();
|
||||
} catch (e) {
|
||||
print('*** Run() failed');
|
||||
print(e.stack || e);
|
||||
}
|
||||
|
||||
if (harnessErrorCount > 0) {
|
||||
// Throw an error so that 'duk' has a non-zero exit code which helps
|
||||
// automatic testing.
|
||||
throw new Error('Benchmark had ' + harnessErrorCount + ' errors');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue