|
| 1 | +# Testsuite |
| 2 | + |
| 3 | +This workspace contains on-target tests. |
| 4 | + |
| 5 | +## Building |
| 6 | + |
| 7 | +Assuming you are at the root of the repository you can build like this: |
| 8 | + |
| 9 | +```console |
| 10 | +$ cargo build -p testsuite --target thumbv6m-none-eabi |
| 11 | + Compiling testsuite v0.1.0 (cortex-m/testsuite) |
| 12 | + Finished dev [unoptimized + debuginfo] target(s) in 0.08 |
| 13 | +``` |
| 14 | + |
| 15 | +## Running |
| 16 | + |
| 17 | +No implementation-specific features are tested right now; any `thumbv6m-none-eabi` target should work. |
| 18 | + |
| 19 | +Tests are executed with [probe-run](https://github.com/knurling-rs/probe-run): |
| 20 | + |
| 21 | +```console |
| 22 | +$ probe-run --chip STM32F070RBTx --connect-under-reset target/thumbv6m-none-eabi/debug/testsuite |
| 23 | +(HOST) INFO flashing program (12.80 KiB) |
| 24 | +(HOST) INFO success! |
| 25 | +──────────────────────────────────────────────────────────────────────────────── |
| 26 | +(1/2) running `assert_true`... |
| 27 | +(2/2) running `assert_flag`... |
| 28 | +all tests passed! |
| 29 | +──────────────────────────────────────────────────────────────────────────────── |
| 30 | +stack backtrace: |
| 31 | + 0: lib::inline::__bkpt |
| 32 | + at ./asm/inline.rs:13:5 |
| 33 | + 1: __bkpt |
| 34 | + at ./asm/lib.rs:49:17 |
| 35 | + 2: minitest::export::exit |
| 36 | + at testsuite/minitest/src/export.rs:6:9 |
| 37 | + 3: main |
| 38 | + at testsuite/src/main.rs:23:1 |
| 39 | + 4: Reset |
| 40 | +(HOST) WARN call stack was corrupted; unwinding could not be completed |
| 41 | +(HOST) INFO device halted without error |
| 42 | +``` |
| 43 | + |
| 44 | +## CI |
| 45 | + |
| 46 | +These tests are run automatically in continuous integration. A self-hosted github actions runner with a NUCLEO-F070RB board is hosted by [newAM](https://github.com/newAM). |
| 47 | + |
| 48 | +The runner is equiped with a limited selection of packages: |
| 49 | +* [Unix Commands](https://en.wikipedia.org/wiki/List_of_Unix_commands) |
| 50 | +* clang |
| 51 | +* gcc-arm-embedded |
| 52 | +* git |
| 53 | +* probe-run |
| 54 | +* rustup |
| 55 | + |
| 56 | +The complete host configuration can be found here [here](https://github.com/newAM/nixfiles/blob/main/t430s/configuration.nix). |
| 57 | + |
| 58 | +⚠️ Hosting a github actions runner in a public repository goes directly against [github's advice](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories), do not do this yourself unless you are prepared to accept the risks. |
0 commit comments