Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move on-target-tests back to the work space #762

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 8 additions & 32 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,8 @@ jobs:
version: "=0.5.28"
- name: Build rp2040-hal's workspace (without the examples)
run: cargo hack build --optional-deps --each-feature
examples-builds:
name: Build rp2040-hal's examples
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-hack
version: "=0.5.28"
- name: Build workspace
- run: cargo clean
- name: Build rp2040-hal's workspace (with the examples)
run: cargo hack build --examples --optional-deps --each-feature
tests:
name: Execute host-runable tests
Expand All @@ -45,13 +33,13 @@ jobs:
crate: cargo-hack
version: "=0.5.28"
- name: Test
run: cargo hack test -p rp2040-hal --tests --target x86_64-unknown-linux-gnu --optional-deps --each-feature --features critical-section-impl
run: cargo hack test -p rp2040-hal --target x86_64-unknown-linux-gnu --optional-deps --each-feature --tests --features critical-section-impl
- name: Test docs
run: cargo hack test -p rp2040-hal --doc --target x86_64-unknown-linux-gnu --optional-deps --each-feature --features critical-section-impl
run: cargo hack test -p rp2040-hal --target x86_64-unknown-linux-gnu --optional-deps --each-feature --doc --features critical-section-impl
- name: Test macros
run: cargo hack test -p rp2040-hal-macros --tests --target x86_64-unknown-linux-gnu --optional-deps --each-feature
run: cargo hack test -p rp2040-hal-macros --target x86_64-unknown-linux-gnu --optional-deps --tests --each-feature
- name: Test macro docs
run: cargo hack test -p rp2040-hal-macros --doc --target x86_64-unknown-linux-gnu --optional-deps --each-feature
run: cargo hack test -p rp2040-hal-macros --target x86_64-unknown-linux-gnu --optional-deps --doc --each-feature
- name: Clean
run: cargo clean
udeps:
Expand All @@ -61,7 +49,7 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-06-27
toolchain: nightly-2024-01-30
target: thumbv6m-none-eabi
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v2
Expand All @@ -82,7 +70,7 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.65
toolchain: 1.75
target: thumbv6m-none-eabi
- name: Install cargo-hack
uses: baptiste0928/cargo-install@v2
Expand All @@ -93,15 +81,3 @@ jobs:
run: cargo update -p regex --precise 1.9.3
- name: Verifiy MSRV
run: cargo hack build --examples --optional-deps --each-feature
on-target-build:
name: Build on-target-tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
- name: Build on-target-tests
run: |
cd on-target-tests
cargo test --no-run
7 changes: 2 additions & 5 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ jobs:
with:
target: thumbv6m-none-eabi
components: clippy
- run: cargo clippy --workspace --examples -- -Dwarnings
- run: cargo clippy --workspace --examples --all-features -- -Dwarnings
- run: |
cd on-target-tests
cargo clippy -- -Dwarnings
- run: cargo clippy --workspace --examples
- run: cargo clippy --workspace --examples --all-features
3 changes: 0 additions & 3 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ jobs:
target: thumbv6m-none-eabi
components: rustfmt
- run: cargo fmt -- --check
- run: |
cd on-target-tests
cargo fmt -- --check
22 changes: 15 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
[workspace]
resolver = "2"
members = [
"rp2040-hal",
"rp2040-hal-macros",
]
exclude = [
"on-target-tests"
]
members = ["rp2040-hal", "rp2040-hal-macros", "on-target-tests"]
exclude = []

[patch.'https://github.com/rp-rs/rp-hal.git']
rp2040-hal = { path = "./rp2040-hal" }

[patch.crates-io]
rp2040-hal = { path = "./rp2040-hal" }

# Those profiles are only used for `on-target-tests` compilation
[profile.dev]
codegen-units = 1
incremental = false
lto = 'fat'
opt-level = 's'

[profile.test]
codegen-units = 1
incremental = false
lto = 'fat'
opt-level = 's'
14 changes: 0 additions & 14 deletions on-target-tests/.cargo/config.toml

This file was deleted.

22 changes: 1 addition & 21 deletions on-target-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
edition = "2021"
name = "rp2040-hal-on-target-tests"
name = "on-target-tests"
version = "0.1.0"
publish = false

Expand Down Expand Up @@ -47,23 +47,3 @@ fugit = "0.3.6"

rp2040-boot2 = "0.3.0"
critical-section = "1.0.0"

[features]
default = ['defmt-trace']
defmt-trace = []
defmt-debug = []
defmt-info = []
defmt-warn = []
defmt-error = []

[profile.dev]
codegen-units = 1
incremental = false
lto = 'fat'
opt-level = 's'

[profile.test]
codegen-units = 1
incremental = false
lto = 'fat'
opt-level = 's'
2 changes: 1 addition & 1 deletion on-target-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ run_tests.bat
To run a specific test (to make developing tests faster)

```system
CARGO_TARGET_THUMBV6M_NONE_EABI_RUNNER="probe-rs run" cargo test --test my_new_test -- --chip rp2040
CARGO_TARGET_THUMBV6M_NONE_EABI_RUNNER="probe-rs run" cargo test -p on-target-tests --test my_new_test -- --chip rp2040
```

## Prerequisites
Expand Down
3 changes: 3 additions & 0 deletions on-target-tests/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("cargo:rustc-link-arg-tests=-Tdefmt.x");
}
2 changes: 1 addition & 1 deletion rp2040-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
homepage = "https://github.com/rp-rs/rp-hal"
description = "A Rust Embeded-HAL impl for the rp2040 microcontroller"
license = "MIT OR Apache-2.0"
rust-version = "1.65"
rust-version = "1.75"
repository = "https://github.com/rp-rs/rp-hal"

[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion on-target-tests/run_tests.bat → run_tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

@SET "CARGO_TARGET_THUMBV6M_NONE_EABI_RUNNER=probe-rs run"

cargo test --no-fail-fast -- --chip rp2040
cargo test -p on-target-tests --no-fail-fast -- --chip rp2040
2 changes: 1 addition & 1 deletion on-target-tests/run_tests.sh → run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Keep running tests even if one of them fails
# We need to specify probe-rs as our runner via environment variables here
# to control build since we aren't able to override them in config.toml
CARGO_TARGET_THUMBV6M_NONE_EABI_RUNNER="probe-rs run" cargo test --no-fail-fast -- --chip rp2040
CARGO_TARGET_THUMBV6M_NONE_EABI_RUNNER="probe-rs run" cargo test -p on-target-tests --no-fail-fast -- --chip rp2040
Loading