@@ -90,22 +90,16 @@ struct Registers {
90
90
}
91
91
```
92
92
93
- By default, ` std ` unit tests for the struct are generated as well (that is,
94
- tests attributed with ` #[test] ` ). The unit tests make sure that the offsets and
95
- padding are consistent with the actual fields in the struct, and that alignment
96
- is correct.
97
-
98
- Since those tests would break compilation in ` custom-test-frameworks `
99
- environments, it is possible to opt out of the test generation. To do
100
- so, disable the default feature set containing the ` std_unit_tests `
101
- feature:
102
-
103
- ``` toml
104
- [dependencies .tock-registers ]
105
- version = " 0.4.x"
106
- default-features = false
107
- features = [" register_types" ]
108
- ```
93
+ This crate will generate additional, compile time (` const ` ) assertions
94
+ to validate various invariants of the register structs, such as
95
+
96
+ - proper start offset of padding fields,
97
+ - proper start and end offsets of actual fields,
98
+ - invalid alignment of field types,
99
+ - the ` @END ` marker matching the size of the struct.
100
+
101
+ For more information on the generated assertions, check out the [ ` test_fields! `
102
+ macro documentation] ( https://docs.tockos.org/tock_registers/macro.test_fields.html ) .
109
103
110
104
By default, the visibility of the generated structs and fields is private. You
111
105
can make them public using the ` pub ` keyword, just before the struct name or the
0 commit comments