diff options
| author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-21 19:05:11 +0000 |
|---|---|---|
| committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-21 19:05:11 +0000 |
| commit | 16614919c0b9c7f398f773afc7bde091a05608a6 (patch) | |
| tree | e6a8bdd9d59933c688fac3c86f429e67bb81f66a /tests | |
| parent | eb528ef921c1d30d03b533b788a3af302bffb1f9 (diff) | |
| parent | 0fb2726e6ce4d1a0500c76839efd0dab77050607 (diff) | |
Merge #193
193: remove unused check r=japaric a=japaric
that was added in #140 but it's no longer required
this PR also adds some cfail tests to test the updated code
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cfail/init-extra-late-resources.rs | 15 | ||||
| -rw-r--r-- | tests/cfail/init-missing-late-resources.rs | 17 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/cfail/init-extra-late-resources.rs b/tests/cfail/init-extra-late-resources.rs new file mode 100644 index 0000000..d2d4a6d --- /dev/null +++ b/tests/cfail/init-extra-late-resources.rs @@ -0,0 +1,15 @@ +#![no_main] +#![no_std] + +extern crate lm3s6965; +extern crate panic_halt; +extern crate rtfm; + +use rtfm::app; + +#[app(device = lm3s6965)] +const APP: () = { + #[init] + fn init(_: init::Context) -> init::LateResources {} + //~^ error: `init` signature must be `fn(init::Context)` if there are no late resources +}; diff --git a/tests/cfail/init-missing-late-resources.rs b/tests/cfail/init-missing-late-resources.rs new file mode 100644 index 0000000..cec18ba --- /dev/null +++ b/tests/cfail/init-missing-late-resources.rs @@ -0,0 +1,17 @@ +#![no_main] +#![no_std] + +extern crate lm3s6965; +extern crate panic_halt; +extern crate rtfm; + +use rtfm::app; + +#[app(device = lm3s6965)] +const APP: () = { + static mut X: i32 = (); + + #[init] + fn init(_: init::Context) {} + //~^ error: late resources have been specified so `init` must return `init::LateResources` +}; |
