Skip to content

Commit 4c759f1

Browse files
committed
mb2hal tests: ignore comp id in tests
This is the same change made to the old tests in 2.8, applied to the new tests in 2.9: tolerate variance in HAL component ID values. They're different from RTAI to uspace.
1 parent ff2b867 commit 4c759f1

4 files changed

Lines changed: 75 additions & 49 deletions

File tree

tests/mb2hal/mb2hal.2a/checkresult

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e
3+
4+
TESTDIR=$(dirname $1)
5+
cd "${TESTDIR}"
6+
7+
# HAL assigns each component a unique component ID at load-time.
8+
# The RTAI and uspace HAL implementations assign different component IDs,
9+
# so remove all mentions of specific component IDs from the result file,
10+
# so that a single `expected` file works for both.
11+
sed --in-place --regexp-extended --expression='s/^(.*unloading HAL module \[)[0-9]+(.*)$/\1(ignored comp id)\2/' result
12+
13+
diff -u expected result

tests/mb2hal/mb2hal.2a/expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,6 @@ mb2hal main OK: Link thread loop and logic 0 created OK
173173
mb2hal main OK: mb2hal is running
174174
mb2hal quit_signal DEBUG: signal [15] received
175175
mb2hal quit_cleanup DEBUG: started
176-
mb2hal quit_cleanup DEBUG: unloading HAL module [4] ret[0]
176+
mb2hal quit_cleanup DEBUG: unloading HAL module [(ignored comp id)] ret[0]
177177
mb2hal quit_cleanup DEBUG: done OK
178178
mb2hal main OK: going to exit!

tests/mb2hal/mb2hal.2b/checkresult

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e
3+
4+
TESTDIR=$(dirname $1)
5+
cd "${TESTDIR}"
6+
7+
# HAL assigns each component a unique component ID at load-time.
8+
# The RTAI and uspace HAL implementations assign different component IDs,
9+
# so remove all mentions of specific component IDs from the result file,
10+
# so that a single `expected` file works for both.
11+
sed --in-place --regexp-extended --expression='s/^( *)[0-9]+(.*mb2hal.Modbus_fnct_.*)$/\1(ignored comp id)\2/' result
12+
13+
diff -u expected result

tests/mb2hal/mb2hal.2b/expected

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
11
Component Pins:
22
Owner Type Dir Value Name
3-
4 bit OUT FALSE mb2hal.Modbus_fnct_02.00.bit
4-
4 bit OUT TRUE mb2hal.Modbus_fnct_02.00.bit-inv
5-
4 bit OUT FALSE mb2hal.Modbus_fnct_02.01.bit
6-
4 bit OUT TRUE mb2hal.Modbus_fnct_02.01.bit-inv
7-
4 bit OUT FALSE mb2hal.Modbus_fnct_02.02.bit
8-
4 bit OUT TRUE mb2hal.Modbus_fnct_02.02.bit-inv
9-
4 bit OUT FALSE mb2hal.Modbus_fnct_02.03.bit
10-
4 bit OUT TRUE mb2hal.Modbus_fnct_02.03.bit-inv
3+
(ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.00.bit
4+
(ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_02.00.bit-inv
5+
(ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.01.bit
6+
(ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_02.01.bit-inv
7+
(ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.02.bit
8+
(ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_02.02.bit-inv
9+
(ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_02.03.bit
10+
(ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_02.03.bit-inv
1111

1212
Component Pins:
1313
Owner Type Dir Value Name
14-
4 float OUT 0 mb2hal.Modbus_fnct_03.00.float
15-
4 s32 OUT 0 mb2hal.Modbus_fnct_03.00.int
16-
4 float OUT 0 mb2hal.Modbus_fnct_03.01.float
17-
4 s32 OUT 0 mb2hal.Modbus_fnct_03.01.int
18-
4 float OUT 0 mb2hal.Modbus_fnct_03.02.float
19-
4 s32 OUT 0 mb2hal.Modbus_fnct_03.02.int
20-
4 float OUT 0 mb2hal.Modbus_fnct_03.03.float
21-
4 s32 OUT 0 mb2hal.Modbus_fnct_03.03.int
14+
(ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.00.float
15+
(ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.00.int
16+
(ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.01.float
17+
(ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.01.int
18+
(ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.02.float
19+
(ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.02.int
20+
(ignored comp id) float OUT 0 mb2hal.Modbus_fnct_03.03.float
21+
(ignored comp id) s32 OUT 0 mb2hal.Modbus_fnct_03.03.int
2222

2323
Component Pins:
2424
Owner Type Dir Value Name
25-
4 float IN 0 mb2hal.Modbus_fnct_06.00.float
26-
4 s32 IN 0 mb2hal.Modbus_fnct_06.00.int
27-
4 float IN 0 mb2hal.Modbus_fnct_06.01.float
28-
4 s32 IN 0 mb2hal.Modbus_fnct_06.01.int
29-
4 float IN 0 mb2hal.Modbus_fnct_06.02.float
30-
4 s32 IN 0 mb2hal.Modbus_fnct_06.02.int
31-
4 float IN 0 mb2hal.Modbus_fnct_06.03.float
32-
4 s32 IN 0 mb2hal.Modbus_fnct_06.03.int
25+
(ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.00.float
26+
(ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_06.00.int
27+
(ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.01.float
28+
(ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_06.01.int
29+
(ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.02.float
30+
(ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_06.02.int
31+
(ignored comp id) float IN 0 mb2hal.Modbus_fnct_06.03.float
32+
(ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_06.03.int
3333

3434
Component Pins:
3535
Owner Type Dir Value Name
36-
4 bit IN FALSE mb2hal.Modbus_fnct_15.00.bit
37-
4 bit IN FALSE mb2hal.Modbus_fnct_15.01.bit
38-
4 bit IN FALSE mb2hal.Modbus_fnct_15.02.bit
39-
4 bit IN FALSE mb2hal.Modbus_fnct_15.03.bit
36+
(ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.00.bit
37+
(ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.01.bit
38+
(ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.02.bit
39+
(ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_15.03.bit
4040

4141
Component Pins:
4242
Owner Type Dir Value Name
43-
4 float IN 0 mb2hal.Modbus_fnct_16.00.float
44-
4 s32 IN 0 mb2hal.Modbus_fnct_16.00.int
45-
4 float IN 0 mb2hal.Modbus_fnct_16.01.float
46-
4 s32 IN 0 mb2hal.Modbus_fnct_16.01.int
47-
4 float IN 0 mb2hal.Modbus_fnct_16.02.float
48-
4 s32 IN 0 mb2hal.Modbus_fnct_16.02.int
49-
4 float IN 0 mb2hal.Modbus_fnct_16.03.float
50-
4 s32 IN 0 mb2hal.Modbus_fnct_16.03.int
43+
(ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.00.float
44+
(ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_16.00.int
45+
(ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.01.float
46+
(ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_16.01.int
47+
(ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.02.float
48+
(ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_16.02.int
49+
(ignored comp id) float IN 0 mb2hal.Modbus_fnct_16.03.float
50+
(ignored comp id) s32 IN 0 mb2hal.Modbus_fnct_16.03.int
5151

5252
Component Pins:
5353
Owner Type Dir Value Name
54-
4 bit OUT FALSE mb2hal.Modbus_fnct_01.00.bit
55-
4 bit OUT TRUE mb2hal.Modbus_fnct_01.00.bit-inv
56-
4 bit OUT FALSE mb2hal.Modbus_fnct_01.01.bit
57-
4 bit OUT TRUE mb2hal.Modbus_fnct_01.01.bit-inv
58-
4 bit OUT FALSE mb2hal.Modbus_fnct_01.02.bit
59-
4 bit OUT TRUE mb2hal.Modbus_fnct_01.02.bit-inv
60-
4 bit OUT FALSE mb2hal.Modbus_fnct_01.03.bit
61-
4 bit OUT TRUE mb2hal.Modbus_fnct_01.03.bit-inv
54+
(ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_01.00.bit
55+
(ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_01.00.bit-inv
56+
(ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_01.01.bit
57+
(ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_01.01.bit-inv
58+
(ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_01.02.bit
59+
(ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_01.02.bit-inv
60+
(ignored comp id) bit OUT FALSE mb2hal.Modbus_fnct_01.03.bit
61+
(ignored comp id) bit OUT TRUE mb2hal.Modbus_fnct_01.03.bit-inv
6262

6363
Component Pins:
6464
Owner Type Dir Value Name
65-
4 bit IN FALSE mb2hal.Modbus_fnct_05.00.bit
66-
4 bit IN FALSE mb2hal.Modbus_fnct_05.01.bit
67-
4 bit IN FALSE mb2hal.Modbus_fnct_05.02.bit
68-
4 bit IN FALSE mb2hal.Modbus_fnct_05.03.bit
65+
(ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_05.00.bit
66+
(ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_05.01.bit
67+
(ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_05.02.bit
68+
(ignored comp id) bit IN FALSE mb2hal.Modbus_fnct_05.03.bit
6969

0 commit comments

Comments
 (0)