-
Notifications
You must be signed in to change notification settings - Fork 29
macro "describe!" is not defined! #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Stainless is a compiler plugin so you need to enable it. Did you add the two lines that every file in the |
I added those two lines add #![feature(plugin)] to the crates attributes - is what the compiler still wants...I did but nothing changed? Still missing something? |
I have the following in my project:
https://github.com/ujh/iomrascalai/blob/master/src/main.rs#L24 |
Hm I really have difficulties with this configuration. |
Sure! |
tests.rs
renderay_core.rs
|
I haven't tried compiling this so I may be wrong. But here are my observations:
|
Hm no nothing - just can't get it to work with the above code... |
Hm, maybe this is the wrong place anyway. How about we switch to forum.rustplatz.de? |
@xetra11 you have a typo in #![cfg_attr(tests, plugin(stainless))] should be #![cfg_attr(test, plugin(stainless))] |
I thought test would reference to my tests.rs file? What does test reference to? Sorry to spam your issues - but mybe it'll help future users ? I hope so :) |
No, file names only name modules. What you want is the |
BTW, that also means that you need to compile and run the tests via Cargo. But doing anything else is wasted effort in Rust anyway. |
AND those two lines from my program are useful only when you compile the tests together with your code base. Not when you build a library and use it as an external crate. Then you should use the configuration from the |
Sorry I have to spam this but I really really want this to work (I love TDD) I have in my src/ folder test.rs and renderay_core.rs test.rs
renderay_core.rs
What is the way to get this to work with those two files and the folder structure of .../src/test.rs & .../src/rendera_core.rs Thanks for you help guys I really apprectiate your time! Charlie |
No worries. :)
|
BTW, has the error message changed in the meantime? |
Cargo.toml
In the test.rs I get an error for this line #![plugin(stainless)] (add [features(plugin)] to the crates attributes to enable) the example with compiling them together you wrote ("mod tests;") what does tests refer to? The filename of tests.rs (ergo "tests") or the signature of "mod tests {}" which is wrapping around my test code? And where do I need to declare "mod tests;" to make it work? As I said before you can have those plugin, etc. configurations only once per crate. They need to go into the main file you hand to rustc Charlie |
OK ... There's a lot to explain here. Can I steal your code (with attribution of course) and write a blog post explaining it all? It may take me a day or two but I think that would be more useful. |
I hope that this explains it all: http://bettong.net/2016/03/09/rust-testing-with-stainless/ |
Sure you can! Thanks for your time! I'll gonna share that blog post for sure! |
great blog now everything works! Thank you! |
You're welcome. Now I understand this even better and I have new content for my blog. Everyone wins. 😁👌 |
Hey there,
Sorry for this maybe pretty trivial question but I'm new to Rust and want to start my first project with TDD and therefore your crate right away.
I have Multirust and rust nightly 1.9.0
and your stainless 1.4.0
Its compiling fine but running a test (which I tested before using stainless - worked fine) will fail due the undefined macro "describe!". Racer also tells me its not defined on the run.
Can sb. please give me a hint what I'm missing here?
greets
Charlie
The text was updated successfully, but these errors were encountered: