mardi 27 janvier 2015

Testing crates with #![no_std]

I'm writing a runtime for a programming language implementation in rust. I'm planning on linking in this runtime with the compiled code I generate, so I don't want to rely on std to keep the binary small. The problem is, when I try to cargo test my runtime, I get errors saying saying that std::slice::AsSlice can't be found, which after some googling I found out is because some of the test harness requires std library code.


Does anyone have any suggestions for how to go about testing this code? Is there a way to conditionally include the #![no_std] pragma, i.e. still include the std library while testing? I've also tried creating a separate test crate with std library included, extern crateing the runtime crate into it and running my tests there, but that has introduced a whole new set of issues.


Aucun commentaire:

Enregistrer un commentaire