@@ -8,8 +8,15 @@ test_svd() {
8
8
)
9
9
10
10
# NOTE we care about errors in svd2rust, but not about errors / warnings in rustfmt
11
- target/$TARGET /release/svd2rust -i $td /${1} .svd | \
12
- ( rustfmt 2> /dev/null > $td /src/lib.rs || true )
11
+ local cwd=$( pwd)
12
+ pushd $td
13
+ $cwd /target/$TARGET /release/svd2rust -i ${1} .svd
14
+
15
+ mv lib.rs src/lib.rs
16
+
17
+ # ignore rustfmt errors
18
+ rustfmt src/lib.rs || true
19
+ popd
13
20
14
21
cargo check --manifest-path $td /Cargo.toml
15
22
}
@@ -34,18 +41,17 @@ main() {
34
41
35
42
# test crate
36
43
cargo init --name foo $td
37
- echo ' bare-metal = "0.1.0"' >> $td /Cargo.toml
38
- echo ' cortex-m = "0.4.0"' >> $td /Cargo.toml
39
- echo ' cortex-m-rt = "0.3.0"' >> $td /Cargo.toml
44
+ echo ' cortex-m = "0.5.0"' >> $td /Cargo.toml
45
+ echo ' cortex-m-rt = "0.5.0"' >> $td /Cargo.toml
40
46
echo ' vcell = "0.1.0"' >> $td /Cargo.toml
41
- echo ' msp430 = "0.1.0"' >> $td /Cargo.toml
42
- # echo 'riscv = "0.1.4"' >> $td/Cargo.toml
43
- # echo 'riscv-rt = "0.1.3"' >> $td/Cargo.toml
44
47
echo ' [profile.dev]' >> $td /Cargo.toml
45
48
echo ' incremental = false' >> $td /Cargo.toml
46
49
47
50
case $VENDOR in
48
51
Atmel)
52
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
53
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
54
+
49
55
# BAD-SVD missing resetValue
50
56
# test_svd AT91SAM9CN11
51
57
# test_svd AT91SAM9CN12
@@ -129,6 +135,9 @@ main() {
129
135
;;
130
136
131
137
Freescale)
138
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
139
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
140
+
132
141
# BAD-SVD bad enumeratedValue value
133
142
# test_svd MKV56F20
134
143
# test_svd MKV56F22
@@ -277,6 +286,9 @@ main() {
277
286
;;
278
287
279
288
Fujitsu)
289
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
290
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
291
+
280
292
# OK
281
293
test_svd MB9AF10xN
282
294
test_svd MB9AF10xR
@@ -381,6 +393,9 @@ main() {
381
393
;;
382
394
383
395
Holtek)
396
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
397
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
398
+
384
399
# OK
385
400
test_svd ht32f125x
386
401
test_svd ht32f175x
@@ -389,6 +404,18 @@ main() {
389
404
390
405
# test other targets (architectures)
391
406
OTHER)
407
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
408
+ echo ' version = "0.1.0"' >> $td /Cargo.toml
409
+
410
+ echo ' [dependencies.msp430]' >> $td /Cargo.toml
411
+ echo ' version = "0.1.0"' >> $td /Cargo.toml
412
+
413
+ # echo '[dependencies.riscv]' >> $td/Cargo.toml
414
+ # echo 'version = "0.2.0"' >> $td/Cargo.toml
415
+
416
+ # echo '[dependencies.riscv-rt]' >> $td/Cargo.toml
417
+ # echo 'version = "0.2.0"' >> $td/Cargo.toml
418
+
392
419
(
393
420
cd $td &&
394
421
curl -LO \
@@ -415,6 +442,9 @@ main() {
415
442
;;
416
443
417
444
Nordic)
445
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
446
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
447
+
418
448
# BAD-SVD two enumeratedValues have the same value
419
449
# test_svd nrf52
420
450
@@ -423,12 +453,18 @@ main() {
423
453
;;
424
454
425
455
Nuvoton)
456
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
457
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
458
+
426
459
# OK
427
460
test_svd M051_Series
428
461
test_svd NUC100_Series
429
462
;;
430
463
431
464
NXP)
465
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
466
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
467
+
432
468
# BAD-SVD two enumeratedValues have the same name
433
469
# test_svd LPC11Exx_v5
434
470
# test_svd LPC11Uxx_v7
@@ -465,6 +501,9 @@ main() {
465
501
;;
466
502
467
503
SiliconLabs)
504
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
505
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
506
+
468
507
# #99 regression tests
469
508
test_svd SIM3C1x4_SVD
470
509
test_svd SIM3C1x6_SVD
@@ -481,6 +520,9 @@ main() {
481
520
;;
482
521
483
522
Spansion)
523
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
524
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
525
+
484
526
# OK
485
527
test_svd MB9AF12xK
486
528
test_svd MB9AF12xL
@@ -576,6 +618,9 @@ main() {
576
618
;;
577
619
578
620
STMicro)
621
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
622
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
623
+
579
624
# OK
580
625
test_svd STM32F030
581
626
test_svd STM32F031x
@@ -626,6 +671,9 @@ main() {
626
671
;;
627
672
628
673
Toshiba)
674
+ echo ' [dependencies.bare-metal]' >> $td /Cargo.toml
675
+ echo ' version = "0.2.0"' >> $td /Cargo.toml
676
+
629
677
# BAD-SVD resetValue is bigger than the register size
630
678
# test_svd M365
631
679
# test_svd M367
0 commit comments