Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/Debug/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,23 +386,23 @@ void Debugger::printValue(const StackValue *v, const uint32_t idx,

switch (v->value_type) {
case I32:
snprintf(buff, 255, R"("type":"i32","value":)" FMT(PRIi32),
snprintf(buff, 255, R"("type":"i32","value":)" FMT(PRIu32),
v->value.uint32);
break;
case I64:
snprintf(buff, 255, R"("type":"i64","value":)" FMT(PRIi64),
snprintf(buff, 255, R"("type":"i64","value":)" FMT(PRIu64),
v->value.uint64);
break;
case F32:
snprintf(buff, 255, R"("type":"F32","value":")" FMT(PRIx32) "\"",
snprintf(buff, 255, R"("type":"F32","value":")" FMT(PRIu32) "\"",
v->value.uint32);
break;
case F64:
snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIx64) "\"",
snprintf(buff, 255, R"("type":"F64","value":")" FMT(PRIu64) "\"",
v->value.uint64);
break;
default:
snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIx64) "\"",
snprintf(buff, 255, R"("type":"%02x","value":")" FMT(PRIu64) "\"",
v->value_type, v->value.uint64);
}
this->channel->write(R"({"idx":%d,%s}%s)", idx, buff, end ? "" : ",");
Expand All @@ -429,7 +429,7 @@ void Debugger::handleInvoke(Module *m, uint8_t *interruptData) const {
const uint32_t fidx = read_LEB_32(&interruptData);

if (fidx >= m->function_count) {
debug("no function available for fidx %" PRIi32 "\n", fidx);
debug("no function available for fidx %" PRIu32 "\n", fidx);
return;
}

Expand Down Expand Up @@ -619,12 +619,12 @@ void Debugger::dumpLocals(const Module *m) const {
switch (v->value_type) {
case I32:
snprintf(_value_str, 255,
R"("type":"i32","value":)" FMT(PRIi32),
R"("type":"i32","value":)" FMT(PRIu32),
v->value.uint32);
break;
case I64:
snprintf(_value_str, 255,
R"("type":"i64","value":)" FMT(PRIi64),
R"("type":"i64","value":)" FMT(PRIu64),
v->value.uint64);
break;
case F32:
Expand All @@ -637,7 +637,7 @@ void Debugger::dumpLocals(const Module *m) const {
break;
default:
snprintf(_value_str, 255,
R"("type":"%02x","value":")" FMT(PRIx64) "\"",
R"("type":"%02x","value":")" FMT(PRIu64) "\"",
v->value_type, v->value.uint64);
}

Expand Down
Binary file modified tests/latch/latch-0.5.1.tgz
Binary file not shown.
169 changes: 127 additions & 42 deletions tests/latch/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/latch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"comptest": "npx ts-node ./src/comp.test.ts"
},
"devDependencies": {
"latch": "file:./latch-0.5.1.tgz",
"latch": "file:latch-0.5.1.tgz",
"mqtt": "^4.3.7",
"serialport": "^10.4.0",
"typescript": "^4.5.5"
Expand Down
36 changes: 36 additions & 0 deletions tests/latch/src/r3.test.ts
Original file line number Diff line number Diff line change
@@ -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]);
Loading
Loading