Skip to content

Commit 9235c84

Browse files
committed
simplify test_svd
1 parent e0e886d commit 9235c84

File tree

1 file changed

+3
-29
lines changed

1 file changed

+3
-29
lines changed

ci/script.sh

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,19 @@
11
set -euxo pipefail
22

33
test_svd() {
4-
(
5-
cd $td &&
6-
curl -LO \
7-
https://raw.githubusercontent.com/posborne/cmsis-svd/master/data/$VENDOR/${1}.svd
8-
)
9-
10-
# NOTE we care about errors in svd2rust, but not about errors / warnings in rustfmt
11-
pushd $td
12-
RUST_BACKTRACE=1 svd2rust $options -i ${1}.svd
13-
14-
mv lib.rs src/lib.rs
15-
16-
popd
17-
18-
cargo $COMMAND --manifest-path $td/Cargo.toml
4+
test_svd_for_target cortex-m https://raw.githubusercontent.com/posborne/cmsis-svd/master/data/$VENDOR/${1}.svd
195
}
206

217
test_patched_stm32() {
22-
(
23-
cd $td && curl -L https://stm32-rs.github.io/stm32-rs/${1}.svd.patched -o ${1}.svd
24-
)
25-
26-
# NOTE we care about errors in svd2rust, but not about errors / warnings in rustfmt
27-
pushd $td
28-
RUST_BACKTRACE=1 svd2rust $options -i ${1}.svd
29-
30-
mv lib.rs src/lib.rs
31-
32-
popd
33-
34-
cargo $COMMAND --manifest-path $td/Cargo.toml
8+
test_svd_for_target cortex-m https://stm32-rs.github.io/stm32-rs/${1}.svd.patched
359
}
3610

3711
test_svd_for_target() {
3812
curl -L --output $td/input.svd $2
3913

4014
# NOTE we care about errors in svd2rust, but not about errors / warnings in rustfmt
4115
pushd $td
42-
RUST_BACKTRACE=1 svd2rust $options --target $1 -i input.svd
16+
RUST_BACKTRACE=1 svd2rust $options --target $1 --source_type xml -i input.svd
4317

4418
mv lib.rs src/lib.rs
4519

0 commit comments

Comments
 (0)