Skip to content

Commit

Permalink
Merge pull request tock#4010 from lschuermann/dev/ci-job-capsules-doc…
Browse files Browse the repository at this point in the history
…test-ignore

capsules: ignore broken doctests, enable doctests for ci-job-capsules
  • Loading branch information
alevy authored May 31, 2024
2 parents 95e9146 + 7f3d770 commit 79cc869
Show file tree
Hide file tree
Showing 84 changed files with 131 additions and 129 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ ci-job-kernel:
ci-job-capsules:
$(call banner,CI-Job: Capsules)
@# Capsule initialization depends on board/chip specific imports, so ignore doc tests
@cd capsules && NOWARNINGS=true RUSTFLAGS="-D warnings" TOCK_KERNEL_VERSION=ci_test cargo test --lib --examples
@cd capsules/core && NOWARNINGS=true RUSTFLAGS="-D warnings" TOCK_KERNEL_VERSION=ci_test cargo test
@cd capsules/extra && NOWARNINGS=true RUSTFLAGS="-D warnings" TOCK_KERNEL_VERSION=ci_test cargo test
@cd capsules/system && NOWARNINGS=true RUSTFLAGS="-D warnings" TOCK_KERNEL_VERSION=ci_test cargo test

.PHONY: ci-job-chips
ci-job-chips:
Expand Down
12 changes: 6 additions & 6 deletions capsules/core/src/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let adc_channels = static_init!(
Expand All @@ -40,13 +40,13 @@
//! ]
//! );
//! let adc = static_init!(
//! capsules::adc::AdcDedicated<'static, sam4l::adc::Adc>,
//! capsules::adc::AdcDedicated::new(
//! capsules_core::adc::AdcDedicated<'static, sam4l::adc::Adc>,
//! capsules_core::adc::AdcDedicated::new(
//! &mut sam4l::adc::ADC0,
//! adc_channels,
//! &mut capsules::adc::ADC_BUFFER1,
//! &mut capsules::adc::ADC_BUFFER2,
//! &mut capsules::adc::ADC_BUFFER3
//! &mut capsules_core::adc::ADC_BUFFER1,
//! &mut capsules_core::adc::ADC_BUFFER2,
//! &mut capsules_core::adc::ADC_BUFFER3
//! )
//! );
//! sam4l::adc::ADC0.set_client(adc);
Expand Down
6 changes: 3 additions & 3 deletions capsules/core/src/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let button_pins = static_init!(
//! [&'static sam4l::gpio::GPIOPin; 1],
//! [&sam4l::gpio::PA[16]]);
//! let button = static_init!(
//! capsules::button::Button<'static>,
//! capsules::button::Button::new(button_pins, board_kernel.create_grant(&grant_cap)));
//! capsules_core::button::Button<'static>,
//! capsules_core::button::Button::new(button_pins, board_kernel.create_grant(&grant_cap)));
//! for btn in button_pins.iter() {
//! btn.set_client(button);
//! }
Expand Down
4 changes: 2 additions & 2 deletions capsules/core/src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
//!
//! You need a device that provides the `hil::uart::UART` trait.
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//! # use capsules::console::Console;
//! # use capsules_core::console::Console;
//!
//! let console = static_init!(
//! Console<usart::USART>,
Expand Down
2 changes: 1 addition & 1 deletion capsules/core/src/console_ordered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
//! reasonable. ATOMIC_SIZE should be at least 80 (row width
//! of a standard console).
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//! # use capsules_core::console_ordered::ConsoleOrdered;
//! let console = static_init!(
Expand Down
6 changes: 3 additions & 3 deletions capsules/core/src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let gpio_pins = static_init!(
Expand All @@ -25,8 +25,8 @@
//! Option<&sam4l::gpio::PB[11]>,
//! Option<&sam4l::gpio::PB[12]>]);
//! let gpio = static_init!(
//! capsules::gpio::GPIO<'static, sam4l::gpio::GPIOPin>,
//! capsules::gpio::GPIO::new(gpio_pins));
//! capsules_core::gpio::GPIO<'static, sam4l::gpio::GPIOPin>,
//! capsules_core::gpio::GPIO::new(gpio_pins));
//! for maybe_pin in gpio_pins.iter() {
//! if let Some(pin) = maybe_pin {
//! pin.set_client(gpio);
Expand Down
6 changes: 3 additions & 3 deletions capsules/core/src/led.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let led_pins = static_init!(
Expand All @@ -25,8 +25,8 @@
//! (&sam4l::gpio::PA[15], kernel::hil::gpio::ActivationMode::ActiveLow), // Green
//! (&sam4l::gpio::PA[14], kernel::hil::gpio::ActivationMode::ActiveLow)]); // Blue
//! let led = static_init!(
//! capsules::led::LED<'static, sam4l::gpio::GPIOPin>,
//! capsules::led::LED::new(led_pins));
//! capsules_core::led::LED<'static, sam4l::gpio::GPIOPin>,
//! capsules_core::led::LED::new(led_pins));
//! ```
//!
//! Syscall Interface
Expand Down
2 changes: 1 addition & 1 deletion capsules/core/src/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let rng = static_init!(
Expand Down
10 changes: 5 additions & 5 deletions capsules/core/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ macro_rules! stream_from_option {
/// would result in it defaulting to 0. Idiomatically, the way to combine
/// encoders is to define another encoder as follows:
///
/// ```rust
/// # use capsules::{enc_try, stream_done};
/// # use capsules::net::stream::SResult;
/// ```rust,ignore
/// # use capsules_core::{enc_try, stream_done};
/// # use capsules_core::stream::{SResult};
///
/// // call a simple encoder
/// let (bytes, out1) = enc_try!(buf; encoder1);
Expand All @@ -157,8 +157,8 @@ macro_rules! stream_from_option {
///
/// Then, using an encoder can be done simply by:
///
/// ```
/// # use capsules::net::stream::SResult;
/// ```rust,ignore
/// # use capsules_core::stream::SResult;
///
/// match encoder(&mut buf) {
/// SResult::Done(off, out) => { /* celebrate */ }
Expand Down
2 changes: 1 addition & 1 deletion capsules/core/src/test/capsule_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//!
//! A simple example of a test capsule using this interface:
//!
//! ```rust
//! ```rust,ignore
//! pub struct TestSensorX {
//! client: OptionalCell<&'static dyn CapsuleTestClient>,
//! }
Expand Down
6 changes: 3 additions & 3 deletions capsules/core/src/virtualizers/virtual_aes_ccm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
//! Usage
//! -----
//!
//! ```rust
//! # use capsules::test::aes_ccm::Test;
//! # use capsules::virtual_aes_ccm;
//! ```rust,ignore
//! # use capsules_core::test::aes_ccm::Test;
//! # use capsules_core::virtual_aes_ccm;
//! # use kernel::common::deferred_call::DeferredCallClient;
//! # use kernel::hil::symmetric_encryption::{AES128, AES128CCM, AES128_BLOCK_SIZE};
//! # use kernel::static_init;
Expand Down
10 changes: 5 additions & 5 deletions capsules/core/src/virtualizers/virtual_flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
//! Usage
//! -----
//!
//! ```
//! ```rust,ignore
//! # use kernel::{hil, static_init};
//!
//! // Create the mux.
//! let mux_flash = static_init!(
//! capsules::virtual_flash::MuxFlash<'static, sam4l::flashcalw::FLASHCALW>,
//! capsules::virtual_flash::MuxFlash::new(&sam4l::flashcalw::FLASH_CONTROLLER));
//! capsules_core::virtual_flash::MuxFlash<'static, sam4l::flashcalw::FLASHCALW>,
//! capsules_core::virtual_flash::MuxFlash::new(&sam4l::flashcalw::FLASH_CONTROLLER));
//! hil::flash::HasClient::set_client(&sam4l::flashcalw::FLASH_CONTROLLER, mux_flash);
//!
//! // Everything that then uses the virtualized flash must use one of these.
//! let virtual_flash = static_init!(
//! capsules::virtual_flash::FlashUser<'static, sam4l::flashcalw::FLASHCALW>,
//! capsules::virtual_flash::FlashUser::new(mux_flash));
//! capsules_core::virtual_flash::FlashUser<'static, sam4l::flashcalw::FLASHCALW>,
//! capsules_core::virtual_flash::FlashUser::new(mux_flash));
//! ```
use core::cell::Cell;
Expand Down
10 changes: 5 additions & 5 deletions capsules/core/src/virtualizers/virtual_pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
//! Usage
//! -----
//!
//! ```
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let mux_pwm = static_init!(
//! capsules::virtual_pwm::MuxPwm<'static, nrf52::pwm::Pwm>,
//! capsules::virtual_pwm::MuxPwm::new(&base_peripherals.pwm0)
//! capsules_core::virtual_pwm::MuxPwm<'static, nrf52::pwm::Pwm>,
//! capsules_core::virtual_pwm::MuxPwm::new(&base_peripherals.pwm0)
//! );
//! let virtual_pwm_buzzer = static_init!(
//! capsules::virtual_pwm::PwmPinUser<'static, nrf52::pwm::Pwm>,
//! capsules::virtual_pwm::PwmPinUser::new(mux_pwm, nrf5x::pinmux::Pinmux::new(31))
//! capsules_core::virtual_pwm::PwmPinUser<'static, nrf52::pwm::Pwm>,
//! capsules_core::virtual_pwm::PwmPinUser::new(mux_pwm, nrf5x::pinmux::Pinmux::new(31))
//! );
//! virtual_pwm_buzzer.add_to_mux();
//! ```
Expand Down
14 changes: 7 additions & 7 deletions capsules/core/src/virtualizers/virtual_uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::{hil, static_init};
//! # use capsules::virtual_uart::{MuxUart, UartDevice};
//! # use capsules_core::virtual_uart::{MuxUart, UartDevice};
//!
//! // Create a shared UART channel for the console and for kernel debug.
//! let uart_mux = static_init!(
//! MuxUart<'static>,
//! MuxUart::new(&sam4l::usart::USART0, &mut capsules::virtual_uart::RX_BUF)
//! MuxUart::new(&sam4l::usart::USART0, &mut capsules_core::virtual_uart::RX_BUF)
//! );
//! hil::uart::UART::set_receive_client(&sam4l::usart::USART0, uart_mux);
//! hil::uart::UART::set_transmit_client(&sam4l::usart::USART0, uart_mux);
Expand All @@ -33,11 +33,11 @@
//! let console_uart = static_init!(UartDevice, UartDevice::new(uart_mux, true));
//! console_uart.setup(); // This is important!
//! let console = static_init!(
//! capsules::console::Console<'static>,
//! capsules::console::Console::new(
//! capsules_core::console::Console<'static>,
//! capsules_core::console::Console::new(
//! console_uart,
//! &mut capsules::console::WRITE_BUF,
//! &mut capsules::console::READ_BUF,
//! &mut capsules_core::console::WRITE_BUF,
//! &mut capsules_core::console::READ_BUF,
//! board_kernel.create_grant(&grant_cap)
//! )
//! );
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/air_quality.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//!
//! You need a device that provides the `hil::sensors::AirQualityDriver` trait.
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let grant_cap = create_capability!(capabilities::MemoryAllocationCapability);
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/ambient_light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//!
//! You need a device that provides the `hil::sensors::AmbientLight` trait.
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::{hil, static_init};
//!
//! let light = static_init!(
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/analog_comparator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let ac_channels = static_init!(
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/apds9960.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! let apds9960_i2c = static_init!(
//! capsules::virtual_i2c::I2CDevice,
//! capsules::virtual_i2c::I2CDevice::new(sensors_i2c_bus, 0x39)
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/app_flash_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! Usage
//! -----
//!
//! ```
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let app_flash_buffer = static_init!([u8; 512], [0; 512]);
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/at24c_eeprom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! let i2cmux = I2CMuxComponent::new(i2c0, None).finalize(components::i2c_mux_component_static!());
//!
//! let at24c_buffer = static_init!([u8; 34], [0; 34]);
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/ble_advertising_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
//! You need a device that provides the `kernel::BleAdvertisementDriver` trait along with a virtual
//! timer to perform events and not block the entire kernel
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//! # use capsules::virtual_alarm::VirtualMuxAlarm;
//!
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/bmm150.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//! //! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let bmm150_i2c = static_init!(
Expand Down
4 changes: 2 additions & 2 deletions capsules/extra/src/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
//! -----
//!
//! I2C example
//! ```rust
//! ```rust,ignore
//! let bus = components::bus::I2CMasterBusComponent::new(i2c_mux, address)
//! .finalize(components::spi_bus_component_helper!());
//! ```
//!
//! SPI example
//! ```rust
//! ```rust,ignore
//! let bus =
//! components::bus::SpiMasterBusComponent::new().finalize(components::spi_bus_component_helper!(
//! // spi type
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/buzzer_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let virtual_pwm_buzzer = static_init!(
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/buzzer_pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! Instantiate the capsule for use as a service capsule, using a virtual pwm buzzer
//! and a virtual alarm. For example:
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let mux_pwm = static_init!(
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/can.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
//! -----
//!
//! You need a driver that implements the Can trait.
//! ```rust
//! ```rust,ignore
//! let grant_cap = create_capability!(capabilities::MemoryAllocationCapability);
//! let grant_can = self.board_kernel.create_grant(
//! capsules::can::CanCapsule::DRIVER_NUM, &grant_cap);
Expand Down
4 changes: 2 additions & 2 deletions capsules/extra/src/crc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! client of the hardware implementation. For example, using the SAM4L's `CrcU`
//! driver:
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let crc_buffer = static_init!([u8; 64], [0; 64]);
Expand Down Expand Up @@ -131,7 +131,7 @@ impl<'a, C: Crc<'a>> CrcDriver<'a, C> {
///
/// ## Example
///
/// ```rust
/// ```rust,ignore
/// capsules::crc::Crc::new(&sam4l::crccu::CrcCU, board_kernel.create_grant(&grant_cap));
/// ```
///
Expand Down
2 changes: 1 addition & 1 deletion capsules/extra/src/dac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! Usage
//! -----
//!
//! ```rust
//! ```rust,ignore
//! # use kernel::static_init;
//!
//! let dac = static_init!(
Expand Down
Loading

0 comments on commit 79cc869

Please sign in to comment.