File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 2
2
//!
3
3
//! Example usage:
4
4
//!
5
- //! ```no_run
5
+ #![ cfg_attr( feature = "52840" , doc = "```no_run" ) ]
6
+ #![ cfg_attr( not( feature = "52840" ) , doc = "```ignore" ) ]
6
7
//! # use nrf_hal_common as hal;
7
8
//! # use hal::pac::{saadc, SAADC};
8
9
//! // subsititute `hal` with the HAL of your board, e.g. `nrf52840_hal`
@@ -115,7 +116,8 @@ pub struct SaadcConfig {
115
116
/// Default SAADC configuration. 0 volts reads as 0, VDD volts reads as `u16::MAX`.
116
117
/// The returned SaadcConfig is configured with the following values:
117
118
///
118
- /// ```rust
119
+ #[ cfg_attr( feature = "52840" , doc = "```" ) ]
120
+ #[ cfg_attr( not( feature = "52840" ) , doc = "```ignore" ) ]
119
121
/// # use nrf_hal_common::saadc::SaadcConfig;
120
122
/// # use nrf_hal_common::pac::{saadc, SAADC};
121
123
/// # use saadc::{
Original file line number Diff line number Diff line change @@ -47,6 +47,24 @@ fn main() {
47
47
) ;
48
48
}
49
49
50
+ // Build/Run doc-tests in `nrf-hal-common` for each chip.
51
+ for ( hal, _) in HALS {
52
+ let feature = hal. trim_start_matches ( "nrf" ) . trim_end_matches ( "-hal" ) ;
53
+
54
+ let mut cargo = Command :: new ( "cargo" ) ;
55
+ let status = cargo
56
+ . current_dir ( "nrf-hal-common" )
57
+ . args ( & [ "test" , "--features" , feature] )
58
+ . status ( )
59
+ . map_err ( |e| format ! ( "could not execute {:?}: {}" , cargo, e) )
60
+ . unwrap ( ) ;
61
+ assert ! (
62
+ status. success( ) ,
63
+ "command exited with error status: {:?}" ,
64
+ cargo
65
+ ) ;
66
+ }
67
+
50
68
// Build-test every example with each supported feature.
51
69
for ( example, features) in EXAMPLES {
52
70
// Features are exclusive (they select the target chip), so we test each one
You can’t perform that action at this time.
0 commit comments