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