diff --git a/.github/workflows/riscv-rt.yaml b/.github/workflows/riscv-rt.yaml index 3ccfb139..bef0a756 100644 --- a/.github/workflows/riscv-rt.yaml +++ b/.github/workflows/riscv-rt.yaml @@ -7,7 +7,7 @@ on: name: Build check (riscv-rt) jobs: - build: + build-riscv: strategy: matrix: # All generated code should be running on stable now, MRSV is 1.61.0 @@ -43,11 +43,25 @@ jobs: run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example ${{ matrix.example }} --features=v-trap - name: Build (all features) run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example ${{ matrix.example }} --features=s-mode,single-hart,v-trap - + + build-others: + strategy: + matrix: + os: [ macos-latest, ubuntu-latest, windows-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Build (no features) + run: cargo build --package riscv-rt + - name: Build (all features) + run: cargo build --package riscv-rt --all-features + # Job to check that all the builds succeeded build-check: needs: - - build + - build-riscv + - build-others runs-on: ubuntu-latest if: always() steps: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 00000000..a7ab62c7 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,28 @@ +on: + push: + branches: [ master ] + pull_request: + merge_group: + +name: Run macro tests (tests) + +jobs: + run-tests: + strategy: + matrix: + os: [ macos-latest, ubuntu-latest ] # windows shows weird linking errors + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - name: Run tests + run: cargo test --package tests + + # Job to check that all the builds succeeded + tests-check: + needs: + - run-tests + runs-on: ubuntu-latest + if: always() + steps: + - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' diff --git a/Cargo.toml b/Cargo.toml index 5e73fed7..ba28eae6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,4 +6,5 @@ members = [ "riscv-peripheral", "riscv-rt", "riscv-semihosting", + "tests", ] diff --git a/riscv-rt/Cargo.toml b/riscv-rt/Cargo.toml index 7ca6de25..ff222ea6 100644 --- a/riscv-rt/Cargo.toml +++ b/riscv-rt/Cargo.toml @@ -25,7 +25,6 @@ riscv-pac = { path = "../riscv-pac", version = "0.2.0" } riscv-rt-macros = { path = "macros", version = "0.2.1" } [dev-dependencies] -trybuild = "1.0" panic-halt = "0.2.0" [features] diff --git a/riscv-rt/examples/empty.rs b/riscv-rt/examples/empty.rs index 837b6aea..cac3488b 100644 --- a/riscv-rt/examples/empty.rs +++ b/riscv-rt/examples/empty.rs @@ -2,7 +2,6 @@ #![no_main] extern crate panic_halt; -extern crate riscv_rt; use riscv_rt::{core_interrupt, entry, exception, external_interrupt}; diff --git a/riscv-rt/examples/multi_core.rs b/riscv-rt/examples/multi_core.rs index a3cbab79..0ccfc97a 100644 --- a/riscv-rt/examples/multi_core.rs +++ b/riscv-rt/examples/multi_core.rs @@ -2,8 +2,6 @@ #![no_main] extern crate panic_halt; -extern crate riscv; -extern crate riscv_rt; use riscv::asm::wfi; use riscv::register::{mie, mip}; diff --git a/riscv-rt/macros/src/lib.rs b/riscv-rt/macros/src/lib.rs index e6c561a8..ba1e5a3a 100644 --- a/riscv-rt/macros/src/lib.rs +++ b/riscv-rt/macros/src/lib.rs @@ -1,5 +1,11 @@ #![deny(warnings)] +extern crate core; +extern crate proc_macro; +extern crate proc_macro2; +extern crate quote; +extern crate syn; + use proc_macro2::{Span, TokenStream as TokenStream2}; use quote::quote; use syn::{ diff --git a/riscv-rt/tests/test.rs b/riscv-rt/tests/test.rs deleted file mode 100644 index 7c57e60a..00000000 --- a/riscv-rt/tests/test.rs +++ /dev/null @@ -1,6 +0,0 @@ -#[test] -fn ui() { - let t = trybuild::TestCases::new(); - t.compile_fail("tests/ui/*/fail_*.rs"); - t.pass("tests/ui/*/pass_*.rs"); -} diff --git a/riscv-rt/tests/ui/external_interrupt/fail_arguments.rs b/riscv-rt/tests/ui/external_interrupt/fail_arguments.rs deleted file mode 100644 index 309d1d8c..00000000 --- a/riscv-rt/tests/ui/external_interrupt/fail_arguments.rs +++ /dev/null @@ -1,31 +0,0 @@ -use riscv_rt::result::{Error, Result}; - -/// Just a dummy type to test the `ExternalInterrupt` trait. -#[derive(Copy, Clone, Debug, Eq, PartialEq)] -pub enum ExternalInterrupt { - GPIO, - UART, -} -unsafe impl riscv_rt::InterruptNumber for ExternalInterrupt { - const MAX_INTERRUPT_NUMBER: usize = 1; - - #[inline] - fn number(self) -> usize { - self as usize - } - - #[inline] - fn from_number(value: usize) -> Result { - match value { - 0 => Ok(Self::GPIO), - 1 => Ok(Self::UART), - _ => Err(Error::InvalidVariant(value)), - } - } -} -unsafe impl riscv::ExternalInterruptNumber for ExternalInterrupt {} - -#[riscv_rt::external_interrupt(ExternalInterrupt::GPIO)] -fn my_interrupt(code: usize) {} - -fn main() {} diff --git a/riscv-rt/tests/ui/external_interrupt/fail_arguments.stderr b/riscv-rt/tests/ui/external_interrupt/fail_arguments.stderr deleted file mode 100644 index 8bd94554..00000000 --- a/riscv-rt/tests/ui/external_interrupt/fail_arguments.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: `#[external_interrupt]` function must have signature `[unsafe] fn() [-> !]` - --> tests/ui/external_interrupt/fail_arguments.rs:29:1 - | -29 | fn my_interrupt(code: usize) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/Cargo.toml b/tests/Cargo.toml new file mode 100644 index 00000000..1dafa88a --- /dev/null +++ b/tests/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "tests" +version = "0.1.0" +edition = "2021" + +[dependencies] +riscv = { path = "../riscv", version = "0.12.0" } +riscv-rt = { path = "../riscv-rt", version = "0.13.0" } +trybuild = "1.0" diff --git a/riscv-rt/tests/ui/core_interrupt/fail_empty_macro.rs b/tests/tests/riscv-rt/core_interrupt/fail_empty_macro.rs similarity index 100% rename from riscv-rt/tests/ui/core_interrupt/fail_empty_macro.rs rename to tests/tests/riscv-rt/core_interrupt/fail_empty_macro.rs diff --git a/riscv-rt/tests/ui/core_interrupt/fail_empty_macro.stderr b/tests/tests/riscv-rt/core_interrupt/fail_empty_macro.stderr similarity index 85% rename from riscv-rt/tests/ui/core_interrupt/fail_empty_macro.stderr rename to tests/tests/riscv-rt/core_interrupt/fail_empty_macro.stderr index 1f3d12f4..99d53458 100644 --- a/riscv-rt/tests/ui/core_interrupt/fail_empty_macro.stderr +++ b/tests/tests/riscv-rt/core_interrupt/fail_empty_macro.stderr @@ -1,5 +1,5 @@ error: `#[core_interrupt]` attribute expects a path to a variant of an enum that implements the riscv_rt :: CoreInterruptNumber trait. - --> tests/ui/core_interrupt/fail_empty_macro.rs:1:1 + --> tests/riscv-rt/core_interrupt/fail_empty_macro.rs:1:1 | 1 | #[riscv_rt::core_interrupt] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/riscv-rt/tests/ui/core_interrupt/fail_impl_interrupt_number.rs b/tests/tests/riscv-rt/core_interrupt/fail_impl_interrupt_number.rs similarity index 100% rename from riscv-rt/tests/ui/core_interrupt/fail_impl_interrupt_number.rs rename to tests/tests/riscv-rt/core_interrupt/fail_impl_interrupt_number.rs diff --git a/riscv-rt/tests/ui/core_interrupt/fail_impl_interrupt_number.stderr b/tests/tests/riscv-rt/core_interrupt/fail_impl_interrupt_number.stderr similarity index 87% rename from riscv-rt/tests/ui/core_interrupt/fail_impl_interrupt_number.stderr rename to tests/tests/riscv-rt/core_interrupt/fail_impl_interrupt_number.stderr index 0febf6cc..96e6fba5 100644 --- a/riscv-rt/tests/ui/core_interrupt/fail_impl_interrupt_number.stderr +++ b/tests/tests/riscv-rt/core_interrupt/fail_impl_interrupt_number.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `riscv::interrupt::Exception: CoreInterruptNumber` is not satisfied - --> tests/ui/core_interrupt/fail_impl_interrupt_number.rs:1:28 + --> tests/riscv-rt/core_interrupt/fail_impl_interrupt_number.rs:1:28 | 1 | #[riscv_rt::core_interrupt(riscv::interrupt::Exception::LoadMisaligned)] | ---------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- @@ -11,7 +11,7 @@ error[E0277]: the trait bound `riscv::interrupt::Exception: CoreInterruptNumber` riscv::interrupt::Interrupt riscv::interrupt::supervisor::Interrupt note: required by a bound in `assert_impl` - --> tests/ui/core_interrupt/fail_impl_interrupt_number.rs:1:1 + --> tests/riscv-rt/core_interrupt/fail_impl_interrupt_number.rs:1:1 | 1 | #[riscv_rt::core_interrupt(riscv::interrupt::Exception::LoadMisaligned)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl` diff --git a/riscv-rt/tests/ui/core_interrupt/fail_signatures.rs b/tests/tests/riscv-rt/core_interrupt/fail_signatures.rs similarity index 100% rename from riscv-rt/tests/ui/core_interrupt/fail_signatures.rs rename to tests/tests/riscv-rt/core_interrupt/fail_signatures.rs diff --git a/riscv-rt/tests/ui/core_interrupt/fail_signatures.stderr b/tests/tests/riscv-rt/core_interrupt/fail_signatures.stderr similarity index 72% rename from riscv-rt/tests/ui/core_interrupt/fail_signatures.stderr rename to tests/tests/riscv-rt/core_interrupt/fail_signatures.stderr index 0b3c882f..03c1eec7 100644 --- a/riscv-rt/tests/ui/core_interrupt/fail_signatures.stderr +++ b/tests/tests/riscv-rt/core_interrupt/fail_signatures.stderr @@ -1,17 +1,17 @@ error: `#[core_interrupt]` function must have signature `[unsafe] fn() [-> !]` - --> tests/ui/core_interrupt/fail_signatures.rs:2:1 + --> tests/riscv-rt/core_interrupt/fail_signatures.rs:2:1 | 2 | fn my_interrupt(code: usize) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[core_interrupt]` function must have signature `[unsafe] fn() [-> !]` - --> tests/ui/core_interrupt/fail_signatures.rs:5:1 + --> tests/riscv-rt/core_interrupt/fail_signatures.rs:5:1 | 5 | fn my_other_interrupt() -> usize {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[core_interrupt]` function must have signature `[unsafe] fn() [-> !]` - --> tests/ui/core_interrupt/fail_signatures.rs:8:1 + --> tests/riscv-rt/core_interrupt/fail_signatures.rs:8:1 | 8 | async fn my_async_interrupt() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/riscv-rt/tests/ui/core_interrupt/pass_core_interrupt.rs b/tests/tests/riscv-rt/core_interrupt/pass_core_interrupt.rs similarity index 100% rename from riscv-rt/tests/ui/core_interrupt/pass_core_interrupt.rs rename to tests/tests/riscv-rt/core_interrupt/pass_core_interrupt.rs diff --git a/riscv-rt/tests/ui/exception/fail_empty_macro.rs b/tests/tests/riscv-rt/exception/fail_empty_macro.rs similarity index 100% rename from riscv-rt/tests/ui/exception/fail_empty_macro.rs rename to tests/tests/riscv-rt/exception/fail_empty_macro.rs diff --git a/riscv-rt/tests/ui/exception/fail_empty_macro.stderr b/tests/tests/riscv-rt/exception/fail_empty_macro.stderr similarity index 85% rename from riscv-rt/tests/ui/exception/fail_empty_macro.stderr rename to tests/tests/riscv-rt/exception/fail_empty_macro.stderr index 7bf44695..7489bd94 100644 --- a/riscv-rt/tests/ui/exception/fail_empty_macro.stderr +++ b/tests/tests/riscv-rt/exception/fail_empty_macro.stderr @@ -1,5 +1,5 @@ error: `#[exception]` attribute expects a path to a variant of an enum that implements the riscv_rt :: ExceptionNumber trait. - --> tests/ui/exception/fail_empty_macro.rs:1:1 + --> tests/riscv-rt/exception/fail_empty_macro.rs:1:1 | 1 | #[riscv_rt::exception] | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/riscv-rt/tests/ui/exception/fail_impl_exception_number.rs b/tests/tests/riscv-rt/exception/fail_impl_exception_number.rs similarity index 100% rename from riscv-rt/tests/ui/exception/fail_impl_exception_number.rs rename to tests/tests/riscv-rt/exception/fail_impl_exception_number.rs diff --git a/riscv-rt/tests/ui/exception/fail_impl_exception_number.stderr b/tests/tests/riscv-rt/exception/fail_impl_exception_number.stderr similarity index 88% rename from riscv-rt/tests/ui/exception/fail_impl_exception_number.stderr rename to tests/tests/riscv-rt/exception/fail_impl_exception_number.stderr index 13d929ac..ce4c506b 100644 --- a/riscv-rt/tests/ui/exception/fail_impl_exception_number.stderr +++ b/tests/tests/riscv-rt/exception/fail_impl_exception_number.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `riscv::interrupt::Interrupt: ExceptionNumber` is not satisfied - --> tests/ui/exception/fail_impl_exception_number.rs:1:23 + --> tests/riscv-rt/exception/fail_impl_exception_number.rs:1:23 | 1 | #[riscv_rt::exception(riscv::interrupt::Interrupt::SupervisorSoft)] | ----------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- @@ -11,7 +11,7 @@ error[E0277]: the trait bound `riscv::interrupt::Interrupt: ExceptionNumber` is riscv::interrupt::Exception riscv::interrupt::supervisor::Exception note: required by a bound in `assert_impl` - --> tests/ui/exception/fail_impl_exception_number.rs:1:1 + --> tests/riscv-rt/exception/fail_impl_exception_number.rs:1:1 | 1 | #[riscv_rt::exception(riscv::interrupt::Interrupt::SupervisorSoft)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl` diff --git a/riscv-rt/tests/ui/exception/fail_signatures.rs b/tests/tests/riscv-rt/exception/fail_signatures.rs similarity index 100% rename from riscv-rt/tests/ui/exception/fail_signatures.rs rename to tests/tests/riscv-rt/exception/fail_signatures.rs diff --git a/riscv-rt/tests/ui/exception/fail_signatures.stderr b/tests/tests/riscv-rt/exception/fail_signatures.stderr similarity index 81% rename from riscv-rt/tests/ui/exception/fail_signatures.stderr rename to tests/tests/riscv-rt/exception/fail_signatures.stderr index aa26287a..6f0c9107 100644 --- a/riscv-rt/tests/ui/exception/fail_signatures.stderr +++ b/tests/tests/riscv-rt/exception/fail_signatures.stderr @@ -1,17 +1,17 @@ error: `#[exception]` function must have signature `[unsafe] fn([&[mut] riscv_rt::TrapFrame]) [-> !]` - --> tests/ui/exception/fail_signatures.rs:2:1 + --> tests/riscv-rt/exception/fail_signatures.rs:2:1 | 2 | fn my_exception(code: usize) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[exception]` function must have signature `[unsafe] fn([&[mut] riscv_rt::TrapFrame]) [-> !]` - --> tests/ui/exception/fail_signatures.rs:5:1 + --> tests/riscv-rt/exception/fail_signatures.rs:5:1 | 5 | fn my_other_exception(trap_frame: &riscv_rt::TrapFrame, code: usize) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[exception]` function must have signature `[unsafe] fn([&[mut] riscv_rt::TrapFrame]) [-> !]` - --> tests/ui/exception/fail_signatures.rs:8:1 + --> tests/riscv-rt/exception/fail_signatures.rs:8:1 | 8 | async fn my_async_exception(trap_frame: &riscv_rt::TrapFrame, code: usize) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/riscv-rt/tests/ui/exception/pass_exception.rs b/tests/tests/riscv-rt/exception/pass_exception.rs similarity index 100% rename from riscv-rt/tests/ui/exception/pass_exception.rs rename to tests/tests/riscv-rt/exception/pass_exception.rs diff --git a/riscv-rt/tests/ui/external_interrupt/fail_empty_macro.rs b/tests/tests/riscv-rt/external_interrupt/fail_empty_macro.rs similarity index 100% rename from riscv-rt/tests/ui/external_interrupt/fail_empty_macro.rs rename to tests/tests/riscv-rt/external_interrupt/fail_empty_macro.rs diff --git a/riscv-rt/tests/ui/external_interrupt/fail_empty_macro.stderr b/tests/tests/riscv-rt/external_interrupt/fail_empty_macro.stderr similarity index 85% rename from riscv-rt/tests/ui/external_interrupt/fail_empty_macro.stderr rename to tests/tests/riscv-rt/external_interrupt/fail_empty_macro.stderr index 079b4e4f..5ef53507 100644 --- a/riscv-rt/tests/ui/external_interrupt/fail_empty_macro.stderr +++ b/tests/tests/riscv-rt/external_interrupt/fail_empty_macro.stderr @@ -1,5 +1,5 @@ error: `#[external_interrupt]` attribute expects a path to a variant of an enum that implements the riscv_rt :: ExternalInterruptNumber trait. - --> tests/ui/external_interrupt/fail_empty_macro.rs:1:1 + --> tests/riscv-rt/external_interrupt/fail_empty_macro.rs:1:1 | 1 | #[riscv_rt::external_interrupt] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/riscv-rt/tests/ui/external_interrupt/fail_impl_interrupt_number.rs b/tests/tests/riscv-rt/external_interrupt/fail_impl_interrupt_number.rs similarity index 100% rename from riscv-rt/tests/ui/external_interrupt/fail_impl_interrupt_number.rs rename to tests/tests/riscv-rt/external_interrupt/fail_impl_interrupt_number.rs diff --git a/riscv-rt/tests/ui/external_interrupt/fail_impl_interrupt_number.stderr b/tests/tests/riscv-rt/external_interrupt/fail_impl_interrupt_number.stderr similarity index 85% rename from riscv-rt/tests/ui/external_interrupt/fail_impl_interrupt_number.stderr rename to tests/tests/riscv-rt/external_interrupt/fail_impl_interrupt_number.stderr index 6f1d18ab..03dace2c 100644 --- a/riscv-rt/tests/ui/external_interrupt/fail_impl_interrupt_number.stderr +++ b/tests/tests/riscv-rt/external_interrupt/fail_impl_interrupt_number.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `riscv::interrupt::Interrupt: ExternalInterruptNumber` is not satisfied - --> tests/ui/external_interrupt/fail_impl_interrupt_number.rs:1:32 + --> tests/riscv-rt/external_interrupt/fail_impl_interrupt_number.rs:1:32 | 1 | #[riscv_rt::external_interrupt(riscv::interrupt::Interrupt::SupervisorSoft)] | -------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- @@ -8,7 +8,7 @@ error[E0277]: the trait bound `riscv::interrupt::Interrupt: ExternalInterruptNum | required by a bound introduced by this call | note: required by a bound in `assert_impl` - --> tests/ui/external_interrupt/fail_impl_interrupt_number.rs:1:1 + --> tests/riscv-rt/external_interrupt/fail_impl_interrupt_number.rs:1:1 | 1 | #[riscv_rt::external_interrupt(riscv::interrupt::Interrupt::SupervisorSoft)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl` diff --git a/riscv-rt/tests/ui/external_interrupt/fail_signatures.rs b/tests/tests/riscv-rt/external_interrupt/fail_signatures.rs similarity index 100% rename from riscv-rt/tests/ui/external_interrupt/fail_signatures.rs rename to tests/tests/riscv-rt/external_interrupt/fail_signatures.rs diff --git a/riscv-rt/tests/ui/external_interrupt/fail_signatures.stderr b/tests/tests/riscv-rt/external_interrupt/fail_signatures.stderr similarity index 74% rename from riscv-rt/tests/ui/external_interrupt/fail_signatures.stderr rename to tests/tests/riscv-rt/external_interrupt/fail_signatures.stderr index 39d6618f..3ea34689 100644 --- a/riscv-rt/tests/ui/external_interrupt/fail_signatures.stderr +++ b/tests/tests/riscv-rt/external_interrupt/fail_signatures.stderr @@ -1,17 +1,17 @@ error: `#[external_interrupt]` function must have signature `[unsafe] fn() [-> !]` - --> tests/ui/external_interrupt/fail_signatures.rs:31:1 + --> tests/riscv-rt/external_interrupt/fail_signatures.rs:31:1 | 31 | fn my_interrupt() -> usize {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[external_interrupt]` function must have signature `[unsafe] fn() [-> !]` - --> tests/ui/external_interrupt/fail_signatures.rs:34:1 + --> tests/riscv-rt/external_interrupt/fail_signatures.rs:34:1 | 34 | fn my_other_interrupt(code: usize) -> usize {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[external_interrupt]` function must have signature `[unsafe] fn() [-> !]` - --> tests/ui/external_interrupt/fail_signatures.rs:37:1 + --> tests/riscv-rt/external_interrupt/fail_signatures.rs:37:1 | 37 | async fn my_async_interrupt(code: usize) -> usize {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/riscv-rt/tests/ui/external_interrupt/pass_external_interrupt.rs b/tests/tests/riscv-rt/external_interrupt/pass_external_interrupt.rs similarity index 100% rename from riscv-rt/tests/ui/external_interrupt/pass_external_interrupt.rs rename to tests/tests/riscv-rt/external_interrupt/pass_external_interrupt.rs diff --git a/tests/tests/test.rs b/tests/tests/test.rs new file mode 100644 index 00000000..7506ddfc --- /dev/null +++ b/tests/tests/test.rs @@ -0,0 +1,6 @@ +#[test] +fn riscv_rt() { + let t = trybuild::TestCases::new(); + t.compile_fail("tests/riscv-rt/*/fail_*.rs"); + t.pass("tests/riscv-rt/*/pass_*.rs"); +}