Skip to content

Commit 53e77a6

Browse files
committed
Tighten tests
1 parent f1f84ad commit 53e77a6

File tree

4 files changed

+31
-78
lines changed

4 files changed

+31
-78
lines changed

tests/src/Lib.lf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
target C
2+
3+
reactor Sensor {
4+
output out:int
5+
timer t(0, 1s)
6+
state s:int = 0
7+
reaction(t) -> out {=
8+
lf_sleep(MSEC(100));
9+
lf_set(out, self->s++);
10+
=}
11+
}
12+
13+
reactor Processing {
14+
input in:int
15+
output out:int
16+
reaction(in) -> out {=
17+
lf_sleep(MSEC(200));
18+
lf_set(out, in->value * -2);
19+
=}
20+
}
21+
22+
reactor Actuator {
23+
input in:int
24+
reaction(in) {=
25+
lf_sleep(MSEC(300));
26+
printf("Received %d\n", in->value);
27+
=}
28+
}

tests/src/TracePluginCustomCmake.lf

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,7 @@ target C {
1616
timeout: 5s,
1717
}
1818

19-
reactor Sensor {
20-
output out:int
21-
timer t(0, 1s)
22-
state s:int = 0
23-
reaction(t) -> out {=
24-
lf_sleep(MSEC(100));
25-
lf_set(out, self->s++);
26-
=}
27-
}
28-
29-
reactor Processing {
30-
input in:int
31-
output out:int
32-
reaction(in) -> out {=
33-
lf_sleep(MSEC(200));
34-
lf_set(out, in->value * -2);
35-
=}
36-
}
37-
38-
reactor Actuator {
39-
input in:int
40-
reaction(in) {=
41-
lf_sleep(MSEC(300));
42-
printf("Received %d\n", in->value);
43-
=}
44-
}
19+
import Sensor, Processing, Actuator from "./Lib.lf"
4520

4621
main reactor {
4722
s = new Sensor()

tests/src/TracePluginSystemPath.lf

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,7 @@ target C {
1313
timeout: 5s,
1414
}
1515

16-
reactor Sensor {
17-
output out:int
18-
timer t(0, 1s)
19-
state s:int = 0
20-
reaction(t) -> out {=
21-
lf_sleep(MSEC(100));
22-
lf_set(out, self->s++);
23-
=}
24-
}
25-
26-
reactor Processing {
27-
input in:int
28-
output out:int
29-
reaction(in) -> out {=
30-
lf_sleep(MSEC(200));
31-
lf_set(out, in->value * -2);
32-
=}
33-
}
34-
35-
reactor Actuator {
36-
input in:int
37-
reaction(in) {=
38-
lf_sleep(MSEC(300));
39-
printf("Received %d\n", in->value);
40-
=}
41-
}
16+
import Sensor, Processing, Actuator from "./Lib.lf"
4217

4318
main reactor {
4419
s = new Sensor()

tests/src/TracePluginUserPath.lf

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,7 @@ target C {
1414
timeout: 5s,
1515
}
1616

17-
reactor Sensor {
18-
output out:int
19-
timer t(0, 1s)
20-
state s:int = 0
21-
reaction(t) -> out {=
22-
lf_sleep(MSEC(100));
23-
lf_set(out, self->s++);
24-
=}
25-
}
26-
27-
reactor Processing {
28-
input in:int
29-
output out:int
30-
reaction(in) -> out {=
31-
lf_sleep(MSEC(200));
32-
lf_set(out, in->value * -2);
33-
=}
34-
}
35-
36-
reactor Actuator {
37-
input in:int
38-
reaction(in) {=
39-
lf_sleep(MSEC(300));
40-
printf("Received %d\n", in->value);
41-
=}
42-
}
17+
import Sensor, Processing, Actuator from "./Lib.lf"
4318

4419
main reactor {
4520
s = new Sensor()

0 commit comments

Comments
 (0)