You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Declare the same channels as in Proc Under Test (PUT), but in reversed direction
Add terminator channel
In config function, create consumer/producer channel endpoints and attach them to PUT and test proc (this can be figured out based on the channel direction of the PUT)
Resulting code is predictable and could be done automatically with a tool, which parses the config function of the PUT. Ideally, the tool would be implemented in such a way, that it could be reused by code editors plugins, e.g. VSCode Plugin. Another solution would be to figure out how to change DSLX syntax to reduce the boilerplate.
The text was updated successfully, but these errors were encountered:
FWIW we're kicking around an idea which would simplify the proc syntax. We hope to prioritize this in the coming months and will post more publicly. Here's an example test proc (syntax not at all finalized):
// Test proc using token-less sends and receives.
#[test_proc]
proc proc_test() {
input: chan<u32>;
result: chan<u32>;
// Instantiation of proc under test.
dut: instantiate my_proc(input.in, result.out);
run {
// Tokens are threaded implicitly. sends/recvs are serialized.
send(input.out, u32:123);
send(input.out, u32:42);
assert_eq!(recv(result.in), u32:11);
assert_eq!(recv(result.in), u32:12);
// New builtin for terminating the test. This replaces the terminator channel.
finish!();
}
}
The process of creating proc unit tests is repetitive and requires rewriting boilerplate code. Take a look at:
The steps to create a proc test are:
proc
(config, init, next function)config
function, createconsumer/producer
channel endpoints and attach them to PUT and testproc
(this can be figured out based on the channel direction of the PUT)Resulting code is predictable and could be done automatically with a tool, which parses the config function of the PUT. Ideally, the tool would be implemented in such a way, that it could be reused by code editors plugins, e.g. VSCode Plugin. Another solution would be to figure out how to change DSLX syntax to reduce the boilerplate.
The text was updated successfully, but these errors were encountered: