@@ -127,39 +127,36 @@ jobs:
127
127
128
128
hil=${{ toJson(needs.setup.outputs.hil) }}
129
129
lib=$(./py_checkusb.py --type ${{ env.library }} --json)
130
- readarray -t devices < <(echo $lib | jq ".\"${{ env.library }}\" | keys[]" -r --compact-output)
130
+ readarray -t DEVICES < <(echo $lib | jq ".\"${{ env.library }}\" | keys[]" -r --compact-output)
131
131
132
132
echo "HIL: $hil"
133
133
134
134
# loop over all fqbn in the library
135
135
cd ~/.arduino15/packages/Infineon/hardware/xmc/$TEST_VERSION/libraries/${{ env.library }} # change this
136
- for device in "${devices[@]}"; do
136
+ for DEVICE in "${DEVICES[@]}"; do
137
+ FQBN==`tr '.' ':' <<<"${DEVICE}"`
137
138
138
139
# loop over all serials and fetch the ports
139
- readarray -t serials < <(echo $lib | jq ".\"${{ env.library }}\".\"${device }\" | keys[]" -r --compact-output)
140
- ports =()
141
- for serial in "${serials [@]}"; do
142
- ports +=$(/opt/runner_support/find_usb.sh $serial )
140
+ readarray -t SERIALS < <(echo $lib | jq ".\"${{ env.library }}\".\"${DEVICE }\" | keys[]" -r --compact-output)
141
+ PORTS =()
142
+ for SERIAL in "${SERIALS [@]}"; do
143
+ PORTS +=$(/opt/runner_support/find_usb.sh $SERIAL )
143
144
done
144
145
145
146
# loop over all tests
146
- readarray -t tests < <(echo $hil | jq ".\"${{ env.library }}\".\"${device}\" | keys[]" -r --compact-output)
147
- echo "tests: ${tests}"
147
+ readarray -t TESTS < <(echo $hil | jq ".\"${{ env.library }}\".\"${DEVICE}\" | keys[]" -r --compact-output)
148
+ for ((idx=0; idx<${#TESTS[@]}; idx++)); do
149
+ make FQBN=${FQBN} PORT=${PORTS[$idx]} UNITY_PATH=/opt/runner_support/Unity ${TESTS[$idx]}
148
150
149
151
150
- echo "Device: $device"
151
- echo "Tests: ${tests[@]}"
152
- echo "Serials: ${serials[@]}"
153
- echo "Ports: ${ports[@]}"
154
152
155
153
154
+ echo "FQBN: $FQBN"
155
+ echo "Device: $DEVICE"
156
+ echo "Test: $TESTS[$idx]"
157
+ echo "Port: $PORTS[$idx]"
156
158
157
-
158
- #make UNITY_PATH=/opt/runner_support/Unity FQBN=${fqbn} PORT=${{ env.port }} ????
159
- #make FQBN=Infineon:xmc:XMC1400_XMC2GO PORT=COM42 UNITY_PATH=/home/zhanglinjing/repo/Unity CAN_connected_node2 monitor
160
- #make FQBN=Infineon:xmc:XMC1400_XMC2GO PORT=COM41 UNITY_PATH=/home/zhanglinjing/repo/Unity CAN_connected_node1 monitor
161
-
162
-
159
+ done
163
160
done
164
161
165
162
0 commit comments