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 1
1
set -ex
2
2
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
5
7
}
6
8
7
9
main () {
8
10
export LD_LIBRARY_PATH=$( rustc --print sysroot) /lib/rustlib/${1} /lib
9
- echo $LD_LIBRARY_PATH
11
+ export USER=rust
10
12
11
13
curl -L \
12
14
https://raw.githubusercontent.com/posborne/cmsis-svd/master/data/STMicro/STM32F30x.svd \
13
15
> /tmp/STM32F30x.svd
14
16
17
+ # test the library
15
18
cargo build --release
16
19
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
24
32
}
25
33
26
34
main $1
You can’t perform that action at this time.
0 commit comments