diff --git a/src/Debug/debugger.cpp b/src/Debug/debugger.cpp index f84651b0..34aac402 100644 --- a/src/Debug/debugger.cpp +++ b/src/Debug/debugger.cpp @@ -394,15 +394,15 @@ void Debugger::printValue(const StackValue *v, const uint32_t idx, v->value.uint64); break; case F32: - snprintf(buff, 255, R"("type":"F32","value":")" FMT(PRIx32) "\"", + snprintf(buff, 255, R"("type":"F32","value":")" FMT(PRIi32) "\"", v->value.uint32); break; case F64: - snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIx64) "\"", + snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIi64) "\"", v->value.uint64); break; default: - snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIx64) "\"", + snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIi64) "\"", v->value_type, v->value.uint64); } this->channel->write(R"({"idx":%d,%s}%s)", idx, buff, end ? "" : ","); diff --git a/tests/latch/src/r3.test.ts b/tests/latch/src/r3.test.ts new file mode 100644 index 00000000..5e0020b0 --- /dev/null +++ b/tests/latch/src/r3.test.ts @@ -0,0 +1,36 @@ +import {EmulatorSpecification, Framework, Kind, Message, StyleType, Suite, TestScenario} from 'latch'; +import * as fs from 'fs'; +import * as path from 'path'; + +const framework = Framework.getImplementation(); +framework.reporter.style(StyleType.github); + +// TODO disclaimer: file is currently disabled until latch supports AS compilation + +const suite: Suite = framework.suite('End-to-end tests: R3 benchmark suite'); + +suite.testee('emulator [:8530]', new EmulatorSpecification(8530)); + +const scenarios: TestScenario[] = []; +const r3Directory = path.resolve(__dirname, '../static/r3'); +console.error(r3Directory) + +if (fs.existsSync(r3Directory)) { + fs.readdirSync(r3Directory) + .filter((file: string) => file.endsWith('.wat')) + .forEach((wasmFile: string) => { + scenarios.push({ + title: `R3: ${wasmFile}`, + program: path.join(r3Directory, wasmFile), + dependencies: [], + steps: [{ + title: `Run ${wasmFile}`, + instruction: {kind: Kind.Request, value: Message.run} + }] + }); + }); +} + +suite.tests(scenarios); + +framework.analyse([suite]); diff --git a/tests/latch/src/spec.test.ts b/tests/latch/src/spec.test.ts index dcc1a06a..630f8cf7 100644 --- a/tests/latch/src/spec.test.ts +++ b/tests/latch/src/spec.test.ts @@ -65,7 +65,7 @@ spec.testee('emulator [:8500]', new EmulatorSpecification(8500)); //spec.testee('esp wrover', new ArduinoSpecification('/dev/ttyUSB0', 'esp32:esp32:esp32wrover'), new HybridScheduler()); spec.tests(tests); -framework.run([spec]); +framework.analyse([spec]); // Helper function