Rust-SDL2 / rust-sdl2

SDL2 bindings for Rust
MIT License
2.66k stars 465 forks source link

Improved test suite #388

Open AngryLawyer opened 9 years ago

AngryLawyer commented 9 years ago

As the name suggests, things that can be tested, should be tested, even if it's just to blow smoke through the system.

flukejones commented 7 years ago

How far do we need to go with this? I've been enjoying writing docs and tests for my own stuff, so I thought I might tackle this to try get us on the road to 1.0.0 faster.

The tests should include ones that will break until the required feature is implemented - likely this will require trawling the SDL2 documentation.

From looking at what is already done and comparing the SDL2 calls made, it looks like everything aims to be a thin (safe) layer between rust and SDL2, meaning that functionality should be an almost exact carbon copy where possible. How's my aim?

Cobrand commented 7 years ago

The tests should include ones that will break until the required feature is implemented - likely this will require trawling the SDL2 documentation.

I don't quite get what you're saying here, could you explain a bit more ? Mayve you have an example ?

This issue is clear enough I guess, you should test everything that can be tested. It's not easy since this crate manipulates a X window on Linux and making tests that uses anything graphic will break travis, but there are things that you can still test without owning a window. (For instance everything Surface``-related, but there are others).

flukejones commented 7 years ago

Hmm, as in write tests for unimplemented features that need to be implemented; since they aren't implemented, the tests will break. Sorry, I was a bit sleepy while writing that. I think the analogy for that is essentially test driven development.