[oden] Grab my incomplete QuickJS wrapper

This commit is contained in:
John Doty 2023-06-17 20:44:09 -07:00
parent aa70df41a3
commit 898b1fe129
114 changed files with 244181 additions and 0 deletions

View 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');
}