crabtw/rust-bindgen — pull request #144 by chris-chambers (2014-12-29 22:37:34+00:00)
Title: Adds support for function prototypes, improves tests.

Fixes #79. Fixes #100.

Cargo.toml
- Adds `[[test]]` section pointing to tests.rs, where all former tests are
now imported as modules (cf Servo's tests).

gen.rs
- Breaks up `TFunc` handling into `TFuncPtr` and `TFuncProto`.
- Eliminates empty `extern "C" { }` block that was sometimes generated.

lib.rs
- Eliminates `dead_code` warnings and one about `LinkType` being able to
implement `Copy`.

parser.rs
- Breaks up function handling into `TFuncPtr` and `TFuncProto`.
- Uses the `FuncSig` type to capture information about function
signatures.
- Adds support for pointers to arrays at the global scope.

types.rs
- Adds types related to function prototype and pointer handling:
`FuncSig`, `TFuncPtr` and `TFuncProto`.

tests
- Adds quote-based testing. Using the `assert_bind_eq!` macro, it is
now possible--without too much ceremony--to test bindgen output of an
input file against inline source created with the `quote_item!` (and
other `quote_*` macros).
- Removes stringify-based testing.
- Combines test running into a single entry point, `test.rs`.
- Shortens test names where possible without losing context.