We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6462074 commit fc31f32Copy full SHA for fc31f32
src/main.rs
@@ -1,8 +1,17 @@
1
#![no_std]
2
-#![no_main]
+#![cfg_attr(not(test), no_main)] // #![no_main] interfers with 'cargo test' when targeting the host machine.
3
4
extern crate avr_std_stub;
5
6
#[no_mangle]
7
+#[cfg(not(test))] // The main function interfers with 'cargo test' when targeting the host machine.
8
fn main() {
9
}
10
+
11
+#[cfg(test)]
12
+mod test {
13
+ #[test]
14
+ fn test_foo() {
15
+ assert_eq!(1, 1);
16
+ }
17
+}
0 commit comments