Skip to content

Commit df62bfb

Browse files
committed
Test 5, fetch test names
1 parent ba0258a commit df62bfb

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

.github/workflows/hil-library-test.yml

+15-18
Original file line numberDiff line numberDiff line change
@@ -127,39 +127,36 @@ jobs:
127127
128128
hil=${{ toJson(needs.setup.outputs.hil) }}
129129
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)
131131
132132
echo "HIL: $hil"
133133
134134
# loop over all fqbn in the library
135135
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}"`
137138
138139
# 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)
143144
done
144145
145146
# 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]}
148150
149151
150-
echo "Device: $device"
151-
echo "Tests: ${tests[@]}"
152-
echo "Serials: ${serials[@]}"
153-
echo "Ports: ${ports[@]}"
154152
155153
154+
echo "FQBN: $FQBN"
155+
echo "Device: $DEVICE"
156+
echo "Test: $TESTS[$idx]"
157+
echo "Port: $PORTS[$idx]"
156158
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
163160
done
164161
165162

0 commit comments

Comments
 (0)