rust-embedded / msp430-rt

Minimal startup / runtime for MSP430 microcontrollers
Apache License 2.0
15 stars 4 forks source link

Add trybuild tests for macros #17

Closed YuhanLiin closed 2 years ago

YuhanLiin commented 2 years ago

Add trybuild tests for the proc macros to ensure the correct error messages are emitted. These tests cover the cases where the build fails, while existing doctests cover the cases where the build succeeds. GitHub actions has also been added to run the macro tests.

Most of the export_name attributes have been replaced with no_mangle, because export_name causes the compiler to not emit a name conflict error when there are two functions using the same proc macro, at least until link time. no_mangle leads to error messages that are easier to test.

cr1901 commented 2 years ago

LGTM and compiles locally without any changes on AT2XT (as a test). Tyvm for doing this :)!