summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2017-01-26Added test for forward declared complex typesNikhil Shagrithaya
2017-01-26Forward declared structs now generate opaque enumsNikhil Shagrithaya
2017-01-24Auto merge of #437 - emilio:constify-all-enums, r=fitzgenbors-servo
codegen: Respect original repr for bitfield-like enums, add a constifying variant. r? @fitzgen Fixes #430
2017-01-24Auto merge of #434 - emilio:no-derive-debug, r=fitzgenbors-servo
Honor and expose the derive_debug option. Fixes #432 r? @fitzgen
2017-01-24Honor and expose the derive_debug option.Emilio Cobos Álvarez
Fixes #432
2017-01-24codegen: Respect original repr for bitfield-like enums, add a constifying ↵Emilio Cobos Álvarez
variant.
2017-01-24codegen: don't generate extra use statements for non-enums.Emilio Cobos Álvarez
There's just no advantage in doing so.
2017-01-24Make it work in rust stable, and incidentally fix #425Emilio Cobos Álvarez
The problem with #425 was the following: We were parsing the methods after reaching the JS::Value definition. Those methods contained a JSWhyMagic that we hadn't seen, so we parsed it as being in the JS:: module.
2017-01-24codegen: Fix typedef re-export in namespaces when bindings aren't at the root.Emilio Cobos Álvarez
2017-01-23Move new test files out of libbindgenNick Fitzgerald
2017-01-23Unify under the `bindgen` name.Emilio Cobos Álvarez
2016-11-16Multiple constant generation evaluation improvements.Emilio Cobos Álvarez
2016-11-16clang: Evaluate more complex constant expressions in variables.Emilio Cobos Álvarez
2016-11-16Transition to libbindgen sub-crateJeff Waugh
- The root crate is the `bindgen` binary - Rust-ify the test suite, no more subprocesses! - Update Travis config to test both crates
2016-11-15Auto merge of #255 - emilio:type-alias, r=fitzgenbors-servo
Template alias full and partial specialization improvements. This doesn't completely fix #251, but fixes other related problems. r? @fitzgen
2016-11-15ir: Explicitly discard specialized templated type aliases as already resolved.Emilio Cobos Álvarez
2016-11-14codegen: Always implement debug for __BindgenUnionField.Emilio Cobos Álvarez
Our debug-detection code assumes so. Fixes #246 r? @fitzgen
2016-11-14Auto merge of #247 - emilio:macro-redef, r=fitzgenbors-servo
Handle macro redefinition a bit more graciously. r? @fitzgen
2016-11-13Handle macro redefinition a bit more graciously.Emilio Cobos Álvarez
2016-11-13codegen: Special-case i64::MIN since it produces a overflow on aster.Emilio Cobos Álvarez
Proper fix on aster soon, still worth to get this in I guess. r? @fitzgen
2016-11-11Auto merge of #240 - fitzgen:overloads, r=emiliobors-servo
Add support for bindings to overloaded functions This commit (re)adds support for generating bindings to overloaded functions. First, we use the symbol name instead of the canonical name when checking if we have already generated bindings for a given function. Second, we add a map from canonical names to number of times we have generated a function with that canonical name. We increment this number every time we generate a function. When the number is greater than zero, we append it to the function name so that overloaded functions get a unique Rust symbol. Fixes #239 r? @emilio
2016-11-11Add support for bindings to overloaded functionsNick Fitzgerald
This commit (re)adds support for generating bindings to overloaded functions. First, we use the symbol name instead of the canonical name when checking if we have already generated bindings for a given function. Second, we add a map from canonical names to number of times we have generated a function with that canonical name. We increment this number every time we generate a function. When the number is greater than zero, we append it to the function name so that overloaded functions get a unique Rust symbol.
2016-11-11Use __BindegenComplex for C Complex Fix #72Jean-Philippe DUFRAIGNE
C complex only exists for floating point types. C Complex are built in types long double _Complex is not supported. Long double would be an f128, runing generated binding test produces: assertion failed: `(left == right)` (left: `16`, right: `32`)', tests/expectations/tests/complex.rs:72 We test global long double _Complex because it does not require layout tests. Handle all the different way a complex can be present in BindgenContext calling generated_bindegen_complex to indicate that __BindgenContext will need to be added.
2016-11-11Auto merge of #233 - fitzgen:float128, r=emiliobors-servo
Add rudimentary support for `__float128` This adds `__float128` as a builtin type, and generates an opaque array of 16 `u8`s to represent it in the generated bindings since Rust doesn't have an `f128` type. Context and motivation: Somehow `__float128` is getting pulled into SpiderMonkey headers from somewhere, and the lack of `__float128` support was causing bindgen to hard fail in bindings generation. r? @emilio
2016-11-11Add rudimentary support for `__float128`Nick Fitzgerald
This adds `__float128` as a builtin type, and generates an opaque array of 16 `u8`s to represent it in the generated bindings since Rust doesn't have an `f128` type. Context and motivation: Somehow `__float128` is getting pulled into SpiderMonkey headers from somewhere, and the lack of `__float128` support was causing bindgen to hard fail in bindings generation.
2016-11-11ir: Search for compound structures when we have unexposed type and base ↵Emilio Cobos Álvarez
class cursor. And it's not a valid identifier as a template parameter. See the comment and the tests for details.
2016-11-08Auto merge of #219 - emilio:macros, r=fitzgenbors-servo
Parse macro expressions. Clang is trolling me really hard so I'm going to see if the extra token I'm always getting is LLVM 3.9 specific.
2016-11-08Parse macros with cexpr.Emilio Cobos Álvarez
2016-11-08codegen: Simplify bitfield logic a bit, make it work for unnamed enums, generateEmilio Cobos Álvarez
default BitOr implementation.
2016-11-08Moar tests.Emilio Cobos Álvarez
2016-11-08Fix --use-core for functions, since we used the aster helper.Emilio Cobos Álvarez
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>
2016-11-07Auto merge of #221 - emilio:dont-override-float, r=fitzgenbors-servo
Add an option to avoid converting to f32/f64 automatically float types. This implements another feature that we need for parity with upstream bindgen. r? @fitzgen
2016-11-07Add an option to avoid converting to f32/f64 automatically float types.Emilio Cobos Álvarez
2016-11-06Test for ctypes-prefix, and use-core without libstd.Emilio Cobos Álvarez
2016-11-06Test for --use-core.Emilio Cobos Álvarez
2016-11-05Speed up integration tests (move building expectations)Jean-Philippe DUFRAIGNE
Speed up running 'cargo test': -Before: 2'17s -After: 30s Update to use new path: Makefile, .travis.yml, CONTRIBUTING.md, tests/tests.rs Delete unused expectation that fail to compile: tests/expectations/moar_bitfields.rs tests/expectations/variadic_template_args.rs For every 'cargo test' run, the bindgen output where built. We already test that the bindgen output match expectations/*.rs, so there is no need to check it build unless the expectation is updated. Move tests/expectations/*.rs to tests/expectations/tests/*.rs and make tests/expectations a new dev-dependency package. This allow running: - cargo test -p tests_expectations In addition to the speed up, we also get a clean output for the build and test run. In particular, a number of warnings are generated that should probably be silenced, and eventually enforced modifying travis to build: - RUSTFLAGS='-D warnings' cargo test -p tests_expectations The benefit of having it as a new package is that it avoid polluting the 'cargo test' output that should focus on bindgen.
2016-11-03Allow template aliases to be considered for replacementNick Fitzgerald
2016-11-02Auto merge of #194 - emilio:template-args, r=fitzgenbors-servo
clang: Some partially specialized templates return no template argument count. Trying to construct a test case, meanwhile: r? @fitzgen
2016-11-02clang: Some partially specialized templates return no template argument count.Emilio Cobos Álvarez
2016-11-02Generate dummy uses when running our test suiteNick Fitzgerald
This extends the test runner to generate dummy C/C++ uses of the whitelisted types in a test header in the tests/uses/ directory. It does not yet compile the dummy uses into an object file whose DWARF debug info can be compared against our Rust bindings' DWARF debug info. Part of #151.
2016-11-01Use `BindgenContext::whitelisted_items` in code generationNick Fitzgerald
This replaces the manual gathering and traversal of the transitive closure of whitelisted items with the new canonical method.
2016-11-01Always run tests with RUST_BACKTRACE=1Nick Fitzgerald
2016-11-01tests: Get rid of feature-specific tests.Emilio Cobos Álvarez
The only difference in bindings is because the methods were inlined, so with llvm 3.9 we can skip those. Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>
2016-10-31Auto merge of #176 - fitzgen:release-tests, r=emiliobors-servo
Run tests on release builds This makes `cargo test` test the appropriate release/debug bindgen binary and extends Travis CI testing to also test release builds. r? @emilio
2016-10-31Use the appropriate debug/release bindgen binary in testsNick Fitzgerald
2016-10-31Fix a small typo and expand batching commentNick Fitzgerald
2016-10-30Run test in parallel batchesJean-Philippe DUFRAIGNE
Follow review suggestion to use chunks to run test in parallel. Set default to 16 which works well even on my limited laptop, and which should benefit better machine. To run with a different batch size: BINDGEN_TEST_BATCH_SIZE=32 cargo test On my machine: 1 parallel test takes 3'53 2 parallel test takes 2'10 8 parallel test takes 2'08 32 parallel test takes 2'07
2016-10-29Add test for #67Emilio Cobos Álvarez
2016-10-29Add a test for elaborated types.Emilio Cobos Álvarez
After the rewrite, this works. Fixes #3
2016-10-29ty: Don't bailout if we don't have any template type in the aliased template ↵Emilio Cobos Álvarez
parameter case.