mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
Merge #307
307: Use build.rs for conditional compilation r=korken89 a=AfoHT Extend the current test suite to allow for running tests on newer rustc-versions than current MSRV. Required by #306 to add special tests for future MSRV. To exclude an example from the regular non-nightly testing: ``` #![no_main] #![no_std] #[cfg(rustc_is_nightly)] mod example { use panic_halt as _; #[rtfm::app(device = lm3s6965)] const APP: () = { <more code> } } ``` Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
This commit is contained in:
commit
bb59606b7c
3 changed files with 15 additions and 0 deletions
|
@ -53,6 +53,9 @@ rtfm-core = "0.3.0"
|
||||||
cortex-m-rt = "0.6.9"
|
cortex-m-rt = "0.6.9"
|
||||||
heapless = "0.5.0"
|
heapless = "0.5.0"
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
version_check = "0.9"
|
||||||
|
|
||||||
[dependencies.microamp]
|
[dependencies.microamp]
|
||||||
optional = true
|
optional = true
|
||||||
version = "0.1.0-alpha.2"
|
version = "0.1.0-alpha.2"
|
||||||
|
|
5
build.rs
5
build.rs
|
@ -1,8 +1,13 @@
|
||||||
use std::env;
|
use std::env;
|
||||||
|
use version_check;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let target = env::var("TARGET").unwrap();
|
let target = env::var("TARGET").unwrap();
|
||||||
|
|
||||||
|
if version_check::Channel::read().unwrap().is_nightly() {
|
||||||
|
println!("cargo:rustc-cfg=rustc_is_nightly")
|
||||||
|
}
|
||||||
|
|
||||||
if target.starts_with("thumbv6m") {
|
if target.starts_with("thumbv6m") {
|
||||||
println!("cargo:rustc-cfg=armv6m")
|
println!("cargo:rustc-cfg=armv6m")
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,13 @@ main() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $TRAVIS_RUST_VERSION = nightly ]; then
|
if [ $TRAVIS_RUST_VERSION = nightly ]; then
|
||||||
|
# Tests where required MSRV > 1.36
|
||||||
|
#local exs=(
|
||||||
|
#)
|
||||||
|
#for ex in ${exs[@]}; do
|
||||||
|
# cargo check --example $ex --target $T
|
||||||
|
#done
|
||||||
|
|
||||||
# multi-core compile-pass tests
|
# multi-core compile-pass tests
|
||||||
pushd heterogeneous
|
pushd heterogeneous
|
||||||
local exs=(
|
local exs=(
|
||||||
|
|
Loading…
Reference in a new issue