Skip to content

Commit 03bb865

Browse files
committed
Fix exports
1 parent 5096945 commit 03bb865

2 files changed

Lines changed: 36 additions & 12 deletions

File tree

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ export * from './framework/scenario/Invoker';
1616
export * from './testbeds/TestbedSpecification';
1717
export * from './debug/Breakpoint';
1818
export * from './reporter/index';
19+
export * from './debug/WARDuino';
1920

2021
export const latch = Framework.getImplementation();

tests/examples/example.ts

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ import {
88
Message,
99
Step,
1010
Verbosity,
11-
WASM
11+
WASM,
12+
WARDuino
1213
} from '../../src/index';
1314
import dump = Message.dump;
1415
import stepOver = Message.stepOver;
16+
import Inspect = WARDuino.Inspect;
17+
import State = WARDuino.State;
1518

1619
const framework = Framework.getImplementation();
1720

@@ -74,16 +77,16 @@ const DUMP: Step = {
7477
title: 'Send DUMP command',
7578
instruction: {kind: Kind.Request, value: Message.dump},
7679
expected: [
77-
{'pc': {kind: 'description', value: Description.defined} as Expected<string>},
78-
{
79-
'breakpoints': {
80-
kind: 'comparison', value: (state: Object, value: Array<any>) => {
81-
return value.length === 0;
82-
}, message: 'list of breakpoints should be empty'
83-
} as Expected<Array<any>>
84-
},
85-
{'callstack[0].sp': {kind: 'primitive', value: -1} as Expected<number>},
86-
{'callstack[0].fp': {kind: 'primitive', value: -1} as Expected<number>}]
80+
{'pc': {kind: 'description', value: Description.defined} as Expected<string>},
81+
{
82+
'breakpoints': {
83+
kind: 'comparison', value: (state: Object, value: Array<any>) => {
84+
return value.length === 0;
85+
}, message: 'list of breakpoints should be empty'
86+
} as Expected<Array<any>>
87+
},
88+
{'callstack[0].sp': {kind: 'primitive', value: -1} as Expected<number>},
89+
{'callstack[0].fp': {kind: 'primitive', value: -1} as Expected<number>}]
8790
};
8891

8992
debug.test({
@@ -92,5 +95,25 @@ debug.test({
9295
steps: [DUMP]
9396
});
9497

98+
const reverse = framework.suite('Test Reverse interface');
99+
reverse.testee('emulator[:8530]', new EmulatorSpecification(8530));
100+
101+
reverse.test({
102+
title: 'Test snapshot',
103+
program: 'tests/examples/blink.wast',
104+
steps: [{
105+
title: 'Test IO snapshot',
106+
instruction: {kind: Kind.Request, value: Message.inspect([Inspect.io])},
107+
expected: [{
108+
'io': {
109+
kind: 'comparison', value: (state: State) => state.io?.length === 0
110+
}
111+
}],
112+
},
113+
new Invoker('read', [WASM.i32(BigInt(15))], WASM.i32(BigInt(0))),
114+
new Invoker('write', [WASM.i32(BigInt(15)), WASM.i32(BigInt(1))], undefined),
115+
new Invoker('read', [WASM.i32(BigInt(15))], WASM.i32(BigInt(1)))]
116+
})
117+
95118
framework.reporter.verbosity(Verbosity.debug);
96-
framework.analyse([spec, debug]);
119+
framework.analyse([spec, debug, reverse]);

0 commit comments

Comments
 (0)