File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change 11set -ex
22
3- gen () {
4- cargo run --release -- -i /tmp/STM32F30x.svd $1 > /dev/null
3+ test_gen () {
4+ echo ' extern crate volatile_register;' > /tmp/foo/src/lib.rs
5+ cargo run --release -- -i /tmp/STM32F30x.svd $1 >> /tmp/foo/src/lib.rs
6+ cargo build --manifest-path /tmp/foo/Cargo.toml
57}
68
79main () {
810 export LD_LIBRARY_PATH=$( rustc --print sysroot) /lib/rustlib/${1} /lib
9- echo $LD_LIBRARY_PATH
11+ export USER=rust
1012
1113 curl -L \
1214 https://raw.githubusercontent.com/posborne/cmsis-svd/master/data/STMicro/STM32F30x.svd \
1315 > /tmp/STM32F30x.svd
1416
17+ # test the library
1518 cargo build --release
1619
17- gen
18- gen dbgmcu
19- gen gpioa
20- gen i2c1
21- gen rcc
22- gen spi1
23- gen tim6
20+ # test repository
21+ cargo new /tmp/foo
22+ echo ' volatile-register = "0.1.0"' >> /tmp/foo/Cargo.toml
23+
24+ # test generated code
25+ test_gen
26+ test_gen dbgmcu
27+ test_gen gpioa
28+ test_gen i2c1
29+ test_gen rcc
30+ test_gen spi1
31+ test_gen tim6
2432}
2533
2634main $1
You can’t perform that action at this time.
0 commit comments