-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_all.sh
More file actions
executable file
Β·142 lines (123 loc) Β· 4.75 KB
/
test_all.sh
File metadata and controls
executable file
Β·142 lines (123 loc) Β· 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/bin/bash
set -e
# iolinki Test Suite Runner
# Runs builds and tests for all supported platforms
echo "============================================"
echo "π iolinki CI: Starting Validation Suite"
echo "============================================"
# Environment Check
if ! command -v cmake &> /dev/null; then
echo "β CMake not found"
exit 1
fi
echo "β
Environment checks passed"
# 1. Linux Host Build & Test
echo -e "\n[1/3] π§ Testing Linux Host Target..."
rm -rf build_linux
mkdir build_linux
cd build_linux
cmake .. -DCMAKE_BUILD_TYPE=Debug -DPLATFORM=LINUX
make -j"$(nproc)"
echo " β
Linux Build Successful"
# Run Integration Tests
if [ -d ../tools/virtual_master ]; then
export IOLINK_DEVICE_PATH="./examples/host_demo/host_demo"
# 1. Type 1 Test
if [ -f ../tools/virtual_master/test_type1.py ]; then
echo " π Running Type 1 Integration Test..."
if ! python3 ../tools/virtual_master/test_type1.py; then
echo " β Type 1 Integration Test FAILED"
exit 1
fi
echo " β
Type 1 Integration Test Passed"
fi
# 2. Mandatory Indices Test
if [ -f ../tools/virtual_master/test_automated_mandatory.py ]; then
echo " π Running Mandatory Indices Integration Test..."
if ! python3 ../tools/virtual_master/test_automated_mandatory.py; then
echo " β Mandatory Indices Test FAILED"
exit 1
fi
echo " β
Mandatory Indices Test Passed"
fi
# 3. Variable PD & Persistence Test
if [ -f ../tools/virtual_master/test_pd_variable.py ]; then
echo " π Running Variable PD & Persistence Integration Test..."
if ! python3 ../tools/virtual_master/test_pd_variable.py; then
echo " β Variable PD Test FAILED"
exit 1
fi
echo " β
Variable PD Test Passed"
fi
# 4. IO-Link V1.1.5 Conformance Test Suite
echo " π Running IO-Link V1.1.5 Conformance Tests..."
if [ -f ../tools/virtual_master/test_conformance_state_machine.py ]; then
echo " β State Machine Conformance..."
if ! python3 ../tools/virtual_master/test_conformance_state_machine.py; then
echo " β State Machine Conformance FAILED"
exit 1
fi
fi
if [ -f ../tools/virtual_master/test_conformance_timing.py ]; then
echo " β Timing Requirements..."
if ! python3 ../tools/virtual_master/test_conformance_timing.py; then
echo " β Timing Conformance FAILED"
exit 1
fi
fi
if [ -f ../tools/virtual_master/test_conformance_isdu.py ]; then
echo " β ISDU Protocol Validation..."
if ! python3 ../tools/virtual_master/test_conformance_isdu.py; then
echo " β ISDU Conformance FAILED"
exit 1
fi
fi
if [ -f ../tools/virtual_master/test_conformance_error_injection.py ]; then
echo " β Error Injection & Recovery..."
if ! python3 ../tools/virtual_master/test_conformance_error_injection.py; then
echo " β Error Injection Conformance FAILED"
exit 1
fi
fi
if [ -f ../tools/virtual_master/test_conformance_performance.py ]; then
echo " β Performance & Stress Testing..."
if ! python3 ../tools/virtual_master/test_conformance_performance.py; then
echo " β Performance Conformance FAILED"
exit 1
fi
fi
echo " β
All Conformance Tests Passed"
else
echo " β οΈ Skipping Integration Tests (Tools directory not found)"
fi
cd ..
# 2. Bare Metal Build Verification
echo -e "\n[2/3] βοΈ Verifying Bare Metal Build..."
rm -rf build_baremetal
mkdir build_baremetal
cd build_baremetal
# Bare metal usually requires cross-compiler, but we can verify source compilation
# using a generic config or mock toolchain if available.
# For now, we build the library only to ensure no Linux dependencies leaked.
cmake .. -DCMAKE_BUILD_TYPE=Debug -DPLATFORM=BARE_METAL
make iolinki -j"$(nproc)"
echo " β
Bare Metal Library Build Successful"
cd ..
# 3. Zephyr Build Verification (Simulation)
echo -e "\n[3/3] πͺ Checking Zephyr Compatibility..."
if command -v west &> /dev/null; then
chmod +x tests/test_zephyr.sh
if ./tests/test_zephyr.sh; then
echo " β
Zephyr Tests Passed"
else
echo " β οΈ Zephyr Tests Failed/Skipped (Environment issue)"
# We don't exit 1 here to avoid breaking workflow on systems without full Zephyr SDK
fi
else
echo " β οΈ West not found, skipping Zephyr build."
fi
# 4. Cleanup
echo -e "\n============================================"
echo "β
All Validation Steps Completed Successfully"
echo "============================================"
exit 0