summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--.travis.yml7
-rw-r--r--CONTRIBUTING.md48
-rw-r--r--Cargo.toml42
-rw-r--r--Makefile34
-rw-r--r--libbindgen/Cargo.toml54
-rw-r--r--libbindgen/build.rs (renamed from build.rs)0
-rw-r--r--libbindgen/src/chooser.rs (renamed from src/chooser.rs)0
-rw-r--r--[-rwxr-xr-x]libbindgen/src/clang.rs (renamed from src/clang.rs)0
-rw-r--r--libbindgen/src/clangll.rs (renamed from src/clangll.rs)0
-rw-r--r--libbindgen/src/codegen/helpers.rs (renamed from src/codegen/helpers.rs)0
-rw-r--r--[-rwxr-xr-x]libbindgen/src/codegen/mod.rs (renamed from src/codegen/mod.rs)0
-rw-r--r--libbindgen/src/ir/annotations.rs (renamed from src/ir/annotations.rs)0
-rw-r--r--libbindgen/src/ir/comp.rs (renamed from src/ir/comp.rs)0
-rw-r--r--libbindgen/src/ir/context.rs (renamed from src/ir/context.rs)0
-rw-r--r--libbindgen/src/ir/enum_ty.rs (renamed from src/ir/enum_ty.rs)0
-rw-r--r--libbindgen/src/ir/function.rs (renamed from src/ir/function.rs)0
-rw-r--r--libbindgen/src/ir/int.rs (renamed from src/ir/int.rs)0
-rw-r--r--libbindgen/src/ir/item.rs (renamed from src/ir/item.rs)0
-rw-r--r--libbindgen/src/ir/item_kind.rs (renamed from src/ir/item_kind.rs)0
-rw-r--r--libbindgen/src/ir/layout.rs (renamed from src/ir/layout.rs)0
-rw-r--r--libbindgen/src/ir/mod.rs (renamed from src/ir/mod.rs)0
-rw-r--r--libbindgen/src/ir/module.rs (renamed from src/ir/module.rs)0
-rw-r--r--libbindgen/src/ir/ty.rs (renamed from src/ir/ty.rs)0
-rw-r--r--libbindgen/src/ir/type_collector.rs (renamed from src/ir/type_collector.rs)0
-rw-r--r--libbindgen/src/ir/var.rs (renamed from src/ir/var.rs)0
-rw-r--r--[-rwxr-xr-x]libbindgen/src/lib.rs (renamed from src/lib.rs)3
-rw-r--r--libbindgen/src/parse.rs (renamed from src/parse.rs)0
-rw-r--r--libbindgen/src/regex_set.rs (renamed from src/regex_set.rs)0
-rw-r--r--libbindgen/src/uses.rs (renamed from src/uses.rs)0
-rw-r--r--libbindgen/tests/expectations/Cargo.toml (renamed from tests/expectations/Cargo.toml)0
-rw-r--r--libbindgen/tests/expectations/src/lib.rs (renamed from tests/expectations/src/lib.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/accessors.rs (renamed from tests/expectations/tests/accessors.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/annotation_hide.rs (renamed from tests/expectations/tests/annotation_hide.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/anon_enum.rs (renamed from tests/expectations/tests/anon_enum.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/anon_enum_whitelist.rs (renamed from tests/expectations/tests/anon_enum_whitelist.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/anon_union.rs (renamed from tests/expectations/tests/anon_union.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/arg_keyword.rs (renamed from tests/expectations/tests/arg_keyword.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/base-to-derived.rs (renamed from tests/expectations/tests/base-to-derived.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/bitfield-enum-basic.rs (renamed from tests/expectations/tests/bitfield-enum-basic.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/blocks.rs (renamed from tests/expectations/tests/blocks.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/class.rs (renamed from tests/expectations/tests/class.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/class_nested.rs (renamed from tests/expectations/tests/class_nested.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/class_no_members.rs (renamed from tests/expectations/tests/class_no_members.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/class_static.rs (renamed from tests/expectations/tests/class_static.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/class_static_const.rs (renamed from tests/expectations/tests/class_static_const.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/class_use_as.rs (renamed from tests/expectations/tests/class_use_as.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/class_with_dtor.rs (renamed from tests/expectations/tests/class_with_dtor.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/class_with_inner_struct.rs (renamed from tests/expectations/tests/class_with_inner_struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/class_with_typedef.rs (renamed from tests/expectations/tests/class_with_typedef.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/complex.rs (renamed from tests/expectations/tests/complex.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/complex_global.rs (renamed from tests/expectations/tests/complex_global.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/const_enum_unnamed.rs (renamed from tests/expectations/tests/const_enum_unnamed.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/const_ptr.rs (renamed from tests/expectations/tests/const_ptr.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/const_resolved_ty.rs (renamed from tests/expectations/tests/const_resolved_ty.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/const_tparam.rs (renamed from tests/expectations/tests/const_tparam.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/convert-floats.rs (renamed from tests/expectations/tests/convert-floats.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/crtp.rs (renamed from tests/expectations/tests/crtp.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/decl_extern_int_twice.rs (renamed from tests/expectations/tests/decl_extern_int_twice.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/decl_ptr_to_array.rs (renamed from tests/expectations/tests/decl_ptr_to_array.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/duplicated_constants_in_ns.rs (renamed from tests/expectations/tests/duplicated_constants_in_ns.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/elaborated.rs (renamed from tests/expectations/tests/elaborated.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/empty_template_param_name.rs (renamed from tests/expectations/tests/empty_template_param_name.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/enum.rs (renamed from tests/expectations/tests/enum.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/enum_alias.rs (renamed from tests/expectations/tests/enum_alias.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/enum_and_vtable_mangling.rs (renamed from tests/expectations/tests/enum_and_vtable_mangling.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/enum_dupe.rs (renamed from tests/expectations/tests/enum_dupe.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/enum_explicit_type.rs (renamed from tests/expectations/tests/enum_explicit_type.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/enum_negative.rs (renamed from tests/expectations/tests/enum_negative.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/enum_packed.rs (renamed from tests/expectations/tests/enum_packed.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/extern.rs (renamed from tests/expectations/tests/extern.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/float128.rs (renamed from tests/expectations/tests/float128.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/forward-inherit-struct-with-fields.rs (renamed from tests/expectations/tests/forward-inherit-struct-with-fields.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/forward-inherit-struct.rs (renamed from tests/expectations/tests/forward-inherit-struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/forward_declared_struct.rs (renamed from tests/expectations/tests/forward_declared_struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/func_proto.rs (renamed from tests/expectations/tests/func_proto.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/func_ptr.rs (renamed from tests/expectations/tests/func_ptr.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/func_ptr_in_struct.rs (renamed from tests/expectations/tests/func_ptr_in_struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/func_with_array_arg.rs (renamed from tests/expectations/tests/func_with_array_arg.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/func_with_func_ptr_arg.rs (renamed from tests/expectations/tests/func_with_func_ptr_arg.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/in_class_typedef.rs (renamed from tests/expectations/tests/in_class_typedef.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/inherit-namespaced.rs (renamed from tests/expectations/tests/inherit-namespaced.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/inherit_named.rs (renamed from tests/expectations/tests/inherit_named.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/inherit_typedef.rs (renamed from tests/expectations/tests/inherit_typedef.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/inner_const.rs (renamed from tests/expectations/tests/inner_const.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/inner_template_self.rs (renamed from tests/expectations/tests/inner_template_self.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/int128_t.rs (renamed from tests/expectations/tests/int128_t.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/jsval_layout_opaque.rs (renamed from tests/expectations/tests/jsval_layout_opaque.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/keywords.rs (renamed from tests/expectations/tests/keywords.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/macro-expr-basic.rs (renamed from tests/expectations/tests/macro-expr-basic.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/macro-redef.rs (renamed from tests/expectations/tests/macro-redef.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs (renamed from tests/expectations/tests/multiple-inherit-empty-correct-layout.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/mutable.rs (renamed from tests/expectations/tests/mutable.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/namespace.rs (renamed from tests/expectations/tests/namespace.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/nested.rs (renamed from tests/expectations/tests/nested.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/nested_vtable.rs (renamed from tests/expectations/tests/nested_vtable.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/no-std.rs (renamed from tests/expectations/tests/no-std.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/no_copy.rs (renamed from tests/expectations/tests/no_copy.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/nsStyleAutoArray.rs (renamed from tests/expectations/tests/nsStyleAutoArray.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/only_bitfields.rs (renamed from tests/expectations/tests/only_bitfields.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/opaque_in_struct.rs (renamed from tests/expectations/tests/opaque_in_struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/opaque_pointer.rs (renamed from tests/expectations/tests/opaque_pointer.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/opaque_typedef.rs (renamed from tests/expectations/tests/opaque_typedef.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/overflowed_enum.rs (renamed from tests/expectations/tests/overflowed_enum.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/overloading.rs (renamed from tests/expectations/tests/overloading.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/private.rs (renamed from tests/expectations/tests/private.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/redeclaration.rs (renamed from tests/expectations/tests/redeclaration.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/ref_argument_array.rs (renamed from tests/expectations/tests/ref_argument_array.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/replace_template_alias.rs (renamed from tests/expectations/tests/replace_template_alias.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/replaces_double.rs (renamed from tests/expectations/tests/replaces_double.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/size_t_template.rs (renamed from tests/expectations/tests/size_t_template.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_containing_forward_declared_struct.rs (renamed from tests/expectations/tests/struct_containing_forward_declared_struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_anon_struct.rs (renamed from tests/expectations/tests/struct_with_anon_struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_anon_struct_array.rs (renamed from tests/expectations/tests/struct_with_anon_struct_array.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_anon_struct_pointer.rs (renamed from tests/expectations/tests/struct_with_anon_struct_pointer.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_anon_union.rs (renamed from tests/expectations/tests/struct_with_anon_union.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_anon_unnamed_struct.rs (renamed from tests/expectations/tests/struct_with_anon_unnamed_struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_anon_unnamed_union.rs (renamed from tests/expectations/tests/struct_with_anon_unnamed_union.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_bitfields.rs (renamed from tests/expectations/tests/struct_with_bitfields.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_derive_debug.rs (renamed from tests/expectations/tests/struct_with_derive_debug.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_nesting.rs (renamed from tests/expectations/tests/struct_with_nesting.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_packing.rs (renamed from tests/expectations/tests/struct_with_packing.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_struct.rs (renamed from tests/expectations/tests/struct_with_struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/struct_with_typedef_template_arg.rs (renamed from tests/expectations/tests/struct_with_typedef_template_arg.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/template.rs (renamed from tests/expectations/tests/template.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/template_alias.rs (renamed from tests/expectations/tests/template_alias.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/template_alias_basic.rs (renamed from tests/expectations/tests/template_alias_basic.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/template_alias_namespace.rs (renamed from tests/expectations/tests/template_alias_namespace.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/template_typedef_transitive_param.rs (renamed from tests/expectations/tests/template_typedef_transitive_param.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/template_typedefs.rs (renamed from tests/expectations/tests/template_typedefs.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/type_alias_empty.rs (renamed from tests/expectations/tests/type_alias_empty.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/typeref.rs (renamed from tests/expectations/tests/typeref.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/union_dtor.rs (renamed from tests/expectations/tests/union_dtor.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/union_fields.rs (renamed from tests/expectations/tests/union_fields.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/union_template.rs (renamed from tests/expectations/tests/union_template.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/union_with_anon_struct.rs (renamed from tests/expectations/tests/union_with_anon_struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/union_with_anon_struct_bitfield.rs (renamed from tests/expectations/tests/union_with_anon_struct_bitfield.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/union_with_anon_union.rs (renamed from tests/expectations/tests/union_with_anon_union.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/union_with_anon_unnamed_struct.rs (renamed from tests/expectations/tests/union_with_anon_unnamed_struct.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/union_with_anon_unnamed_union.rs (renamed from tests/expectations/tests/union_with_anon_unnamed_union.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/union_with_big_member.rs (renamed from tests/expectations/tests/union_with_big_member.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/union_with_nesting.rs (renamed from tests/expectations/tests/union_with_nesting.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/unknown_attr.rs (renamed from tests/expectations/tests/unknown_attr.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/use-core.rs (renamed from tests/expectations/tests/use-core.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/using.rs (renamed from tests/expectations/tests/using.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/vector.rs (renamed from tests/expectations/tests/vector.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/virtual_dtor.rs (renamed from tests/expectations/tests/virtual_dtor.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/virtual_overloaded.rs (renamed from tests/expectations/tests/virtual_overloaded.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/vtable_recursive_sig.rs (renamed from tests/expectations/tests/vtable_recursive_sig.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/weird_bitfields.rs (renamed from tests/expectations/tests/weird_bitfields.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/what_is_going_on.rs (renamed from tests/expectations/tests/what_is_going_on.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/whitelist_basic.rs (renamed from tests/expectations/tests/whitelist_basic.rs)0
-rw-r--r--libbindgen/tests/expectations/tests/whitelist_vars.rs (renamed from tests/expectations/tests/whitelist_vars.rs)0
-rw-r--r--libbindgen/tests/headers/accessors.hpp (renamed from tests/headers/accessors.hpp)0
-rw-r--r--libbindgen/tests/headers/annotation_hide.hpp (renamed from tests/headers/annotation_hide.hpp)0
-rw-r--r--libbindgen/tests/headers/anon_enum.hpp (renamed from tests/headers/anon_enum.hpp)0
-rw-r--r--libbindgen/tests/headers/anon_enum_whitelist.h (renamed from tests/headers/anon_enum_whitelist.h)0
-rw-r--r--libbindgen/tests/headers/anon_union.hpp (renamed from tests/headers/anon_union.hpp)0
-rw-r--r--libbindgen/tests/headers/arg_keyword.hpp (renamed from tests/headers/arg_keyword.hpp)0
-rw-r--r--libbindgen/tests/headers/base-to-derived.hpp (renamed from tests/headers/base-to-derived.hpp)0
-rw-r--r--libbindgen/tests/headers/bitfield-enum-basic.h (renamed from tests/headers/bitfield-enum-basic.h)0
-rw-r--r--libbindgen/tests/headers/blocks.h (renamed from tests/headers/blocks.h)0
-rw-r--r--libbindgen/tests/headers/class.hpp (renamed from tests/headers/class.hpp)0
-rw-r--r--libbindgen/tests/headers/class_nested.hpp (renamed from tests/headers/class_nested.hpp)0
-rw-r--r--libbindgen/tests/headers/class_no_members.hpp (renamed from tests/headers/class_no_members.hpp)0
-rw-r--r--libbindgen/tests/headers/class_static.hpp (renamed from tests/headers/class_static.hpp)0
-rw-r--r--libbindgen/tests/headers/class_static_const.hpp (renamed from tests/headers/class_static_const.hpp)0
-rw-r--r--libbindgen/tests/headers/class_use_as.hpp (renamed from tests/headers/class_use_as.hpp)0
-rw-r--r--libbindgen/tests/headers/class_with_dtor.hpp (renamed from tests/headers/class_with_dtor.hpp)0
-rw-r--r--libbindgen/tests/headers/class_with_inner_struct.hpp (renamed from tests/headers/class_with_inner_struct.hpp)0
-rw-r--r--libbindgen/tests/headers/class_with_typedef.hpp (renamed from tests/headers/class_with_typedef.hpp)0
-rw-r--r--libbindgen/tests/headers/complex.h (renamed from tests/headers/complex.h)0
-rw-r--r--libbindgen/tests/headers/complex_global.h (renamed from tests/headers/complex_global.h)0
-rw-r--r--libbindgen/tests/headers/const_enum_unnamed.hpp (renamed from tests/headers/const_enum_unnamed.hpp)0
-rw-r--r--libbindgen/tests/headers/const_ptr.hpp (renamed from tests/headers/const_ptr.hpp)0
-rw-r--r--libbindgen/tests/headers/const_resolved_ty.h (renamed from tests/headers/const_resolved_ty.h)0
-rw-r--r--libbindgen/tests/headers/const_tparam.hpp (renamed from tests/headers/const_tparam.hpp)0
-rw-r--r--libbindgen/tests/headers/convert-floats.h (renamed from tests/headers/convert-floats.h)0
-rw-r--r--libbindgen/tests/headers/crtp.hpp (renamed from tests/headers/crtp.hpp)0
-rw-r--r--libbindgen/tests/headers/decl_extern_int_twice.h (renamed from tests/headers/decl_extern_int_twice.h)0
-rw-r--r--libbindgen/tests/headers/decl_ptr_to_array.h (renamed from tests/headers/decl_ptr_to_array.h)0
-rw-r--r--libbindgen/tests/headers/duplicated_constants_in_ns.hpp (renamed from tests/headers/duplicated_constants_in_ns.hpp)0
-rw-r--r--libbindgen/tests/headers/elaborated.hpp (renamed from tests/headers/elaborated.hpp)0
-rw-r--r--libbindgen/tests/headers/empty_template_param_name.hpp (renamed from tests/headers/empty_template_param_name.hpp)0
-rw-r--r--libbindgen/tests/headers/enum.h (renamed from tests/headers/enum.h)0
-rw-r--r--libbindgen/tests/headers/enum_alias.hpp (renamed from tests/headers/enum_alias.hpp)0
-rw-r--r--libbindgen/tests/headers/enum_and_vtable_mangling.hpp (renamed from tests/headers/enum_and_vtable_mangling.hpp)0
-rw-r--r--libbindgen/tests/headers/enum_dupe.h (renamed from tests/headers/enum_dupe.h)0
-rw-r--r--libbindgen/tests/headers/enum_explicit_type.hpp (renamed from tests/headers/enum_explicit_type.hpp)0
-rw-r--r--libbindgen/tests/headers/enum_negative.h (renamed from tests/headers/enum_negative.h)0
-rw-r--r--libbindgen/tests/headers/enum_packed.h (renamed from tests/headers/enum_packed.h)0
-rw-r--r--libbindgen/tests/headers/extern.hpp (renamed from tests/headers/extern.hpp)0
-rw-r--r--libbindgen/tests/headers/float128.hpp (renamed from tests/headers/float128.hpp)0
-rw-r--r--libbindgen/tests/headers/forward-inherit-struct-with-fields.hpp (renamed from tests/headers/forward-inherit-struct-with-fields.hpp)0
-rw-r--r--libbindgen/tests/headers/forward-inherit-struct.hpp (renamed from tests/headers/forward-inherit-struct.hpp)0
-rw-r--r--libbindgen/tests/headers/forward_declared_struct.h (renamed from tests/headers/forward_declared_struct.h)0
-rw-r--r--libbindgen/tests/headers/func_proto.h (renamed from tests/headers/func_proto.h)0
-rw-r--r--libbindgen/tests/headers/func_ptr.h (renamed from tests/headers/func_ptr.h)0
-rw-r--r--libbindgen/tests/headers/func_ptr_in_struct.h (renamed from tests/headers/func_ptr_in_struct.h)0
-rw-r--r--libbindgen/tests/headers/func_with_array_arg.h (renamed from tests/headers/func_with_array_arg.h)0
-rw-r--r--libbindgen/tests/headers/func_with_func_ptr_arg.h (renamed from tests/headers/func_with_func_ptr_arg.h)0
-rw-r--r--libbindgen/tests/headers/in_class_typedef.hpp (renamed from tests/headers/in_class_typedef.hpp)0
-rw-r--r--libbindgen/tests/headers/inherit-namespaced.hpp (renamed from tests/headers/inherit-namespaced.hpp)0
-rw-r--r--libbindgen/tests/headers/inherit_named.hpp (renamed from tests/headers/inherit_named.hpp)0
-rw-r--r--libbindgen/tests/headers/inherit_typedef.hpp (renamed from tests/headers/inherit_typedef.hpp)0
-rw-r--r--libbindgen/tests/headers/inner_const.hpp (renamed from tests/headers/inner_const.hpp)0
-rw-r--r--libbindgen/tests/headers/inner_template_self.hpp (renamed from tests/headers/inner_template_self.hpp)0
-rw-r--r--libbindgen/tests/headers/int128_t.h (renamed from tests/headers/int128_t.h)0
-rw-r--r--libbindgen/tests/headers/jsval_layout_opaque.hpp (renamed from tests/headers/jsval_layout_opaque.hpp)0
-rw-r--r--libbindgen/tests/headers/keywords.h (renamed from tests/headers/keywords.h)0
-rw-r--r--libbindgen/tests/headers/macro-expr-basic.h (renamed from tests/headers/macro-expr-basic.h)0
-rw-r--r--libbindgen/tests/headers/macro-redef.h (renamed from tests/headers/macro-redef.h)0
-rw-r--r--libbindgen/tests/headers/multiple-inherit-empty-correct-layout.hpp (renamed from tests/headers/multiple-inherit-empty-correct-layout.hpp)0
-rw-r--r--libbindgen/tests/headers/mutable.hpp (renamed from tests/headers/mutable.hpp)0
-rw-r--r--libbindgen/tests/headers/namespace.hpp (renamed from tests/headers/namespace.hpp)0
-rw-r--r--libbindgen/tests/headers/nested.hpp (renamed from tests/headers/nested.hpp)0
-rw-r--r--libbindgen/tests/headers/nested_vtable.hpp (renamed from tests/headers/nested_vtable.hpp)0
-rw-r--r--libbindgen/tests/headers/no-std.h (renamed from tests/headers/no-std.h)0
-rw-r--r--libbindgen/tests/headers/no_copy.hpp (renamed from tests/headers/no_copy.hpp)0
-rw-r--r--libbindgen/tests/headers/nsStyleAutoArray.hpp (renamed from tests/headers/nsStyleAutoArray.hpp)0
-rw-r--r--libbindgen/tests/headers/only_bitfields.hpp (renamed from tests/headers/only_bitfields.hpp)0
-rw-r--r--libbindgen/tests/headers/opaque_in_struct.hpp (renamed from tests/headers/opaque_in_struct.hpp)0
-rw-r--r--libbindgen/tests/headers/opaque_pointer.hpp (renamed from tests/headers/opaque_pointer.hpp)0
-rw-r--r--libbindgen/tests/headers/opaque_typedef.hpp (renamed from tests/headers/opaque_typedef.hpp)0
-rw-r--r--libbindgen/tests/headers/overflowed_enum.hpp (renamed from tests/headers/overflowed_enum.hpp)0
-rw-r--r--libbindgen/tests/headers/overloading.hpp (renamed from tests/headers/overloading.hpp)0
-rw-r--r--libbindgen/tests/headers/private.hpp (renamed from tests/headers/private.hpp)0
-rw-r--r--libbindgen/tests/headers/redeclaration.hpp (renamed from tests/headers/redeclaration.hpp)0
-rw-r--r--libbindgen/tests/headers/ref_argument_array.hpp (renamed from tests/headers/ref_argument_array.hpp)0
-rw-r--r--libbindgen/tests/headers/replace_template_alias.hpp (renamed from tests/headers/replace_template_alias.hpp)0
-rw-r--r--libbindgen/tests/headers/replaces_double.hpp (renamed from tests/headers/replaces_double.hpp)0
-rw-r--r--libbindgen/tests/headers/size_t_template.hpp (renamed from tests/headers/size_t_template.hpp)0
-rw-r--r--libbindgen/tests/headers/struct_containing_forward_declared_struct.h (renamed from tests/headers/struct_containing_forward_declared_struct.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_anon_struct.h (renamed from tests/headers/struct_with_anon_struct.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_anon_struct_array.h (renamed from tests/headers/struct_with_anon_struct_array.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_anon_struct_pointer.h (renamed from tests/headers/struct_with_anon_struct_pointer.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_anon_union.h (renamed from tests/headers/struct_with_anon_union.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_anon_unnamed_struct.h (renamed from tests/headers/struct_with_anon_unnamed_struct.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_anon_unnamed_union.h (renamed from tests/headers/struct_with_anon_unnamed_union.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_bitfields.h (renamed from tests/headers/struct_with_bitfields.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_derive_debug.h (renamed from tests/headers/struct_with_derive_debug.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_nesting.h (renamed from tests/headers/struct_with_nesting.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_packing.h (renamed from tests/headers/struct_with_packing.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_struct.h (renamed from tests/headers/struct_with_struct.h)0
-rw-r--r--libbindgen/tests/headers/struct_with_typedef_template_arg.hpp (renamed from tests/headers/struct_with_typedef_template_arg.hpp)0
-rw-r--r--libbindgen/tests/headers/template.hpp (renamed from tests/headers/template.hpp)0
-rw-r--r--libbindgen/tests/headers/template_alias.hpp (renamed from tests/headers/template_alias.hpp)0
-rw-r--r--libbindgen/tests/headers/template_alias_basic.hpp (renamed from tests/headers/template_alias_basic.hpp)0
-rw-r--r--libbindgen/tests/headers/template_alias_namespace.hpp (renamed from tests/headers/template_alias_namespace.hpp)0
-rw-r--r--libbindgen/tests/headers/template_typedef_transitive_param.hpp (renamed from tests/headers/template_typedef_transitive_param.hpp)0
-rw-r--r--libbindgen/tests/headers/template_typedefs.hpp (renamed from tests/headers/template_typedefs.hpp)0
-rw-r--r--libbindgen/tests/headers/type_alias_empty.hpp (renamed from tests/headers/type_alias_empty.hpp)0
-rw-r--r--libbindgen/tests/headers/typeref.hpp (renamed from tests/headers/typeref.hpp)0
-rw-r--r--libbindgen/tests/headers/union_dtor.hpp (renamed from tests/headers/union_dtor.hpp)0
-rw-r--r--libbindgen/tests/headers/union_fields.hpp (renamed from tests/headers/union_fields.hpp)0
-rw-r--r--libbindgen/tests/headers/union_template.hpp (renamed from tests/headers/union_template.hpp)0
-rw-r--r--libbindgen/tests/headers/union_with_anon_struct.h (renamed from tests/headers/union_with_anon_struct.h)0
-rw-r--r--libbindgen/tests/headers/union_with_anon_struct_bitfield.h (renamed from tests/headers/union_with_anon_struct_bitfield.h)0
-rw-r--r--libbindgen/tests/headers/union_with_anon_union.h (renamed from tests/headers/union_with_anon_union.h)0
-rw-r--r--libbindgen/tests/headers/union_with_anon_unnamed_struct.h (renamed from tests/headers/union_with_anon_unnamed_struct.h)0
-rw-r--r--libbindgen/tests/headers/union_with_anon_unnamed_union.h (renamed from tests/headers/union_with_anon_unnamed_union.h)0
-rw-r--r--libbindgen/tests/headers/union_with_big_member.h (renamed from tests/headers/union_with_big_member.h)0
-rw-r--r--libbindgen/tests/headers/union_with_nesting.h (renamed from tests/headers/union_with_nesting.h)0
-rw-r--r--libbindgen/tests/headers/unknown_attr.h (renamed from tests/headers/unknown_attr.h)0
-rw-r--r--libbindgen/tests/headers/use-core.h (renamed from tests/headers/use-core.h)0
-rw-r--r--libbindgen/tests/headers/using.hpp (renamed from tests/headers/using.hpp)0
-rw-r--r--libbindgen/tests/headers/vector.hpp (renamed from tests/headers/vector.hpp)0
-rw-r--r--libbindgen/tests/headers/virtual_dtor.hpp (renamed from tests/headers/virtual_dtor.hpp)0
-rw-r--r--libbindgen/tests/headers/virtual_overloaded.hpp (renamed from tests/headers/virtual_overloaded.hpp)0
-rw-r--r--libbindgen/tests/headers/vtable_recursive_sig.hpp (renamed from tests/headers/vtable_recursive_sig.hpp)0
-rw-r--r--libbindgen/tests/headers/weird_bitfields.hpp (renamed from tests/headers/weird_bitfields.hpp)0
-rw-r--r--libbindgen/tests/headers/what_is_going_on.hpp (renamed from tests/headers/what_is_going_on.hpp)0
-rw-r--r--libbindgen/tests/headers/whitelist_basic.hpp (renamed from tests/headers/whitelist_basic.hpp)0
-rw-r--r--libbindgen/tests/headers/whitelist_vars.h (renamed from tests/headers/whitelist_vars.h)0
-rw-r--r--libbindgen/tests/tests.rs138
-rw-r--r--libbindgen/tests/uses/.gitignore (renamed from tests/uses/.gitignore)0
-rw-r--r--[-rwxr-xr-x]src/main.rs (renamed from src/bin/bindgen.rs)7
-rw-r--r--src/options.rs (renamed from src/bin/options.rs)5
-rw-r--r--tests/tests.rs171
-rwxr-xr-xtests/tools/run-bindgen.py175
280 files changed, 216 insertions, 472 deletions
diff --git a/.gitignore b/.gitignore
index f54aca98..049fbc4a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,5 @@
-bindgen
-libbindgen*
-
# Cargo
target/
Cargo.lock
*~
#*#
-
diff --git a/.travis.yml b/.travis.yml
index 467c42dc..48f0b4b1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,16 +24,19 @@ cache:
before_install: . ./ci/before_install.sh
+before_script: cd libbindgen
+
script:
- - cargo build --verbose --features "$BINDGEN_FEATURES"
- cargo test --features "$BINDGEN_FEATURES"
- - cargo build --release --verbose --features "$BINDGEN_FEATURES"
- cargo test --release --features "$BINDGEN_FEATURES"
- git add -A
- git diff @
- git diff-index --quiet HEAD
- cargo test -p tests_expectations
- cargo build --features "$BINDGEN_FEATURES _docs"
+ - cd ..
+ - cargo test --features "$BINDGEN_FEATURES"
+ - cargo test --release --features "$BINDGEN_FEATURES"
notifications:
webhooks: http://build.servo.org:54856/travis
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ce95e21c..bab631d6 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -42,20 +42,22 @@ that you aren't forgetting to document types and functions. CI will catch it if
you forget, but the turn around will be a lot slower ;)
```
-$ cargo build --features "llvm_stable _docs"
+$ cd libbindgen && cargo build --features "llvm_stable _docs"
```
## Testing <span id="tests"/>
+Code for binding generation and testing thereof is in the `libbindgen` crate.
+The following sections assume you are working in that subdirectory.
+
### Overview <span id="tests-overview"/>
-Input C/C++ test headers reside in the `tests/headers` directory. The expected
-output rust bindings live in `tests/expectations/tests`; for example,
-`tests/headers/my_header.h`'s expected generated rust bindings would be
+Input C/C++ test headers reside in the `tests/headers` directory. Expected
+output Rust bindings live in `tests/expectations/tests`. For example,
+`tests/headers/my_header.h`'s expected generated Rust bindings would be
`tests/expectations/tests/my_header.rs`.
-The `tests/tools/run-bindgen.py` script runs `bindgen` on the test headers and
-compares the results to the expectations.
+Run `cargo test` to compare generated Rust bindings to the expectations.
### Running All Tests <span id="tests-all"/>
@@ -63,25 +65,11 @@ compares the results to the expectations.
$ cargo test [--features llvm_stable]
```
-This spawns a `tests/tools/run-bindgen.py` subprocess for each test header.
-
-### Running a Single, Specific Test <span id="tests-one"/>
-
-```
-$ ./tests/tools/run-bindgen.py ./target/debug/bindgen ./tests/headers/some_header.h
-```
-
-To learn more about the options available with `run-bindgen.py`:
-
-```
-$ ./tests/tools/run-bindgen.py --help
-```
-
### Authoring New Tests <span id="tests-new"/>
To add a new test header to the suite, simply put it in the `tests/headers`
-directory. Next, run the `run-bindgen.py` script with the new test header, which
-will generate the initial expected output rust bindings.
+directory. Next, run `bindgen` to generate the initial expected output Rust
+bindings. Put those in `tests/expectations/tests`.
If your new test requires certain flags to be passed to `bindgen`, you can
specify them at the top of the test header, with a comment like this:
@@ -90,14 +78,7 @@ specify them at the top of the test header, with a comment like this:
// bindgen-flags: --enable-cxx-namespaces -- -std=c++14
```
-If your new test requires `bindgen` to be built with certain features, you can
-specify the required features at the top of the test header in a similar manner:
-
-```c
-// bingden-features: llvm_stable
-```
-
-Then verify the new rust bindings compile and its tests pass:
+Then verify the new Rust bindings compile and pass some basic tests:
```
$ cargo test -p tests_expectations
@@ -130,14 +111,13 @@ To help debug what `bindgen` is doing, you can define the environment variable
`RUST_LOG=bindgen` to get a bunch of debugging log spew.
```
-$ RUST_LOG=bindgen ./target/debug/bindgen [flags...] ~/path/to/some/header.h
+$ RUST_LOG=libbindgen ./target/debug/bindgen [flags...] ~/path/to/some/header.h
```
-This logging can also be used when debugging failing tests under
-`run-bindgen.py`:
+This logging can also be used when debugging failing tests:
```
-$ RUST_LOG=bindgen ./tests/tools/run-bindgen.py ./target/debug/bindgen tests/headers/whatever.h
+$ RUST_LOG=libbindgen cd libbindgen && cargo test
```
## Using `creduce` to Minimize Test Cases <span id="creduce"/>
diff --git a/Cargo.toml b/Cargo.toml
index 92090226..e5a14a6f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,6 @@ authors = [
"Emilio Cobos Álvarez <ecoal95@gmail.com>",
"The Servo project developers",
]
-build = "build.rs"
description = "A binding generator for Rust"
homepage = "https://github.com/servo/rust-bindgen"
keywords = ["bindings", "ffi", "code-generation"]
@@ -14,50 +13,13 @@ readme = "README.md"
repository = "https://github.com/servo/rust-bindgen"
version = "0.17.0"
-[[bin]]
-doc = false
-name = "bindgen"
-
-[build-dependencies]
-quasi_codegen = "0.20"
-
[dependencies]
-cfg-if = "0.1.0"
clang-sys = "0.8.0"
clap = "2"
-lazy_static = "0.1.*"
-libc = "0.2"
+libbindgen = { path = "libbindgen" }
log = "0.3"
env_logger = "0.3"
rustc-serialize = "0.3.19"
-syntex_syntax = "0.44"
-regex = "0.1"
-cexpr = "0.2"
-
-[dependencies.aster]
-features = ["with-syntex"]
-version = "0.28"
-
-[dependencies.clippy]
-optional = true
-version = "*"
-
-[dependencies.quasi]
-features = ["with-syntex"]
-version = "0.20"
[features]
-llvm_stable = []
-static = []
-# This feature only exists for CI -- don't use it!
-_docs = []
-
-[lib]
-name = "bindgen"
-path = "src/lib.rs"
-
-[dev-dependencies.tests_expectations]
-path = "tests/expectations"
-
-[[test]]
-name = "tests"
+llvm_stable = ["libbindgen/llvm_stable"]
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 90281f7b..00000000
--- a/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-
-TEST_HEADERS := $(wildcard tests/headers/*.h) $(wildcard tests/headers/*.hpp)
-
-TEST_TARGETS := $(TEST_HEADERS:.h=.rs)
-TEST_TARGETS := $(TEST_TARGETS:.hpp=.rs)
-TEST_TARGETS := $(patsubst tests/headers/%, tests/expectations/tests/%, $(TEST_TARGETS))
-
-BINDGEN := ./target/debug/bindgen
-
-.PHONY: $(BINDGEN)
-$(BINDGEN):
- [ -f $@ ] || cargo build --features llvm_stable
-
-.PHONY: test
-test:
- cargo test --features llvm_stable
-
-
-.PHONY: regen-tests
-regen-tests: $(BINDGEN) clean-tests $(TEST_TARGETS)
- @echo > /dev/null
-
-.PHONY: clean-tests
-clean-tests:
- $(RM) $(TEST_TARGETS)
-
-# TODO: Add options to add flags and whatnot
-tests/expectations/tests/%.rs: tests/headers/%.h
- @mkdir -p $(dir $@)
- ./tests/tools/run-bindgen.py $(BINDGEN) $< $@
-
-tests/expectations/tests/%.rs: tests/headers/%.hpp
- @mkdir -p $(dir $@)
- ./tests/tools/run-bindgen.py $(BINDGEN) $< $@
diff --git a/libbindgen/Cargo.toml b/libbindgen/Cargo.toml
new file mode 100644
index 00000000..664ece6e
--- /dev/null
+++ b/libbindgen/Cargo.toml
@@ -0,0 +1,54 @@
+[package]
+authors = [
+ "Jyun-Yan You <jyyou.tw@gmail.com>",
+ "Emilio Cobos Álvarez <ecoal95@gmail.com>",
+ "The Servo project developers",
+]
+build = "build.rs"
+description = "A binding generator for Rust"
+homepage = "https://github.com/servo/rust-bindgen"
+keywords = ["bindings", "ffi", "code-generation"]
+license = "BSD-3-Clause"
+name = "libbindgen"
+readme = "README.md"
+repository = "https://github.com/servo/rust-bindgen"
+version = "0.17.0"
+
+[dev-dependencies]
+diff = "0.1"
+clap = "2"
+shlex = "0.1"
+tests_expectations = { path = "tests/expectations" }
+
+[build-dependencies]
+quasi_codegen = "0.20"
+
+[dependencies]
+cfg-if = "0.1.0"
+clang-sys = "0.8.0"
+lazy_static = "0.1.*"
+libc = "0.2"
+log = "0.3"
+env_logger = "0.3"
+rustc-serialize = "0.3.19"
+syntex_syntax = "0.44"
+regex = "0.1"
+cexpr = "0.2"
+
+[dependencies.aster]
+features = ["with-syntex"]
+version = "0.28"
+
+[dependencies.clippy]
+optional = true
+version = "*"
+
+[dependencies.quasi]
+features = ["with-syntex"]
+version = "0.20"
+
+[features]
+llvm_stable = []
+static = []
+# This feature only exists for CI -- don't use it!
+_docs = []
diff --git a/build.rs b/libbindgen/build.rs
index b9cf3e60..b9cf3e60 100644
--- a/build.rs
+++ b/libbindgen/build.rs
diff --git a/src/chooser.rs b/libbindgen/src/chooser.rs
index 10a77dc9..10a77dc9 100644
--- a/src/chooser.rs
+++ b/libbindgen/src/chooser.rs
diff --git a/src/clang.rs b/libbindgen/src/clang.rs
index 7da755ea..7da755ea 100755..100644
--- a/src/clang.rs
+++ b/libbindgen/src/clang.rs
diff --git a/src/clangll.rs b/libbindgen/src/clangll.rs
index b9743117..b9743117 100644
--- a/src/clangll.rs
+++ b/libbindgen/src/clangll.rs
diff --git a/src/codegen/helpers.rs b/libbindgen/src/codegen/helpers.rs
index 6e5a6f0e..6e5a6f0e 100644
--- a/src/codegen/helpers.rs
+++ b/libbindgen/src/codegen/helpers.rs
diff --git a/src/codegen/mod.rs b/libbindgen/src/codegen/mod.rs
index 8e04fd7c..8e04fd7c 100755..100644
--- a/src/codegen/mod.rs
+++ b/libbindgen/src/codegen/mod.rs
diff --git a/src/ir/annotations.rs b/libbindgen/src/ir/annotations.rs
index 58308d6d..58308d6d 100644
--- a/src/ir/annotations.rs
+++ b/libbindgen/src/ir/annotations.rs
diff --git a/src/ir/comp.rs b/libbindgen/src/ir/comp.rs
index d19d1209..d19d1209 100644
--- a/src/ir/comp.rs
+++ b/libbindgen/src/ir/comp.rs
diff --git a/src/ir/context.rs b/libbindgen/src/ir/context.rs
index 85721978..85721978 100644
--- a/src/ir/context.rs
+++ b/libbindgen/src/ir/context.rs
diff --git a/src/ir/enum_ty.rs b/libbindgen/src/ir/enum_ty.rs
index 6085833d..6085833d 100644
--- a/src/ir/enum_ty.rs
+++ b/libbindgen/src/ir/enum_ty.rs
diff --git a/src/ir/function.rs b/libbindgen/src/ir/function.rs
index eacb6c0e..eacb6c0e 100644
--- a/src/ir/function.rs
+++ b/libbindgen/src/ir/function.rs
diff --git a/src/ir/int.rs b/libbindgen/src/ir/int.rs
index 2d85db83..2d85db83 100644
--- a/src/ir/int.rs
+++ b/libbindgen/src/ir/int.rs
diff --git a/src/ir/item.rs b/libbindgen/src/ir/item.rs
index 1f05f92f..1f05f92f 100644
--- a/src/ir/item.rs
+++ b/libbindgen/src/ir/item.rs
diff --git a/src/ir/item_kind.rs b/libbindgen/src/ir/item_kind.rs
index d9e4690c..d9e4690c 100644
--- a/src/ir/item_kind.rs
+++ b/libbindgen/src/ir/item_kind.rs
diff --git a/src/ir/layout.rs b/libbindgen/src/ir/layout.rs
index 3ac4a5f4..3ac4a5f4 100644
--- a/src/ir/layout.rs
+++ b/libbindgen/src/ir/layout.rs
diff --git a/src/ir/mod.rs b/libbindgen/src/ir/mod.rs
index 3c658a4a..3c658a4a 100644
--- a/src/ir/mod.rs
+++ b/libbindgen/src/ir/mod.rs
diff --git a/src/ir/module.rs b/libbindgen/src/ir/module.rs
index c5d8cfa7..c5d8cfa7 100644
--- a/src/ir/module.rs
+++ b/libbindgen/src/ir/module.rs
diff --git a/src/ir/ty.rs b/libbindgen/src/ir/ty.rs
index 34af2db5..34af2db5 100644
--- a/src/ir/ty.rs
+++ b/libbindgen/src/ir/ty.rs
diff --git a/src/ir/type_collector.rs b/libbindgen/src/ir/type_collector.rs
index 0f10152d..0f10152d 100644
--- a/src/ir/type_collector.rs
+++ b/libbindgen/src/ir/type_collector.rs
diff --git a/src/ir/var.rs b/libbindgen/src/ir/var.rs
index d0c4d9ca..d0c4d9ca 100644
--- a/src/ir/var.rs
+++ b/libbindgen/src/ir/var.rs
diff --git a/src/lib.rs b/libbindgen/src/lib.rs
index b56cb468..d0ca7b03 100755..100644
--- a/src/lib.rs
+++ b/libbindgen/src/lib.rs
@@ -5,9 +5,6 @@
//!
//! See the [Builder](./struct.Builder.html) struct for usage.
-#![crate_name = "bindgen"]
-#![crate_type = "dylib"]
-
#![cfg_attr(feature = "clippy", feature(plugin))]
#![cfg_attr(feature = "clippy", plugin(clippy))]
diff --git a/src/parse.rs b/libbindgen/src/parse.rs
index 28e65759..28e65759 100644
--- a/src/parse.rs
+++ b/libbindgen/src/parse.rs
diff --git a/src/regex_set.rs b/libbindgen/src/regex_set.rs
index 93130590..93130590 100644
--- a/src/regex_set.rs
+++ b/libbindgen/src/regex_set.rs
diff --git a/src/uses.rs b/libbindgen/src/uses.rs
index 47f72da6..47f72da6 100644
--- a/src/uses.rs
+++ b/libbindgen/src/uses.rs
diff --git a/tests/expectations/Cargo.toml b/libbindgen/tests/expectations/Cargo.toml
index 53f1b14f..53f1b14f 100644
--- a/tests/expectations/Cargo.toml
+++ b/libbindgen/tests/expectations/Cargo.toml
diff --git a/tests/expectations/src/lib.rs b/libbindgen/tests/expectations/src/lib.rs
index e69de29b..e69de29b 100644
--- a/tests/expectations/src/lib.rs
+++ b/libbindgen/tests/expectations/src/lib.rs
diff --git a/tests/expectations/tests/accessors.rs b/libbindgen/tests/expectations/tests/accessors.rs
index b721980c..b721980c 100644
--- a/tests/expectations/tests/accessors.rs
+++ b/libbindgen/tests/expectations/tests/accessors.rs
diff --git a/tests/expectations/tests/annotation_hide.rs b/libbindgen/tests/expectations/tests/annotation_hide.rs
index dcaf7997..dcaf7997 100644
--- a/tests/expectations/tests/annotation_hide.rs
+++ b/libbindgen/tests/expectations/tests/annotation_hide.rs
diff --git a/tests/expectations/tests/anon_enum.rs b/libbindgen/tests/expectations/tests/anon_enum.rs
index 075830e6..075830e6 100644
--- a/tests/expectations/tests/anon_enum.rs
+++ b/libbindgen/tests/expectations/tests/anon_enum.rs
diff --git a/tests/expectations/tests/anon_enum_whitelist.rs b/libbindgen/tests/expectations/tests/anon_enum_whitelist.rs
index b32396a0..b32396a0 100644
--- a/tests/expectations/tests/anon_enum_whitelist.rs
+++ b/libbindgen/tests/expectations/tests/anon_enum_whitelist.rs
diff --git a/tests/expectations/tests/anon_union.rs b/libbindgen/tests/expectations/tests/anon_union.rs
index 8af416c3..8af416c3 100644
--- a/tests/expectations/tests/anon_union.rs
+++ b/libbindgen/tests/expectations/tests/anon_union.rs
diff --git a/tests/expectations/tests/arg_keyword.rs b/libbindgen/tests/expectations/tests/arg_keyword.rs
index cb1cc432..cb1cc432 100644
--- a/tests/expectations/tests/arg_keyword.rs
+++ b/libbindgen/tests/expectations/tests/arg_keyword.rs
diff --git a/tests/expectations/tests/base-to-derived.rs b/libbindgen/tests/expectations/tests/base-to-derived.rs
index c2af2c43..c2af2c43 100644
--- a/tests/expectations/tests/base-to-derived.rs
+++ b/libbindgen/tests/expectations/tests/base-to-derived.rs
diff --git a/tests/expectations/tests/bitfield-enum-basic.rs b/libbindgen/tests/expectations/tests/bitfield-enum-basic.rs
index 03e07de6..03e07de6 100644
--- a/tests/expectations/tests/bitfield-enum-basic.rs
+++ b/libbindgen/tests/expectations/tests/bitfield-enum-basic.rs
diff --git a/tests/expectations/tests/blocks.rs b/libbindgen/tests/expectations/tests/blocks.rs
index 528ea518..528ea518 100644
--- a/tests/expectations/tests/blocks.rs
+++ b/libbindgen/tests/expectations/tests/blocks.rs
diff --git a/tests/expectations/tests/class.rs b/libbindgen/tests/expectations/tests/class.rs
index 579c24a4..579c24a4 100644
--- a/tests/expectations/tests/class.rs
+++ b/libbindgen/tests/expectations/tests/class.rs
diff --git a/tests/expectations/tests/class_nested.rs b/libbindgen/tests/expectations/tests/class_nested.rs
index 593e156d..593e156d 100644
--- a/tests/expectations/tests/class_nested.rs
+++ b/libbindgen/tests/expectations/tests/class_nested.rs
diff --git a/tests/expectations/tests/class_no_members.rs b/libbindgen/tests/expectations/tests/class_no_members.rs
index 017f7c22..017f7c22 100644
--- a/tests/expectations/tests/class_no_members.rs
+++ b/libbindgen/tests/expectations/tests/class_no_members.rs
diff --git a/tests/expectations/tests/class_static.rs b/libbindgen/tests/expectations/tests/class_static.rs
index 8108be2d..8108be2d 100644
--- a/tests/expectations/tests/class_static.rs
+++ b/libbindgen/tests/expectations/tests/class_static.rs
diff --git a/tests/expectations/tests/class_static_const.rs b/libbindgen/tests/expectations/tests/class_static_const.rs
index eed6590c..eed6590c 100644
--- a/tests/expectations/tests/class_static_const.rs
+++ b/libbindgen/tests/expectations/tests/class_static_const.rs
diff --git a/tests/expectations/tests/class_use_as.rs b/libbindgen/tests/expectations/tests/class_use_as.rs
index c3843b31..c3843b31 100644
--- a/tests/expectations/tests/class_use_as.rs
+++ b/libbindgen/tests/expectations/tests/class_use_as.rs
diff --git a/tests/expectations/tests/class_with_dtor.rs b/libbindgen/tests/expectations/tests/class_with_dtor.rs
index 8ed1ddf9..8ed1ddf9 100644
--- a/tests/expectations/tests/class_with_dtor.rs
+++ b/libbindgen/tests/expectations/tests/class_with_dtor.rs
diff --git a/tests/expectations/tests/class_with_inner_struct.rs b/libbindgen/tests/expectations/tests/class_with_inner_struct.rs
index ab51396d..ab51396d 100644
--- a/tests/expectations/tests/class_with_inner_struct.rs
+++ b/libbindgen/tests/expectations/tests/class_with_inner_struct.rs
diff --git a/tests/expectations/tests/class_with_typedef.rs b/libbindgen/tests/expectations/tests/class_with_typedef.rs
index bc19f2bd..bc19f2bd 100644
--- a/tests/expectations/tests/class_with_typedef.rs
+++ b/libbindgen/tests/expectations/tests/class_with_typedef.rs
diff --git a/tests/expectations/tests/complex.rs b/libbindgen/tests/expectations/tests/complex.rs
index f2a97952..f2a97952 100644
--- a/tests/expectations/tests/complex.rs
+++ b/libbindgen/tests/expectations/tests/complex.rs
diff --git a/tests/expectations/tests/complex_global.rs b/libbindgen/tests/expectations/tests/complex_global.rs
index badc4d1f..badc4d1f 100644
--- a/tests/expectations/tests/complex_global.rs
+++ b/libbindgen/tests/expectations/tests/complex_global.rs
diff --git a/tests/expectations/tests/const_enum_unnamed.rs b/libbindgen/tests/expectations/tests/const_enum_unnamed.rs
index 0bd3987a..0bd3987a 100644
--- a/tests/expectations/tests/const_enum_unnamed.rs
+++ b/libbindgen/tests/expectations/tests/const_enum_unnamed.rs
diff --git a/tests/expectations/tests/const_ptr.rs b/libbindgen/tests/expectations/tests/const_ptr.rs
index 89400df1..89400df1 100644
--- a/tests/expectations/tests/const_ptr.rs
+++ b/libbindgen/tests/expectations/tests/const_ptr.rs
diff --git a/tests/expectations/tests/const_resolved_ty.rs b/libbindgen/tests/expectations/tests/const_resolved_ty.rs
index 77d8f438..77d8f438 100644
--- a/tests/expectations/tests/const_resolved_ty.rs
+++ b/libbindgen/tests/expectations/tests/const_resolved_ty.rs
diff --git a/tests/expectations/tests/const_tparam.rs b/libbindgen/tests/expectations/tests/const_tparam.rs
index 3ed10d28..3ed10d28 100644
--- a/tests/expectations/tests/const_tparam.rs
+++ b/libbindgen/tests/expectations/tests/const_tparam.rs
diff --git a/tests/expectations/tests/convert-floats.rs b/libbindgen/tests/expectations/tests/convert-floats.rs
index 5cd38c13..5cd38c13 100644
--- a/tests/expectations/tests/convert-floats.rs
+++ b/libbindgen/tests/expectations/tests/convert-floats.rs
diff --git a/tests/expectations/tests/crtp.rs b/libbindgen/tests/expectations/tests/crtp.rs
index e4a86b24..e4a86b24 100644
--- a/tests/expectations/tests/crtp.rs
+++ b/libbindgen/tests/expectations/tests/crtp.rs
diff --git a/tests/expectations/tests/decl_extern_int_twice.rs b/libbindgen/tests/expectations/tests/decl_extern_int_twice.rs
index 603a51b1..603a51b1 100644
--- a/tests/expectations/tests/decl_extern_int_twice.rs
+++ b/libbindgen/tests/expectations/tests/decl_extern_int_twice.rs
diff --git a/tests/expectations/tests/decl_ptr_to_array.rs b/libbindgen/tests/expectations/tests/decl_ptr_to_array.rs
index b8abedb5..b8abedb5 100644
--- a/tests/expectations/tests/decl_ptr_to_array.rs
+++ b/libbindgen/tests/expectations/tests/decl_ptr_to_array.rs
diff --git a/tests/expectations/tests/duplicated_constants_in_ns.rs b/libbindgen/tests/expectations/tests/duplicated_constants_in_ns.rs
index cb69890c..cb69890c 100644
--- a/tests/expectations/tests/duplicated_constants_in_ns.rs
+++ b/libbindgen/tests/expectations/tests/duplicated_constants_in_ns.rs
diff --git a/tests/expectations/tests/elaborated.rs b/libbindgen/tests/expectations/tests/elaborated.rs
index db373d41..db373d41 100644
--- a/tests/expectations/tests/elaborated.rs
+++ b/libbindgen/tests/expectations/tests/elaborated.rs
diff --git a/tests/expectations/tests/empty_template_param_name.rs b/libbindgen/tests/expectations/tests/empty_template_param_name.rs
index e10b56db..e10b56db 100644
--- a/tests/expectations/tests/empty_template_param_name.rs
+++ b/libbindgen/tests/expectations/tests/empty_template_param_name.rs
diff --git a/tests/expectations/tests/enum.rs b/libbindgen/tests/expectations/tests/enum.rs
index 8138d697..8138d697 100644
--- a/tests/expectations/tests/enum.rs
+++ b/libbindgen/tests/expectations/tests/enum.rs
diff --git a/tests/expectations/tests/enum_alias.rs b/libbindgen/tests/expectations/tests/enum_alias.rs
index 7ea85598..7ea85598 100644
--- a/tests/expectations/tests/enum_alias.rs
+++ b/libbindgen/tests/expectations/tests/enum_alias.rs
diff --git a/tests/expectations/tests/enum_and_vtable_mangling.rs b/libbindgen/tests/expectations/tests/enum_and_vtable_mangling.rs
index a55c344e..a55c344e 100644
--- a/tests/expectations/tests/enum_and_vtable_mangling.rs
+++ b/libbindgen/tests/expectations/tests/enum_and_vtable_mangling.rs
diff --git a/tests/expectations/tests/enum_dupe.rs b/libbindgen/tests/expectations/tests/enum_dupe.rs
index 322b89fc..322b89fc 100644
--- a/tests/expectations/tests/enum_dupe.rs
+++ b/libbindgen/tests/expectations/tests/enum_dupe.rs
diff --git a/tests/expectations/tests/enum_explicit_type.rs b/libbindgen/tests/expectations/tests/enum_explicit_type.rs
index 4e555d3a..4e555d3a 100644
--- a/tests/expectations/tests/enum_explicit_type.rs
+++ b/libbindgen/tests/expectations/tests/enum_explicit_type.rs
diff --git a/tests/expectations/tests/enum_negative.rs b/libbindgen/tests/expectations/tests/enum_negative.rs
index 74cf4f16..74cf4f16 100644
--- a/tests/expectations/tests/enum_negative.rs
+++ b/libbindgen/tests/expectations/tests/enum_negative.rs
diff --git a/tests/expectations/tests/enum_packed.rs b/libbindgen/tests/expectations/tests/enum_packed.rs
index 963763e1..963763e1 100644
--- a/tests/expectations/tests/enum_packed.rs
+++ b/libbindgen/tests/expectations/tests/enum_packed.rs
diff --git a/tests/expectations/tests/extern.rs b/libbindgen/tests/expectations/tests/extern.rs
index e7ac7504..e7ac7504 100644
--- a/tests/expectations/tests/extern.rs
+++ b/libbindgen/tests/expectations/tests/extern.rs
diff --git a/tests/expectations/tests/float128.rs b/libbindgen/tests/expectations/tests/float128.rs
index b4b7b2bc..b4b7b2bc 100644
--- a/tests/expectations/tests/float128.rs
+++ b/libbindgen/tests/expectations/tests/float128.rs
diff --git a/tests/expectations/tests/forward-inherit-struct-with-fields.rs b/libbindgen/tests/expectations/tests/forward-inherit-struct-with-fields.rs
index 84104971..84104971 100644
--- a/tests/expectations/tests/forward-inherit-struct-with-fields.rs
+++ b/libbindgen/tests/expectations/tests/forward-inherit-struct-with-fields.rs
diff --git a/tests/expectations/tests/forward-inherit-struct.rs b/libbindgen/tests/expectations/tests/forward-inherit-struct.rs
index e053adcd..e053adcd 100644
--- a/tests/expectations/tests/forward-inherit-struct.rs
+++ b/libbindgen/tests/expectations/tests/forward-inherit-struct.rs
diff --git a/tests/expectations/tests/forward_declared_struct.rs b/libbindgen/tests/expectations/tests/forward_declared_struct.rs
index 5c2764e1..5c2764e1 100644
--- a/tests/expectations/tests/forward_declared_struct.rs
+++ b/libbindgen/tests/expectations/tests/forward_declared_struct.rs
diff --git a/tests/expectations/tests/func_proto.rs b/libbindgen/tests/expectations/tests/func_proto.rs
index e7ac7504..e7ac7504 100644
--- a/tests/expectations/tests/func_proto.rs
+++ b/libbindgen/tests/expectations/tests/func_proto.rs
diff --git a/tests/expectations/tests/func_ptr.rs b/libbindgen/tests/expectations/tests/func_ptr.rs
index 87ec3e3d..87ec3e3d 100644
--- a/tests/expectations/tests/func_ptr.rs
+++ b/libbindgen/tests/expectations/tests/func_ptr.rs
diff --git a/tests/expectations/tests/func_ptr_in_struct.rs b/libbindgen/tests/expectations/tests/func_ptr_in_struct.rs
index dcae771b..dcae771b 100644
--- a/tests/expectations/tests/func_ptr_in_struct.rs
+++ b/libbindgen/tests/expectations/tests/func_ptr_in_struct.rs
diff --git a/tests/expectations/tests/func_with_array_arg.rs b/libbindgen/tests/expectations/tests/func_with_array_arg.rs
index 1528e0ba..1528e0ba 100644
--- a/tests/expectations/tests/func_with_array_arg.rs
+++ b/libbindgen/tests/expectations/tests/func_with_array_arg.rs
diff --git a/tests/expectations/tests/func_with_func_ptr_arg.rs b/libbindgen/tests/expectations/tests/func_with_func_ptr_arg.rs
index 4ac25286..4ac25286 100644
--- a/tests/expectations/tests/func_with_func_ptr_arg.rs
+++ b/libbindgen/tests/expectations/tests/func_with_func_ptr_arg.rs
diff --git a/tests/expectations/tests/in_class_typedef.rs b/libbindgen/tests/expectations/tests/in_class_typedef.rs
index 4e95ca8c..4e95ca8c 100644
--- a/tests/expectations/tests/in_class_typedef.rs
+++ b/libbindgen/tests/expectations/tests/in_class_typedef.rs
diff --git a/tests/expectations/tests/inherit-namespaced.rs b/libbindgen/tests/expectations/tests/inherit-namespaced.rs
index a58058b0..a58058b0 100644
--- a/tests/expectations/tests/inherit-namespaced.rs
+++ b/libbindgen/tests/expectations/tests/inherit-namespaced.rs
diff --git a/tests/expectations/tests/inherit_named.rs b/libbindgen/tests/expectations/tests/inherit_named.rs
index 8081c649..8081c649 100644
--- a/tests/expectations/tests/inherit_named.rs
+++ b/libbindgen/tests/expectations/tests/inherit_named.rs
diff --git a/tests/expectations/tests/inherit_typedef.rs b/libbindgen/tests/expectations/tests/inherit_typedef.rs
index ca9041e2..ca9041e2 100644
--- a/tests/expectations/tests/inherit_typedef.rs
+++ b/libbindgen/tests/expectations/tests/inherit_typedef.rs
diff --git a/tests/expectations/tests/inner_const.rs b/libbindgen/tests/expectations/tests/inner_const.rs
index 666b8ce2..666b8ce2 100644
--- a/tests/expectations/tests/inner_const.rs
+++ b/libbindgen/tests/expectations/tests/inner_const.rs
diff --git a/tests/expectations/tests/inner_template_self.rs b/libbindgen/tests/expectations/tests/inner_template_self.rs
index b965b92d..b965b92d 100644
--- a/tests/expectations/tests/inner_template_self.rs
+++ b/libbindgen/tests/expectations/tests/inner_template_self.rs
diff --git a/tests/expectations/tests/int128_t.rs b/libbindgen/tests/expectations/tests/int128_t.rs
index b4b7b2bc..b4b7b2bc 100644
--- a/tests/expectations/tests/int128_t.rs
+++ b/libbindgen/tests/expectations/tests/int128_t.rs
diff --git a/tests/expectations/tests/jsval_layout_opaque.rs b/libbindgen/tests/expectations/tests/jsval_layout_opaque.rs
index 91f898af..91f898af 100644
--- a/tests/expectations/tests/jsval_layout_opaque.rs
+++ b/libbindgen/tests/expectations/tests/jsval_layout_opaque.rs
diff --git a/tests/expectations/tests/keywords.rs b/libbindgen/tests/expectations/tests/keywords.rs
index 5b75389e..5b75389e 100644
--- a/tests/expectations/tests/keywords.rs
+++ b/libbindgen/tests/expectations/tests/keywords.rs
diff --git a/tests/expectations/tests/macro-expr-basic.rs b/libbindgen/tests/expectations/tests/macro-expr-basic.rs
index 355294e7..355294e7 100644
--- a/tests/expectations/tests/macro-expr-basic.rs
+++ b/libbindgen/tests/expectations/tests/macro-expr-basic.rs
diff --git a/tests/expectations/tests/macro-redef.rs b/libbindgen/tests/expectations/tests/macro-redef.rs
index 881a44ae..881a44ae 100644
--- a/tests/expectations/tests/macro-redef.rs
+++ b/libbindgen/tests/expectations/tests/macro-redef.rs
diff --git a/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs b/libbindgen/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs
index 5e9cf522..5e9cf522 100644
--- a/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs
+++ b/libbindgen/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs
diff --git a/tests/expectations/tests/mutable.rs b/libbindgen/tests/expectations/tests/mutable.rs
index 0d0d6ea3..0d0d6ea3 100644
--- a/tests/expectations/tests/mutable.rs
+++ b/libbindgen/tests/expectations/tests/mutable.rs
diff --git a/tests/expectations/tests/namespace.rs b/libbindgen/tests/expectations/tests/namespace.rs
index bc8bae68..bc8bae68 100644
--- a/tests/expectations/tests/namespace.rs
+++ b/libbindgen/tests/expectations/tests/namespace.rs
diff --git a/tests/expectations/tests/nested.rs b/libbindgen/tests/expectations/tests/nested.rs
index fdd435aa..fdd435aa 100644
--- a/tests/expectations/tests/nested.rs
+++ b/libbindgen/tests/expectations/tests/nested.rs
diff --git a/tests/expectations/tests/nested_vtable.rs b/libbindgen/tests/expectations/tests/nested_vtable.rs
index d74ad55f..d74ad55f 100644
--- a/tests/expectations/tests/nested_vtable.rs
+++ b/libbindgen/tests/expectations/tests/nested_vtable.rs
diff --git a/tests/expectations/tests/no-std.rs b/libbindgen/tests/expectations/tests/no-std.rs
index f50a889d..f50a889d 100644
--- a/tests/expectations/tests/no-std.rs
+++ b/libbindgen/tests/expectations/tests/no-std.rs
diff --git a/tests/expectations/tests/no_copy.rs b/libbindgen/tests/expectations/tests/no_copy.rs
index 53ab9677..53ab9677 100644
--- a/tests/expectations/tests/no_copy.rs
+++ b/libbindgen/tests/expectations/tests/no_copy.rs
diff --git a/tests/expectations/tests/nsStyleAutoArray.rs b/libbindgen/tests/expectations/tests/nsStyleAutoArray.rs
index c150ec46..c150ec46 100644
--- a/tests/expectations/tests/nsStyleAutoArray.rs
+++ b/libbindgen/tests/expectations/tests/nsStyleAutoArray.rs
diff --git a/tests/expectations/tests/only_bitfields.rs b/libbindgen/tests/expectations/tests/only_bitfields.rs
index 68968826..68968826 100644
--- a/tests/expectations/tests/only_bitfields.rs
+++ b/libbindgen/tests/expectations/tests/only_bitfields.rs
diff --git a/tests/expectations/tests/opaque_in_struct.rs b/libbindgen/tests/expectations/tests/opaque_in_struct.rs
index d537f5c7..d537f5c7 100644
--- a/tests/expectations/tests/opaque_in_struct.rs
+++ b/libbindgen/tests/expectations/tests/opaque_in_struct.rs
diff --git a/tests/expectations/tests/opaque_pointer.rs b/libbindgen/tests/expectations/tests/opaque_pointer.rs
index 067f55bd..067f55bd 100644
--- a/tests/expectations/tests/opaque_pointer.rs
+++ b/libbindgen/tests/expectations/tests/opaque_pointer.rs
diff --git a/tests/expectations/tests/opaque_typedef.rs b/libbindgen/tests/expectations/tests/opaque_typedef.rs
index c45cbc6f..c45cbc6f 100644
--- a/tests/expectations/tests/opaque_typedef.rs
+++ b/libbindgen/tests/expectations/tests/opaque_typedef.rs
diff --git a/tests/expectations/tests/overflowed_enum.rs b/libbindgen/tests/expectations/tests/overflowed_enum.rs
index 9e1f8a7f..9e1f8a7f 100644
--- a/tests/expectations/tests/overflowed_enum.rs
+++ b/libbindgen/tests/expectations/tests/overflowed_enum.rs
diff --git a/tests/expectations/tests/overloading.rs b/libbindgen/tests/expectations/tests/overloading.rs
index 4e138e7d..4e138e7d 100644
--- a/tests/expectations/tests/overloading.rs
+++ b/libbindgen/tests/expectations/tests/overloading.rs
diff --git a/tests/expectations/tests/private.rs b/libbindgen/tests/expectations/tests/private.rs
index c4ac37d1..c4ac37d1 100644
--- a/tests/expectations/tests/private.rs
+++ b/libbindgen/tests/expectations/tests/private.rs
diff --git a/tests/expectations/tests/redeclaration.rs b/libbindgen/tests/expectations/tests/redeclaration.rs
index 0d7e585c..0d7e585c 100644
--- a/tests/expectations/tests/redeclaration.rs
+++ b/libbindgen/tests/expectations/tests/redeclaration.rs
diff --git a/tests/expectations/tests/ref_argument_array.rs b/libbindgen/tests/expectations/tests/ref_argument_array.rs
index c88492d7..c88492d7 100644
--- a/tests/expectations/tests/ref_argument_array.rs
+++ b/libbindgen/tests/expectations/tests/ref_argument_array.rs
diff --git a/tests/expectations/tests/replace_template_alias.rs b/libbindgen/tests/expectations/tests/replace_template_alias.rs
index 61a2fbcc..61a2fbcc 100644
--- a/tests/expectations/tests/replace_template_alias.rs
+++ b/libbindgen/tests/expectations/tests/replace_template_alias.rs
diff --git a/tests/expectations/tests/replaces_double.rs b/libbindgen/tests/expectations/tests/replaces_double.rs
index 50dafd42..50dafd42 100644
--- a/tests/expectations/tests/replaces_double.rs
+++ b/libbindgen/tests/expectations/tests/replaces_double.rs
diff --git a/tests/expectations/tests/size_t_template.rs b/libbindgen/tests/expectations/tests/size_t_template.rs
index 78351ecc..78351ecc 100644
--- a/tests/expectations/tests/size_t_template.rs
+++ b/libbindgen/tests/expectations/tests/size_t_template.rs
diff --git a/tests/expectations/tests/struct_containing_forward_declared_struct.rs b/libbindgen/tests/expectations/tests/struct_containing_forward_declared_struct.rs
index 388cc595..388cc595 100644
--- a/tests/expectations/tests/struct_containing_forward_declared_struct.rs
+++ b/libbindgen/tests/expectations/tests/struct_containing_forward_declared_struct.rs
diff --git a/tests/expectations/tests/struct_with_anon_struct.rs b/libbindgen/tests/expectations/tests/struct_with_anon_struct.rs
index 1c49675d..1c49675d 100644
--- a/tests/expectations/tests/struct_with_anon_struct.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_anon_struct.rs
diff --git a/tests/expectations/tests/struct_with_anon_struct_array.rs b/libbindgen/tests/expectations/tests/struct_with_anon_struct_array.rs
index 6e1c0315..6e1c0315 100644
--- a/tests/expectations/tests/struct_with_anon_struct_array.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_anon_struct_array.rs
diff --git a/tests/expectations/tests/struct_with_anon_struct_pointer.rs b/libbindgen/tests/expectations/tests/struct_with_anon_struct_pointer.rs
index aa77d4b6..aa77d4b6 100644
--- a/tests/expectations/tests/struct_with_anon_struct_pointer.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_anon_struct_pointer.rs
diff --git a/tests/expectations/tests/struct_with_anon_union.rs b/libbindgen/tests/expectations/tests/struct_with_anon_union.rs
index 0d2e937a..0d2e937a 100644
--- a/tests/expectations/tests/struct_with_anon_union.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_anon_union.rs
diff --git a/tests/expectations/tests/struct_with_anon_unnamed_struct.rs b/libbindgen/tests/expectations/tests/struct_with_anon_unnamed_struct.rs
index 1b77fccc..1b77fccc 100644
--- a/tests/expectations/tests/struct_with_anon_unnamed_struct.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_anon_unnamed_struct.rs
diff --git a/tests/expectations/tests/struct_with_anon_unnamed_union.rs b/libbindgen/tests/expectations/tests/struct_with_anon_unnamed_union.rs
index 2914eb41..2914eb41 100644
--- a/tests/expectations/tests/struct_with_anon_unnamed_union.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_anon_unnamed_union.rs
diff --git a/tests/expectations/tests/struct_with_bitfields.rs b/libbindgen/tests/expectations/tests/struct_with_bitfields.rs
index 3fb83a47..3fb83a47 100644
--- a/tests/expectations/tests/struct_with_bitfields.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_bitfields.rs
diff --git a/tests/expectations/tests/struct_with_derive_debug.rs b/libbindgen/tests/expectations/tests/struct_with_derive_debug.rs
index 52906a81..52906a81 100644
--- a/tests/expectations/tests/struct_with_derive_debug.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_derive_debug.rs
diff --git a/tests/expectations/tests/struct_with_nesting.rs b/libbindgen/tests/expectations/tests/struct_with_nesting.rs
index 97a0949e..97a0949e 100644
--- a/tests/expectations/tests/struct_with_nesting.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_nesting.rs
diff --git a/tests/expectations/tests/struct_with_packing.rs b/libbindgen/tests/expectations/tests/struct_with_packing.rs
index 93fc3f11..93fc3f11 100644
--- a/tests/expectations/tests/struct_with_packing.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_packing.rs
diff --git a/tests/expectations/tests/struct_with_struct.rs b/libbindgen/tests/expectations/tests/struct_with_struct.rs
index c8cdc927..c8cdc927 100644
--- a/tests/expectations/tests/struct_with_struct.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_struct.rs
diff --git a/tests/expectations/tests/struct_with_typedef_template_arg.rs b/libbindgen/tests/expectations/tests/struct_with_typedef_template_arg.rs
index 6f8d71f1..6f8d71f1 100644
--- a/tests/expectations/tests/struct_with_typedef_template_arg.rs
+++ b/libbindgen/tests/expectations/tests/struct_with_typedef_template_arg.rs
diff --git a/tests/expectations/tests/template.rs b/libbindgen/tests/expectations/tests/template.rs
index 76afc879..76afc879 100644
--- a/tests/expectations/tests/template.rs
+++ b/libbindgen/tests/expectations/tests/template.rs
diff --git a/tests/expectations/tests/template_alias.rs b/libbindgen/tests/expectations/tests/template_alias.rs
index 6457381f..6457381f 100644
--- a/tests/expectations/tests/template_alias.rs
+++ b/libbindgen/tests/expectations/tests/template_alias.rs
diff --git a/tests/expectations/tests/template_alias_basic.rs b/libbindgen/tests/expectations/tests/template_alias_basic.rs
index 656fff33..656fff33 100644
--- a/tests/expectations/tests/template_alias_basic.rs
+++ b/libbindgen/tests/expectations/tests/template_alias_basic.rs
diff --git a/tests/expectations/tests/template_alias_namespace.rs b/libbindgen/tests/expectations/tests/template_alias_namespace.rs
index 475c2b05..475c2b05 100644
--- a/tests/expectations/tests/template_alias_namespace.rs
+++ b/libbindgen/tests/expectations/tests/template_alias_namespace.rs
diff --git a/tests/expectations/tests/template_typedef_transitive_param.rs b/libbindgen/tests/expectations/tests/template_typedef_transitive_param.rs
index 166ddc3c..166ddc3c 100644
--- a/tests/expectations/tests/template_typedef_transitive_param.rs
+++ b/libbindgen/tests/expectations/tests/template_typedef_transitive_param.rs
diff --git a/tests/expectations/tests/template_typedefs.rs b/libbindgen/tests/expectations/tests/template_typedefs.rs
index 5f0d80b9..5f0d80b9 100644
--- a/tests/expectations/tests/template_typedefs.rs
+++ b/libbindgen/tests/expectations/tests/template_typedefs.rs
diff --git a/tests/expectations/tests/type_alias_empty.rs b/libbindgen/tests/expectations/tests/type_alias_empty.rs
index 47e36006..47e36006 100644
--- a/tests/expectations/tests/type_alias_empty.rs
+++ b/libbindgen/tests/expectations/tests/type_alias_empty.rs
diff --git a/tests/expectations/tests/typeref.rs b/libbindgen/tests/expectations/tests/typeref.rs
index da944146..da944146 100644
--- a/tests/expectations/tests/typeref.rs
+++ b/libbindgen/tests/expectations/tests/typeref.rs
diff --git a/tests/expectations/tests/union_dtor.rs b/libbindgen/tests/expectations/tests/union_dtor.rs
index 9be626ff..9be626ff 100644
--- a/tests/expectations/tests/union_dtor.rs
+++ b/libbindgen/tests/expectations/tests/union_dtor.rs
diff --git a/tests/expectations/tests/union_fields.rs b/libbindgen/tests/expectations/tests/union_fields.rs
index 495e80f9..495e80f9 100644
--- a/tests/expectations/tests/union_fields.rs
+++ b/libbindgen/tests/expectations/tests/union_fields.rs
diff --git a/tests/expectations/tests/union_template.rs b/libbindgen/tests/expectations/tests/union_template.rs
index fc92afb8..fc92afb8 100644
--- a/tests/expectations/tests/union_template.rs
+++ b/libbindgen/tests/expectations/tests/union_template.rs
diff --git a/tests/expectations/tests/union_with_anon_struct.rs b/libbindgen/tests/expectations/tests/union_with_anon_struct.rs
index f0a21512..f0a21512 100644
--- a/tests/expectations/tests/union_with_anon_struct.rs
+++ b/libbindgen/tests/expectations/tests/union_with_anon_struct.rs
diff --git a/tests/expectations/tests/union_with_anon_struct_bitfield.rs b/libbindgen/tests/expectations/tests/union_with_anon_struct_bitfield.rs
index 548b0dc4..548b0dc4 100644
--- a/tests/expectations/tests/union_with_anon_struct_bitfield.rs
+++ b/libbindgen/tests/expectations/tests/union_with_anon_struct_bitfield.rs
diff --git a/tests/expectations/tests/union_with_anon_union.rs b/libbindgen/tests/expectations/tests/union_with_anon_union.rs
index 95278556..95278556 100644
--- a/tests/expectations/tests/union_with_anon_union.rs
+++ b/libbindgen/tests/expectations/tests/union_with_anon_union.rs
diff --git a/tests/expectations/tests/union_with_anon_unnamed_struct.rs b/libbindgen/tests/expectations/tests/union_with_anon_unnamed_struct.rs
index 2d6fab97..2d6fab97 100644
--- a/tests/expectations/tests/union_with_anon_unnamed_struct.rs
+++ b/libbindgen/tests/expectations/tests/union_with_anon_unnamed_struct.rs
diff --git a/tests/expectations/tests/union_with_anon_unnamed_union.rs b/libbindgen/tests/expectations/tests/union_with_anon_unnamed_union.rs
index eb214017..eb214017 100644
--- a/tests/expectations/tests/union_with_anon_unnamed_union.rs
+++ b/libbindgen/tests/expectations/tests/union_with_anon_unnamed_union.rs
diff --git a/tests/expectations/tests/union_with_big_member.rs b/libbindgen/tests/expectations/tests/union_with_big_member.rs
index b921f33c..b921f33c 100644
--- a/tests/expectations/tests/union_with_big_member.rs
+++ b/libbindgen/tests/expectations/tests/union_with_big_member.rs
diff --git a/tests/expectations/tests/union_with_nesting.rs b/libbindgen/tests/expectations/tests/union_with_nesting.rs
index 61c08a2a..61c08a2a 100644
--- a/tests/expectations/tests/union_with_nesting.rs
+++ b/libbindgen/tests/expectations/tests/union_with_nesting.rs
diff --git a/tests/expectations/tests/unknown_attr.rs b/libbindgen/tests/expectations/tests/unknown_attr.rs
index fd9cce45..fd9cce45 100644
--- a/tests/expectations/tests/unknown_attr.rs
+++ b/libbindgen/tests/expectations/tests/unknown_attr.rs
diff --git a/tests/expectations/tests/use-core.rs b/libbindgen/tests/expectations/tests/use-core.rs
index b0900f5f..b0900f5f 100644
--- a/tests/expectations/tests/use-core.rs
+++ b/libbindgen/tests/expectations/tests/use-core.rs
diff --git a/tests/expectations/tests/using.rs b/libbindgen/tests/expectations/tests/using.rs
index dbb6c84f..dbb6c84f 100644
--- a/tests/expectations/tests/using.rs
+++ b/libbindgen/tests/expectations/tests/using.rs
diff --git a/tests/expectations/tests/vector.rs b/libbindgen/tests/expectations/tests/vector.rs
index b8ca5735..b8ca5735 100644
--- a/tests/expectations/tests/vector.rs
+++ b/libbindgen/tests/expectations/tests/vector.rs
diff --git a/tests/expectations/tests/virtual_dtor.rs b/libbindgen/tests/expectations/tests/virtual_dtor.rs
index 9571f084..9571f084 100644
--- a/tests/expectations/tests/virtual_dtor.rs
+++ b/libbindgen/tests/expectations/tests/virtual_dtor.rs
diff --git a/tests/expectations/tests/virtual_overloaded.rs b/libbindgen/tests/expectations/tests/virtual_overloaded.rs
index 7833cdbf..7833cdbf 100644
--- a/tests/expectations/tests/virtual_overloaded.rs
+++ b/libbindgen/tests/expectations/tests/virtual_overloaded.rs
diff --git a/tests/expectations/tests/vtable_recursive_sig.rs b/libbindgen/tests/expectations/tests/vtable_recursive_sig.rs
index ce62eeb0..ce62eeb0 100644
--- a/tests/expectations/tests/vtable_recursive_sig.rs
+++ b/libbindgen/tests/expectations/tests/vtable_recursive_sig.rs
diff --git a/tests/expectations/tests/weird_bitfields.rs b/libbindgen/tests/expectations/tests/weird_bitfields.rs
index 56ee76a5..56ee76a5 100644
--- a/tests/expectations/tests/weird_bitfields.rs
+++ b/libbindgen/tests/expectations/tests/weird_bitfields.rs
diff --git a/tests/expectations/tests/what_is_going_on.rs b/libbindgen/tests/expectations/tests/what_is_going_on.rs
index 6f1998d1..6f1998d1 100644
--- a/tests/expectations/tests/what_is_going_on.rs
+++ b/libbindgen/tests/expectations/tests/what_is_going_on.rs
diff --git a/tests/expectations/tests/whitelist_basic.rs b/libbindgen/tests/expectations/tests/whitelist_basic.rs
index 0104f049..0104f049 100644
--- a/tests/expectations/tests/whitelist_basic.rs
+++ b/libbindgen/tests/expectations/tests/whitelist_basic.rs
diff --git a/tests/expectations/tests/whitelist_vars.rs b/libbindgen/tests/expectations/tests/whitelist_vars.rs
index f7af24b2..f7af24b2 100644
--- a/tests/expectations/tests/whitelist_vars.rs
+++ b/libbindgen/tests/expectations/tests/whitelist_vars.rs
diff --git a/tests/headers/accessors.hpp b/libbindgen/tests/headers/accessors.hpp
index 4c23e35d..4c23e35d 100644
--- a/tests/headers/accessors.hpp
+++ b/libbindgen/tests/headers/accessors.hpp
diff --git a/tests/headers/annotation_hide.hpp b/libbindgen/tests/headers/annotation_hide.hpp
index 3c82c9a2..3c82c9a2 100644
--- a/tests/headers/annotation_hide.hpp
+++ b/libbindgen/tests/headers/annotation_hide.hpp
diff --git a/tests/headers/anon_enum.hpp b/libbindgen/tests/headers/anon_enum.hpp
index c7405202..c7405202 100644
--- a/tests/headers/anon_enum.hpp
+++ b/libbindgen/tests/headers/anon_enum.hpp
diff --git a/tests/headers/anon_enum_whitelist.h b/libbindgen/tests/headers/anon_enum_whitelist.h
index 15cda6b1..15cda6b1 100644
--- a/tests/headers/anon_enum_whitelist.h
+++ b/libbindgen/tests/headers/anon_enum_whitelist.h
diff --git a/tests/headers/anon_union.hpp b/libbindgen/tests/headers/anon_union.hpp
index 126f6a6e..126f6a6e 100644
--- a/tests/headers/anon_union.hpp
+++ b/libbindgen/tests/headers/anon_union.hpp
diff --git a/tests/headers/arg_keyword.hpp b/libbindgen/tests/headers/arg_keyword.hpp
index 9f0af850..9f0af850 100644
--- a/tests/headers/arg_keyword.hpp
+++ b/libbindgen/tests/headers/arg_keyword.hpp
diff --git a/tests/headers/base-to-derived.hpp b/libbindgen/tests/headers/base-to-derived.hpp
index ea31e0f2..ea31e0f2 100644
--- a/tests/headers/base-to-derived.hpp
+++ b/libbindgen/tests/headers/base-to-derived.hpp
diff --git a/tests/headers/bitfield-enum-basic.h b/libbindgen/tests/headers/bitfield-enum-basic.h
index 364bebf2..364bebf2 100644
--- a/tests/headers/bitfield-enum-basic.h
+++ b/libbindgen/tests/headers/bitfield-enum-basic.h
diff --git a/tests/headers/blocks.h b/libbindgen/tests/headers/blocks.h
index 80420e6e..80420e6e 100644
--- a/tests/headers/blocks.h
+++ b/libbindgen/tests/headers/blocks.h
diff --git a/tests/headers/class.hpp b/libbindgen/tests/headers/class.hpp
index e753f186..e753f186 100644
--- a/tests/headers/class.hpp
+++ b/libbindgen/tests/headers/class.hpp
diff --git a/tests/headers/class_nested.hpp b/libbindgen/tests/headers/class_nested.hpp
index ab38d500..ab38d500 100644
--- a/tests/headers/class_nested.hpp
+++ b/libbindgen/tests/headers/class_nested.hpp
diff --git a/tests/headers/class_no_members.hpp b/libbindgen/tests/headers/class_no_members.hpp
index a4483558..a4483558 100644
--- a/tests/headers/class_no_members.hpp
+++ b/libbindgen/tests/headers/class_no_members.hpp
diff --git a/tests/headers/class_static.hpp b/libbindgen/tests/headers/class_static.hpp
index 21ab2321..21ab2321 100644
--- a/tests/headers/class_static.hpp
+++ b/libbindgen/tests/headers/class_static.hpp
diff --git a/tests/headers/class_static_const.hpp b/libbindgen/tests/headers/class_static_const.hpp
index 150afe8b..150afe8b 100644
--- a/tests/headers/class_static_const.hpp
+++ b/libbindgen/tests/headers/class_static_const.hpp
diff --git a/tests/headers/class_use_as.hpp b/libbindgen/tests/headers/class_use_as.hpp
index a4e36ded..a4e36ded 100644
--- a/tests/headers/class_use_as.hpp
+++ b/libbindgen/tests/headers/class_use_as.hpp
diff --git a/tests/headers/class_with_dtor.hpp b/libbindgen/tests/headers/class_with_dtor.hpp
index b9bf74e1..b9bf74e1 100644
--- a/tests/headers/class_with_dtor.hpp
+++ b/libbindgen/tests/headers/class_with_dtor.hpp
diff --git a/tests/headers/class_with_inner_struct.hpp b/libbindgen/tests/headers/class_with_inner_struct.hpp
index ec729fe6..ec729fe6 100644
--- a/tests/headers/class_with_inner_struct.hpp
+++ b/libbindgen/tests/headers/class_with_inner_struct.hpp
diff --git a/tests/headers/class_with_typedef.hpp b/libbindgen/tests/headers/class_with_typedef.hpp
index 8707cffe..8707cffe 100644
--- a/tests/headers/class_with_typedef.hpp
+++ b/libbindgen/tests/headers/class_with_typedef.hpp
diff --git a/tests/headers/complex.h b/libbindgen/tests/headers/complex.h
index 04877a4e..04877a4e 100644
--- a/tests/headers/complex.h
+++ b/libbindgen/tests/headers/complex.h
diff --git a/tests/headers/complex_global.h b/libbindgen/tests/headers/complex_global.h
index d9f9fb01..d9f9fb01 100644
--- a/tests/headers/complex_global.h
+++ b/libbindgen/tests/headers/complex_global.h
diff --git a/tests/headers/const_enum_unnamed.hpp b/libbindgen/tests/headers/const_enum_unnamed.hpp
index eb139434..eb139434 100644
--- a/tests/headers/const_enum_unnamed.hpp
+++ b/libbindgen/tests/headers/const_enum_unnamed.hpp
diff --git a/tests/headers/const_ptr.hpp b/libbindgen/tests/headers/const_ptr.hpp
index 66744f8b..66744f8b 100644
--- a/tests/headers/const_ptr.hpp
+++ b/libbindgen/tests/headers/const_ptr.hpp
diff --git a/tests/headers/const_resolved_ty.h b/libbindgen/tests/headers/const_resolved_ty.h
index 2521e61c..2521e61c 100644
--- a/tests/headers/const_resolved_ty.h
+++ b/libbindgen/tests/headers/const_resolved_ty.h
diff --git a/tests/headers/const_tparam.hpp b/libbindgen/tests/headers/const_tparam.hpp
index 05f26e4a..05f26e4a 100644
--- a/tests/headers/const_tparam.hpp
+++ b/libbindgen/tests/headers/const_tparam.hpp
diff --git a/tests/headers/convert-floats.h b/libbindgen/tests/headers/convert-floats.h
index 08d9fe0b..08d9fe0b 100644
--- a/tests/headers/convert-floats.h
+++ b/libbindgen/tests/headers/convert-floats.h
diff --git a/tests/headers/crtp.hpp b/libbindgen/tests/headers/crtp.hpp
index a5477c54..a5477c54 100644
--- a/tests/headers/crtp.hpp
+++ b/libbindgen/tests/headers/crtp.hpp
diff --git a/tests/headers/decl_extern_int_twice.h b/libbindgen/tests/headers/decl_extern_int_twice.h
index 06f80e87..06f80e87 100644
--- a/tests/headers/decl_extern_int_twice.h
+++ b/libbindgen/tests/headers/decl_extern_int_twice.h
diff --git a/tests/headers/decl_ptr_to_array.h b/libbindgen/tests/headers/decl_ptr_to_array.h
index 3222cbd4..3222cbd4 100644
--- a/tests/headers/decl_ptr_to_array.h
+++ b/libbindgen/tests/headers/decl_ptr_to_array.h
diff --git a/tests/headers/duplicated_constants_in_ns.hpp b/libbindgen/tests/headers/duplicated_constants_in_ns.hpp
index bb343641..bb343641 100644
--- a/tests/headers/duplicated_constants_in_ns.hpp
+++ b/libbindgen/tests/headers/duplicated_constants_in_ns.hpp
diff --git a/tests/headers/elaborated.hpp b/libbindgen/tests/headers/elaborated.hpp
index 4bfbff23..4bfbff23 100644
--- a/tests/headers/elaborated.hpp
+++ b/libbindgen/tests/headers/elaborated.hpp
diff --git a/tests/headers/empty_template_param_name.hpp b/libbindgen/tests/headers/empty_template_param_name.hpp
index b3360bc9..b3360bc9 100644
--- a/tests/headers/empty_template_param_name.hpp
+++ b/libbindgen/tests/headers/empty_template_param_name.hpp
diff --git a/tests/headers/enum.h b/libbindgen/tests/headers/enum.h
index f2d301e7..f2d301e7 100644
--- a/tests/headers/enum.h
+++ b/libbindgen/tests/headers/enum.h
diff --git a/tests/headers/enum_alias.hpp b/libbindgen/tests/headers/enum_alias.hpp
index 658f8fde..658f8fde 100644
--- a/tests/headers/enum_alias.hpp
+++ b/libbindgen/tests/headers/enum_alias.hpp
diff --git a/tests/headers/enum_and_vtable_mangling.hpp b/libbindgen/tests/headers/enum_and_vtable_mangling.hpp
index 3abd6a29..3abd6a29 100644
--- a/tests/headers/enum_and_vtable_mangling.hpp
+++ b/libbindgen/tests/headers/enum_and_vtable_mangling.hpp
diff --git a/tests/headers/enum_dupe.h b/libbindgen/tests/headers/enum_dupe.h
index 6d3591d5..6d3591d5 100644
--- a/tests/headers/enum_dupe.h
+++ b/libbindgen/tests/headers/enum_dupe.h
diff --git a/tests/headers/enum_explicit_type.hpp b/libbindgen/tests/headers/enum_explicit_type.hpp
index 78eadd40..78eadd40 100644
--- a/tests/headers/enum_explicit_type.hpp
+++ b/libbindgen/tests/headers/enum_explicit_type.hpp
diff --git a/tests/headers/enum_negative.h b/libbindgen/tests/headers/enum_negative.h
index 6cbdfe04..6cbdfe04 100644
--- a/tests/headers/enum_negative.h
+++ b/libbindgen/tests/headers/enum_negative.h
diff --git a/tests/headers/enum_packed.h b/libbindgen/tests/headers/enum_packed.h
index 8654d110..8654d110 100644
--- a/tests/headers/enum_packed.h
+++ b/libbindgen/tests/headers/enum_packed.h
diff --git a/tests/headers/extern.hpp b/libbindgen/tests/headers/extern.hpp
index 0779e038..0779e038 100644
--- a/tests/headers/extern.hpp
+++ b/libbindgen/tests/headers/extern.hpp
diff --git a/tests/headers/float128.hpp b/libbindgen/tests/headers/float128.hpp
index f554e88e..f554e88e 100644
--- a/tests/headers/float128.hpp
+++ b/libbindgen/tests/headers/float128.hpp
diff --git a/tests/headers/forward-inherit-struct-with-fields.hpp b/libbindgen/tests/headers/forward-inherit-struct-with-fields.hpp
index 437fff5d..437fff5d 100644
--- a/tests/headers/forward-inherit-struct-with-fields.hpp
+++ b/libbindgen/tests/headers/forward-inherit-struct-with-fields.hpp
diff --git a/tests/headers/forward-inherit-struct.hpp b/libbindgen/tests/headers/forward-inherit-struct.hpp
index ac7aef5e..ac7aef5e 100644
--- a/tests/headers/forward-inherit-struct.hpp
+++ b/libbindgen/tests/headers/forward-inherit-struct.hpp
diff --git a/tests/headers/forward_declared_struct.h b/libbindgen/tests/headers/forward_declared_struct.h
index 2a69450c..2a69450c 100644
--- a/tests/headers/forward_declared_struct.h
+++ b/libbindgen/tests/headers/forward_declared_struct.h
diff --git a/tests/headers/func_proto.h b/libbindgen/tests/headers/func_proto.h
index 51139ca9..51139ca9 100644
--- a/tests/headers/func_proto.h
+++ b/libbindgen/tests/headers/func_proto.h
diff --git a/tests/headers/func_ptr.h b/libbindgen/tests/headers/func_ptr.h
index a4662f3d..a4662f3d 100644
--- a/tests/headers/func_ptr.h
+++ b/libbindgen/tests/headers/func_ptr.h
diff --git a/tests/headers/func_ptr_in_struct.h b/libbindgen/tests/headers/func_ptr_in_struct.h
index 988db5b3..988db5b3 100644
--- a/tests/headers/func_ptr_in_struct.h
+++ b/libbindgen/tests/headers/func_ptr_in_struct.h
diff --git a/tests/headers/func_with_array_arg.h b/libbindgen/tests/headers/func_with_array_arg.h
index 1b81702b..1b81702b 100644
--- a/tests/headers/func_with_array_arg.h
+++ b/libbindgen/tests/headers/func_with_array_arg.h
diff --git a/tests/headers/func_with_func_ptr_arg.h b/libbindgen/tests/headers/func_with_func_ptr_arg.h
index 629c84ab..629c84ab 100644
--- a/tests/headers/func_with_func_ptr_arg.h
+++ b/libbindgen/tests/headers/func_with_func_ptr_arg.h
diff --git a/tests/headers/in_class_typedef.hpp b/libbindgen/tests/headers/in_class_typedef.hpp
index dda7472d..dda7472d 100644
--- a/tests/headers/in_class_typedef.hpp
+++ b/libbindgen/tests/headers/in_class_typedef.hpp
diff --git a/tests/headers/inherit-namespaced.hpp b/libbindgen/tests/headers/inherit-namespaced.hpp
index 61eafd5a..61eafd5a 100644
--- a/tests/headers/inherit-namespaced.hpp
+++ b/libbindgen/tests/headers/inherit-namespaced.hpp
diff --git a/tests/headers/inherit_named.hpp b/libbindgen/tests/headers/inherit_named.hpp
index 9881d1b6..9881d1b6 100644
--- a/tests/headers/inherit_named.hpp
+++ b/libbindgen/tests/headers/inherit_named.hpp
diff --git a/tests/headers/inherit_typedef.hpp b/libbindgen/tests/headers/inherit_typedef.hpp
index 8d699e82..8d699e82 100644
--- a/tests/headers/inherit_typedef.hpp
+++ b/libbindgen/tests/headers/inherit_typedef.hpp
diff --git a/tests/headers/inner_const.hpp b/libbindgen/tests/headers/inner_const.hpp
index 25c2e603..25c2e603 100644
--- a/tests/headers/inner_const.hpp
+++ b/libbindgen/tests/headers/inner_const.hpp
diff --git a/tests/headers/inner_template_self.hpp b/libbindgen/tests/headers/inner_template_self.hpp
index 1ae5af06..1ae5af06 100644
--- a/tests/headers/inner_template_self.hpp
+++ b/libbindgen/tests/headers/inner_template_self.hpp
diff --git a/tests/headers/int128_t.h b/libbindgen/tests/headers/int128_t.h
index eece252c..eece252c 100644
--- a/tests/headers/int128_t.h
+++ b/libbindgen/tests/headers/int128_t.h
diff --git a/tests/headers/jsval_layout_opaque.hpp b/libbindgen/tests/headers/jsval_layout_opaque.hpp
index 85c5be63..85c5be63 100644
--- a/tests/headers/jsval_layout_opaque.hpp
+++ b/libbindgen/tests/headers/jsval_layout_opaque.hpp
diff --git a/tests/headers/keywords.h b/libbindgen/tests/headers/keywords.h
index 8699ce5f..8699ce5f 100644
--- a/tests/headers/keywords.h
+++ b/libbindgen/tests/headers/keywords.h
diff --git a/tests/headers/macro-expr-basic.h b/libbindgen/tests/headers/macro-expr-basic.h
index d2de7fdf..d2de7fdf 100644
--- a/tests/headers/macro-expr-basic.h
+++ b/libbindgen/tests/headers/macro-expr-basic.h
diff --git a/tests/headers/macro-redef.h b/libbindgen/tests/headers/macro-redef.h
index 0180d2ab..0180d2ab 100644
--- a/tests/headers/macro-redef.h
+++ b/libbindgen/tests/headers/macro-redef.h
diff --git a/tests/headers/multiple-inherit-empty-correct-layout.hpp b/libbindgen/tests/headers/multiple-inherit-empty-correct-layout.hpp
index 1e2b133a..1e2b133a 100644
--- a/tests/headers/multiple-inherit-empty-correct-layout.hpp
+++ b/libbindgen/tests/headers/multiple-inherit-empty-correct-layout.hpp
diff --git a/tests/headers/mutable.hpp b/libbindgen/tests/headers/mutable.hpp
index b61a1031..b61a1031 100644
--- a/tests/headers/mutable.hpp
+++ b/libbindgen/tests/headers/mutable.hpp
diff --git a/tests/headers/namespace.hpp b/libbindgen/tests/headers/namespace.hpp
index 65788539..65788539 100644
--- a/tests/headers/namespace.hpp
+++ b/libbindgen/tests/headers/namespace.hpp
diff --git a/tests/headers/nested.hpp b/libbindgen/tests/headers/nested.hpp
index 299e1768..299e1768 100644
--- a/tests/headers/nested.hpp
+++ b/libbindgen/tests/headers/nested.hpp
diff --git a/tests/headers/nested_vtable.hpp b/libbindgen/tests/headers/nested_vtable.hpp
index 87d6ce1f..87d6ce1f 100644
--- a/tests/headers/nested_vtable.hpp
+++ b/libbindgen/tests/headers/nested_vtable.hpp
diff --git a/tests/headers/no-std.h b/libbindgen/tests/headers/no-std.h
index 7bee9657..7bee9657 100644
--- a/tests/headers/no-std.h
+++ b/libbindgen/tests/headers/no-std.h
diff --git a/tests/headers/no_copy.hpp b/libbindgen/tests/headers/no_copy.hpp
index 349e428e..349e428e 100644
--- a/tests/headers/no_copy.hpp
+++ b/libbindgen/tests/headers/no_copy.hpp
diff --git a/tests/headers/nsStyleAutoArray.hpp b/libbindgen/tests/headers/nsStyleAutoArray.hpp
index 950152c0..950152c0 100644
--- a/tests/headers/nsStyleAutoArray.hpp
+++ b/libbindgen/tests/headers/nsStyleAutoArray.hpp
diff --git a/tests/headers/only_bitfields.hpp b/libbindgen/tests/headers/only_bitfields.hpp
index 84db0586..84db0586 100644
--- a/tests/headers/only_bitfields.hpp
+++ b/libbindgen/tests/headers/only_bitfields.hpp
diff --git a/tests/headers/opaque_in_struct.hpp b/libbindgen/tests/headers/opaque_in_struct.hpp
index 3cffeb20..3cffeb20 100644
--- a/tests/headers/opaque_in_struct.hpp
+++ b/libbindgen/tests/headers/opaque_in_struct.hpp
diff --git a/tests/headers/opaque_pointer.hpp b/libbindgen/tests/headers/opaque_pointer.hpp
index 53f8ce1f..53f8ce1f 100644
--- a/tests/headers/opaque_pointer.hpp
+++ b/libbindgen/tests/headers/opaque_pointer.hpp
diff --git a/tests/headers/opaque_typedef.hpp b/libbindgen/tests/headers/opaque_typedef.hpp
index 25640738..25640738 100644
--- a/tests/headers/opaque_typedef.hpp
+++ b/libbindgen/tests/headers/opaque_typedef.hpp
diff --git a/tests/headers/overflowed_enum.hpp b/libbindgen/tests/headers/overflowed_enum.hpp
index 1f2075a5..1f2075a5 100644
--- a/tests/headers/overflowed_enum.hpp
+++ b/libbindgen/tests/headers/overflowed_enum.hpp
diff --git a/tests/headers/overloading.hpp b/libbindgen/tests/headers/overloading.hpp
index 3c2b0487..3c2b0487 100644
--- a/tests/headers/overloading.hpp
+++ b/libbindgen/tests/headers/overloading.hpp
diff --git a/tests/headers/private.hpp b/libbindgen/tests/headers/private.hpp
index c0f3ce7f..c0f3ce7f 100644
--- a/tests/headers/private.hpp
+++ b/libbindgen/tests/headers/private.hpp
diff --git a/tests/headers/redeclaration.hpp b/libbindgen/tests/headers/redeclaration.hpp
index d536b158..d536b158 100644
--- a/tests/headers/redeclaration.hpp
+++ b/libbindgen/tests/headers/redeclaration.hpp
diff --git a/tests/headers/ref_argument_array.hpp b/libbindgen/tests/headers/ref_argument_array.hpp
index dc73fd62..dc73fd62 100644
--- a/tests/headers/ref_argument_array.hpp
+++ b/libbindgen/tests/headers/ref_argument_array.hpp
diff --git a/tests/headers/replace_template_alias.hpp b/libbindgen/tests/headers/replace_template_alias.hpp
index 6ceae4e5..6ceae4e5 100644
--- a/tests/headers/replace_template_alias.hpp
+++ b/libbindgen/tests/headers/replace_template_alias.hpp
diff --git a/tests/headers/replaces_double.hpp b/libbindgen/tests/headers/replaces_double.hpp
index 1a78b0d9..1a78b0d9 100644
--- a/tests/headers/replaces_double.hpp
+++ b/libbindgen/tests/headers/replaces_double.hpp
diff --git a/tests/headers/size_t_template.hpp b/libbindgen/tests/headers/size_t_template.hpp
index 6045c698..6045c698 100644
--- a/tests/headers/size_t_template.hpp
+++ b/libbindgen/tests/headers/size_t_template.hpp
diff --git a/tests/headers/struct_containing_forward_declared_struct.h b/libbindgen/tests/headers/struct_containing_forward_declared_struct.h
index d38aca2f..d38aca2f 100644
--- a/tests/headers/struct_containing_forward_declared_struct.h
+++ b/libbindgen/tests/headers/struct_containing_forward_declared_struct.h
diff --git a/tests/headers/struct_with_anon_struct.h b/libbindgen/tests/headers/struct_with_anon_struct.h
index 1617d7a8..1617d7a8 100644
--- a/tests/headers/struct_with_anon_struct.h
+++ b/libbindgen/tests/headers/struct_with_anon_struct.h
diff --git a/tests/headers/struct_with_anon_struct_array.h b/libbindgen/tests/headers/struct_with_anon_struct_array.h
index 9ea977e8..9ea977e8 100644
--- a/tests/headers/struct_with_anon_struct_array.h
+++ b/libbindgen/tests/headers/struct_with_anon_struct_array.h
diff --git a/tests/headers/struct_with_anon_struct_pointer.h b/libbindgen/tests/headers/struct_with_anon_struct_pointer.h
index 0c486d84..0c486d84 100644
--- a/tests/headers/struct_with_anon_struct_pointer.h
+++ b/libbindgen/tests/headers/struct_with_anon_struct_pointer.h
diff --git a/tests/headers/struct_with_anon_union.h b/libbindgen/tests/headers/struct_with_anon_union.h
index 3a92b940..3a92b940 100644
--- a/tests/headers/struct_with_anon_union.h
+++ b/libbindgen/tests/headers/struct_with_anon_union.h
diff --git a/tests/headers/struct_with_anon_unnamed_struct.h b/libbindgen/tests/headers/struct_with_anon_unnamed_struct.h
index f8ac4225..f8ac4225 100644
--- a/tests/headers/struct_with_anon_unnamed_struct.h
+++ b/libbindgen/tests/headers/struct_with_anon_unnamed_struct.h
diff --git a/tests/headers/struct_with_anon_unnamed_union.h b/libbindgen/tests/headers/struct_with_anon_unnamed_union.h
index 7158e727..7158e727 100644
--- a/tests/headers/struct_with_anon_unnamed_union.h
+++ b/libbindgen/tests/headers/struct_with_anon_unnamed_union.h
diff --git a/tests/headers/struct_with_bitfields.h b/libbindgen/tests/headers/struct_with_bitfields.h
index 107fb136..107fb136 100644
--- a/tests/headers/struct_with_bitfields.h
+++ b/libbindgen/tests/headers/struct_with_bitfields.h
diff --git a/tests/headers/struct_with_derive_debug.h b/libbindgen/tests/headers/struct_with_derive_debug.h
index 98ba1b3d..98ba1b3d 100644
--- a/tests/headers/struct_with_derive_debug.h
+++ b/libbindgen/tests/headers/struct_with_derive_debug.h
diff --git a/tests/headers/struct_with_nesting.h b/libbindgen/tests/headers/struct_with_nesting.h
index 9d7fa176..9d7fa176 100644
--- a/tests/headers/struct_with_nesting.h
+++ b/libbindgen/tests/headers/struct_with_nesting.h
diff --git a/tests/headers/struct_with_packing.h b/libbindgen/tests/headers/struct_with_packing.h
index 1b9fe131..1b9fe131 100644
--- a/tests/headers/struct_with_packing.h
+++ b/libbindgen/tests/headers/struct_with_packing.h
diff --git a/tests/headers/struct_with_struct.h b/libbindgen/tests/headers/struct_with_struct.h
index 78b1cc81..78b1cc81 100644
--- a/tests/headers/struct_with_struct.h
+++ b/libbindgen/tests/headers/struct_with_struct.h
diff --git a/tests/headers/struct_with_typedef_template_arg.hpp b/libbindgen/tests/headers/struct_with_typedef_template_arg.hpp
index 7fed21ab..7fed21ab 100644
--- a/tests/headers/struct_with_typedef_template_arg.hpp
+++ b/libbindgen/tests/headers/struct_with_typedef_template_arg.hpp
diff --git a/tests/headers/template.hpp b/libbindgen/tests/headers/template.hpp
index c13643c3..c13643c3 100644
--- a/tests/headers/template.hpp
+++ b/libbindgen/tests/headers/template.hpp
diff --git a/tests/headers/template_alias.hpp b/libbindgen/tests/headers/template_alias.hpp
index 646d9f40..646d9f40 100644
--- a/tests/headers/template_alias.hpp
+++ b/libbindgen/tests/headers/template_alias.hpp
diff --git a/tests/headers/template_alias_basic.hpp b/libbindgen/tests/headers/template_alias_basic.hpp
index 964f6e27..964f6e27 100644
--- a/tests/headers/template_alias_basic.hpp
+++ b/libbindgen/tests/headers/template_alias_basic.hpp
diff --git a/tests/headers/template_alias_namespace.hpp b/libbindgen/tests/headers/template_alias_namespace.hpp
index bd637166..bd637166 100644
--- a/tests/headers/template_alias_namespace.hpp
+++ b/libbindgen/tests/headers/template_alias_namespace.hpp
diff --git a/tests/headers/template_typedef_transitive_param.hpp b/libbindgen/tests/headers/template_typedef_transitive_param.hpp
index 2269ac36..2269ac36 100644
--- a/tests/headers/template_typedef_transitive_param.hpp
+++ b/libbindgen/tests/headers/template_typedef_transitive_param.hpp
diff --git a/tests/headers/template_typedefs.hpp b/libbindgen/tests/headers/template_typedefs.hpp
index 5e13dcd8..5e13dcd8 100644
--- a/tests/headers/template_typedefs.hpp
+++ b/libbindgen/tests/headers/template_typedefs.hpp
diff --git a/tests/headers/type_alias_empty.hpp b/libbindgen/tests/headers/type_alias_empty.hpp
index f0760c8f..f0760c8f 100644
--- a/tests/headers/type_alias_empty.hpp
+++ b/libbindgen/tests/headers/type_alias_empty.hpp
diff --git a/tests/headers/typeref.hpp b/libbindgen/tests/headers/typeref.hpp
index b94c98ef..b94c98ef 100644
--- a/tests/headers/typeref.hpp
+++ b/libbindgen/tests/headers/typeref.hpp
diff --git a/tests/headers/union_dtor.hpp b/libbindgen/tests/headers/union_dtor.hpp
index 399dc89d..399dc89d 100644
--- a/tests/headers/union_dtor.hpp
+++ b/libbindgen/tests/headers/union_dtor.hpp
diff --git a/tests/headers/union_fields.hpp b/libbindgen/tests/headers/union_fields.hpp
index aec3a7fd..aec3a7fd 100644
--- a/tests/headers/union_fields.hpp
+++ b/libbindgen/tests/headers/union_fields.hpp
diff --git a/tests/headers/union_template.hpp b/libbindgen/tests/headers/union_template.hpp
index 0d0a9bb3..0d0a9bb3 100644
--- a/tests/headers/union_template.hpp
+++ b/libbindgen/tests/headers/union_template.hpp
diff --git a/tests/headers/union_with_anon_struct.h b/libbindgen/tests/headers/union_with_anon_struct.h
index 7f8dec95..7f8dec95 100644
--- a/tests/headers/union_with_anon_struct.h
+++ b/libbindgen/tests/headers/union_with_anon_struct.h
diff --git a/tests/headers/union_with_anon_struct_bitfield.h b/libbindgen/tests/headers/union_with_anon_struct_bitfield.h
index 24c7dce8..24c7dce8 100644
--- a/tests/headers/union_with_anon_struct_bitfield.h
+++ b/libbindgen/tests/headers/union_with_anon_struct_bitfield.h
diff --git a/tests/headers/union_with_anon_union.h b/libbindgen/tests/headers/union_with_anon_union.h
index 212431b8..212431b8 100644
--- a/tests/headers/union_with_anon_union.h
+++ b/libbindgen/tests/headers/union_with_anon_union.h
diff --git a/tests/headers/union_with_anon_unnamed_struct.h b/libbindgen/tests/headers/union_with_anon_unnamed_struct.h
index 79558049..79558049 100644
--- a/tests/headers/union_with_anon_unnamed_struct.h
+++ b/libbindgen/tests/headers/union_with_anon_unnamed_struct.h
diff --git a/tests/headers/union_with_anon_unnamed_union.h b/libbindgen/tests/headers/union_with_anon_unnamed_union.h
index 7580771a..7580771a 100644
--- a/tests/headers/union_with_anon_unnamed_union.h
+++ b/libbindgen/tests/headers/union_with_anon_unnamed_union.h
diff --git a/tests/headers/union_with_big_member.h b/libbindgen/tests/headers/union_with_big_member.h
index 6347d6ca..6347d6ca 100644
--- a/tests/headers/union_with_big_member.h
+++ b/libbindgen/tests/headers/union_with_big_member.h
diff --git a/tests/headers/union_with_nesting.h b/libbindgen/tests/headers/union_with_nesting.h
index cd907d57..cd907d57 100644
--- a/tests/headers/union_with_nesting.h
+++ b/libbindgen/tests/headers/union_with_nesting.h
diff --git a/tests/headers/unknown_attr.h b/libbindgen/tests/headers/unknown_attr.h
index f87e9f0b..f87e9f0b 100644
--- a/tests/headers/unknown_attr.h
+++ b/libbindgen/tests/headers/unknown_attr.h
diff --git a/tests/headers/use-core.h b/libbindgen/tests/headers/use-core.h
index 42bb10d9..42bb10d9 100644
--- a/tests/headers/use-core.h
+++ b/libbindgen/tests/headers/use-core.h
diff --git a/tests/headers/using.hpp b/libbindgen/tests/headers/using.hpp
index ba07b9c8..ba07b9c8 100644
--- a/tests/headers/using.hpp
+++ b/libbindgen/tests/headers/using.hpp
diff --git a/tests/headers/vector.hpp b/libbindgen/tests/headers/vector.hpp
index 4707f77f..4707f77f 100644
--- a/tests/headers/vector.hpp
+++ b/libbindgen/tests/headers/vector.hpp
diff --git a/tests/headers/virtual_dtor.hpp b/libbindgen/tests/headers/virtual_dtor.hpp
index c35dcab1..c35dcab1 100644
--- a/tests/headers/virtual_dtor.hpp
+++ b/libbindgen/tests/headers/virtual_dtor.hpp
diff --git a/tests/headers/virtual_overloaded.hpp b/libbindgen/tests/headers/virtual_overloaded.hpp
index 8aea8a19..8aea8a19 100644
--- a/tests/headers/virtual_overloaded.hpp
+++ b/libbindgen/tests/headers/virtual_overloaded.hpp
diff --git a/tests/headers/vtable_recursive_sig.hpp b/libbindgen/tests/headers/vtable_recursive_sig.hpp
index 8729be00..8729be00 100644
--- a/tests/headers/vtable_recursive_sig.hpp
+++ b/libbindgen/tests/headers/vtable_recursive_sig.hpp
diff --git a/tests/headers/weird_bitfields.hpp b/libbindgen/tests/headers/weird_bitfields.hpp
index 755681c1..755681c1 100644
--- a/tests/headers/weird_bitfields.hpp
+++ b/libbindgen/tests/headers/weird_bitfields.hpp
diff --git a/tests/headers/what_is_going_on.hpp b/libbindgen/tests/headers/what_is_going_on.hpp
index 078c1ad5..078c1ad5 100644
--- a/tests/headers/what_is_going_on.hpp
+++ b/libbindgen/tests/headers/what_is_going_on.hpp
diff --git a/tests/headers/whitelist_basic.hpp b/libbindgen/tests/headers/whitelist_basic.hpp
index 8424f75a..8424f75a 100644
--- a/tests/headers/whitelist_basic.hpp
+++ b/libbindgen/tests/headers/whitelist_basic.hpp
diff --git a/tests/headers/whitelist_vars.h b/libbindgen/tests/headers/whitelist_vars.h
index 07fa2815..07fa2815 100644
--- a/tests/headers/whitelist_vars.h
+++ b/libbindgen/tests/headers/whitelist_vars.h
diff --git a/libbindgen/tests/tests.rs b/libbindgen/tests/tests.rs
new file mode 100644
index 00000000..c9826260
--- /dev/null
+++ b/libbindgen/tests/tests.rs
@@ -0,0 +1,138 @@
+extern crate clap;
+extern crate diff;
+#[macro_use]
+extern crate env_logger;
+extern crate libbindgen;
+extern crate log;
+extern crate shlex;
+
+use std::env;
+use std::fs;
+use std::io::{BufRead, BufReader, Error, ErrorKind, Read};
+use std::path::{Path, PathBuf};
+
+#[path="../../src/options.rs"]
+mod options;
+use options::builder_from_flags;
+
+fn compare_generated_header(header: &PathBuf,
+ builder: libbindgen::Builder)
+ -> Result<(), Error> {
+ let file_name = try!(header.file_name()
+ .ok_or(Error::new(ErrorKind::Other, "spawn_bindgen expects a file")));
+
+ let mut expected = PathBuf::from(header);
+ expected.pop();
+ expected.pop();
+ expected.push("expectations");
+ expected.push("tests");
+ expected.push(file_name);
+ expected.set_extension("rs");
+
+ // We skip the generate() error here so we get a full diff below
+ let output = match builder.generate() {
+ Ok(bindings) => bindings.to_string(),
+ Err(_) => "".to_string(),
+ };
+
+ let mut buffer = String::new();
+ let f = try!(fs::File::open(&expected));
+ let _ = try!(BufReader::new(f).read_to_string(&mut buffer));
+
+ if output == buffer {
+ return Ok(());
+ }
+
+ println!("diff expected generated");
+ println!("--- expected: {:?}", expected);
+ println!("+++ generated from: {:?}", header);
+
+ for diff in diff::lines(&buffer, &output) {
+ match diff {
+ diff::Result::Left(l) => println!("-{}", l),
+ diff::Result::Both(l, _) => println!(" {}", l),
+ diff::Result::Right(r) => println!("+{}", r),
+ }
+ }
+ Err(Error::new(ErrorKind::Other, "Header and binding differ!"))
+}
+
+fn create_bindgen_builder(header: &PathBuf)
+ -> Result<libbindgen::Builder, Error> {
+ let source = try!(fs::File::open(header));
+ let reader = BufReader::new(source);
+
+ // Scoop up bindgen-flags from test header
+ let line: String = try!(reader.lines().take(1).collect());
+ let flags: Vec<String> = if line.contains("bindgen-flags:") {
+ line.split("bindgen-flags:").last().and_then(shlex::split)
+ } else {
+ None
+ }.unwrap_or(Vec::with_capacity(2));
+
+ // Fool builder_from_flags() into believing it has real env::args_os...
+ // - add "bindgen" as executable name 0th element
+ // - add header filename as 1st element
+ // - prepend raw lines so they're in the right order for expected output
+ // - append the test header's bindgen flags
+ let header_str = try!(header.to_str()
+ .ok_or(Error::new(ErrorKind::Other, "Invalid header file name")));
+
+ let prepend = [
+ "bindgen",
+ header_str,
+ "--raw-line", "",
+ "--raw-line", "#![allow(non_snake_case)]",
+ "--raw-line", "",
+ ];
+
+ let args = prepend.into_iter()
+ .map(ToString::to_string)
+ .chain(flags.into_iter());
+
+ builder_from_flags(args).map(|(builder, _)| builder.no_unstable_rust())
+}
+
+#[test]
+fn run_bindgen_tests() {
+ log::set_logger(|max_log_level| {
+ use env_logger::Logger;
+ let env_logger = Logger::new();
+ max_log_level.set(env_logger.filter());
+ Box::new(env_logger)
+ })
+ .expect("Failed to set logger.");
+
+ let manifest_env = env::var("CARGO_MANIFEST_DIR")
+ .expect("CARGO_MANIFEST_DIR not set!");
+ let manifest_dir = Path::new(&manifest_env);
+ let headers_dir = manifest_dir.join("tests").join("headers");
+
+ let entries = fs::read_dir(&headers_dir)
+ .expect("Couldn't read headers dir")
+ .map(|result| result.expect("Couldn't read header file"));
+
+ let headers: Vec<_> = entries.filter_map(|entry| {
+ match entry.path().extension().and_then(|s| s.to_str()) {
+ Some("h") | Some("hpp") => Some(entry.path()),
+ _ => None,
+ }
+ })
+ .collect();
+
+ let failures: Vec<_> = headers.iter()
+ .filter_map(|header| {
+ create_bindgen_builder(header)
+ .and_then(|builder| compare_generated_header(header, builder))
+ .err()
+ })
+ .collect();
+
+ let num_failures = failures.len();
+
+ if num_failures > 0 {
+ panic!("{} test{} failed!",
+ num_failures,
+ if num_failures > 1 {"s"} else {""});
+ }
+}
diff --git a/tests/uses/.gitignore b/libbindgen/tests/uses/.gitignore
index 40d7cb4c..40d7cb4c 100644
--- a/tests/uses/.gitignore
+++ b/libbindgen/tests/uses/.gitignore
diff --git a/src/bin/bindgen.rs b/src/main.rs
index 14e882bc..8cbff63b 100755..100644
--- a/src/bin/bindgen.rs
+++ b/src/main.rs
@@ -1,7 +1,4 @@
-#![crate_name = "bindgen"]
-#![crate_type = "bin"]
-
-extern crate bindgen;
+extern crate libbindgen;
extern crate env_logger;
#[macro_use]
extern crate log;
@@ -9,7 +6,7 @@ extern crate clang_sys;
extern crate clap;
extern crate rustc_serialize;
-use bindgen::clang_version;
+use libbindgen::clang_version;
use std::env;
mod options;
diff --git a/src/bin/options.rs b/src/options.rs
index 9f746fd0..c3c6a1f2 100644
--- a/src/bin/options.rs
+++ b/src/options.rs
@@ -1,8 +1,5 @@
-
-
-use bindgen::{Builder, builder};
-
use clap::{App, Arg};
+use libbindgen::{Builder, builder};
use std::fs::File;
use std::io::{self, Error, ErrorKind};
diff --git a/tests/tests.rs b/tests/tests.rs
deleted file mode 100644
index 1f72fccf..00000000
--- a/tests/tests.rs
+++ /dev/null
@@ -1,171 +0,0 @@
-// We add this `extern crate` here to ensure that bindgen is up-to-date and
-// rebuilt, even though we aren't using any of its types or functions here, only
-// indirectly calling the executable.
-#[allow(dead_code)]
-extern crate bindgen;
-
-use std::env;
-use std::fs;
-use std::io::Read;
-use std::path::{Path, PathBuf};
-use std::process;
-
-const TEST_BATCH_DEFAULT_SIZE: usize = 16;
-
-fn spawn_run_bindgen<P, Q, R>(run_bindgen: P,
- bindgen: Q,
- header: R)
- -> process::Child
- where P: AsRef<Path>,
- Q: AsRef<Path>,
- R: AsRef<Path>,
-{
- let run_bindgen = run_bindgen.as_ref();
- let bindgen = bindgen.as_ref();
- let header = header.as_ref();
-
- // Convert from "tests/headers/foo.hpp" to "tests/expectations/tests/foo.rs" by
- // saving the filename, popping off "headers/foo.hpp", pushing
- // "expectations/tests", pushing the saved filename, and finally modifying the
- // extension.
-
- let mut expected = PathBuf::from(header);
- let file_name = expected.file_name()
- .expect("Should have filename")
- .to_os_string();
- expected.pop();
- expected.pop();
- expected.push("expectations");
- expected.push("tests");
- expected.push(file_name);
- expected.set_extension("rs");
-
- // And the same style conversion as above, but for the dummy uses. We assume
- // that .hpp means we should generate a .cpp uses file, and .h means we
- // should generate a .c file.
-
- let mut dummy_uses = PathBuf::from(header);
- let file_name = dummy_uses.file_name()
- .expect("Should still have filename")
- .to_os_string();
- dummy_uses.pop();
- dummy_uses.pop();
- dummy_uses.push("uses");
- dummy_uses.push(file_name);
- dummy_uses.set_extension(if header.extension().and_then(|s| s.to_str()) ==
- Some("hpp") {
- "cpp"
- } else {
- "c"
- });
-
- process::Command::new(run_bindgen)
- .stdout(process::Stdio::piped())
- .stderr(process::Stdio::piped())
- .arg(bindgen)
- .arg(header)
- .arg(expected)
- .arg("--dummy-uses")
- .arg(dummy_uses)
- .spawn()
- .expect("Should be able to spawn run-bindgen.py child process")
-}
-
-#[test]
-fn run_bindgen_tests() {
- let crate_root = env::var("CARGO_MANIFEST_DIR")
- .expect("should have CARGO_MANIFEST_DIR environment variable");
-
- let mut run_bindgen = PathBuf::from(&crate_root);
- run_bindgen.push("tests");
- run_bindgen.push("tools");
- run_bindgen.push("run-bindgen.py");
-
- let mut bindgen = PathBuf::from(&crate_root);
- bindgen.push("target");
- if cfg!(debug_assertions) {
- bindgen.push("debug");
- } else {
- bindgen.push("release");
- }
- bindgen.push("bindgen");
- if !bindgen.is_file() {
- panic!("{} is not a file! Build bindgen before running tests.",
- bindgen.display());
- }
-
- let mut headers_dir = PathBuf::from(&crate_root);
- headers_dir.push("tests");
- headers_dir.push("headers");
-
- let entries = fs::read_dir(&headers_dir)
- .expect("Should read directory")
- .map(|result| result.expect("Should read directory entry"));
-
- let tests = entries.filter(|entry| {
- match entry.path().extension().and_then(|s| s.to_str()) {
- Some("h") | Some("hpp") => true,
- _ => false,
- }
- })
- .collect::<Vec<_>>();
-
- let batch_size = env::var("BINDGEN_TEST_BATCH_SIZE")
- .ok()
- .and_then(|x| x.parse::<usize>().ok())
- .unwrap_or(TEST_BATCH_DEFAULT_SIZE);
-
- // Spawn `batch_size` children to run in parallel and wait on all of them
- // before processing the next batch. This puts a limit on the resources
- // consumed when testing, so that we don't overload the system.
-
- let children = tests.chunks(batch_size).map(|x| {
- x.iter()
- .map(|entry| {
- let child = spawn_run_bindgen(run_bindgen.clone(),
- bindgen.clone(),
- entry.path());
- (entry.path(), child)
- })
- .collect::<Vec<_>>()
- });
-
- let failures: Vec<_> = children.flat_map(|x| {
- x.into_iter().filter_map(|(path, mut child)| {
- let passed = child.wait()
- .expect("Should wait on child process")
- .success();
-
- if passed { None } else { Some((path, child)) }
- })
- })
- .collect();
-
- let num_failures = failures.len();
-
- for (path, child) in failures {
- println!("FAIL: {}", path.display());
-
- let mut buf = String::new();
-
- child.stdout
- .expect("should have stdout piped")
- .read_to_string(&mut buf)
- .expect("should read child's stdout");
- for line in buf.lines() {
- println!("child stdout> {}", line);
- }
-
- child.stderr
- .expect("should have stderr piped")
- .read_to_string(&mut buf)
- .expect("should read child's stderr");
- for line in buf.lines() {
- println!("child stderr> {}", line);
- }
- }
-
- if num_failures > 0 {
- panic!("{} test failures!", num_failures);
- }
-}
diff --git a/tests/tools/run-bindgen.py b/tests/tools/run-bindgen.py
deleted file mode 100755
index 519e6891..00000000
--- a/tests/tools/run-bindgen.py
+++ /dev/null
@@ -1,175 +0,0 @@
-#!/usr/bin/env python
-
-from __future__ import print_function
-
-import argparse
-import difflib
-import os
-import sys
-import subprocess
-import tempfile
-import shlex
-
-BINDGEN_FLAGS_PREFIX = "// bindgen-flags: "
-
-COMMON_PRELUDE = """
-#![allow(non_snake_case)]
-"""
-
-DESCRIPTION = """
-Run bindgen on a test header and check the generated bindings against expected
-output.
-"""
-
-def make_parser():
- """Make the commandline parser"""
- parser = argparse.ArgumentParser(description=DESCRIPTION)
- parser.add_argument("bindgen",
- metavar="BINDGEN",
- help="The path to the bindgen executable")
- parser.add_argument("header",
- metavar="HEADER",
- help="The path to the input header")
- parser.add_argument("rust_bindings",
- metavar="RUST_BINDINGS",
- help="The path to the generated rust output. If a file \
- at this path already exists, the newly generated \
- bindings will be checked against those extant \
- expected bindings.")
- parser.add_argument("--feature",
- dest="features",
- action="append",
- nargs=1,
- help="Run tests that depend on bindgen being built with \
- the given feature.")
- parser.add_argument("--dummy-uses",
- dest="dummy_uses",
- help="The path to generate dummy C/C++ uses of the \
- whitelisted types from the input header at.")
- return parser
-
-def usage_and_exit(*args):
- """Print the program usage and exit. If args are given, print them first"""
- if len(args) > 0:
- print(*args)
- make_parser().print_help()
- sys.exit(1)
-
-def parse_args():
- """Get, parse, and validate commandline arguments."""
- parser = make_parser()
- args = parser.parse_args()
-
- if args.features is None:
- args.features = []
-
- if not os.path.isfile(args.bindgen):
- usage_and_exit("error: bindgen is not a file:", args.bindgen)
-
- if not os.path.isfile(args.header):
- usage_and_exit("error: header is not a file:", args.header)
-
- return args
-
-def make_bindgen_env():
- """Build the environment to run bindgen in."""
- env = os.environ.copy()
- env["RUST_BACKTRACE"] = "1"
-
- # El Capitan likes to unset dyld variables
- # https://forums.developer.apple.com/thread/9233
- if "DYLD_LIBRARY_PATH" not in env and "LIBCLANG_PATH" in env:
- env["DYLD_LIBRARY_PATH"] = env["LIBCLANG_PATH"]
-
- return env
-
-def get_bindgen_flags(header_path):
- """
- Return the bindgen flags required for this header
- """
- flags = ["--no-unstable-rust"]
- for line in COMMON_PRELUDE.split("\n"):
- flags.append("--raw-line")
- flags.append(line)
-
- with open(header_path) as f:
- for line in f:
- if line.startswith(BINDGEN_FLAGS_PREFIX):
- flags.extend(shlex.split(line.strip().split(BINDGEN_FLAGS_PREFIX)[1]))
- break
-
- return flags
-
-def get_expected_bindings(rust_bindings_path):
- """
- Get the expected, generated rust bindings output, or None if there is no
- expected output yet.
- """
- expected_bindings = None
- if os.path.isfile(rust_bindings_path):
- with open(rust_bindings_path) as f:
- expected_bindings = f.read()
- return expected_bindings
-
-def get_actual_bindings(rust_bindings_path):
- """Get the actual generated rust bindings output."""
- assert os.path.isfile(rust_bindings_path)
- with open(rust_bindings_path) as f:
- return f.read()
-
-def run_cmd(command, **kwargs):
- """Run the given command, passing through **kwargs to subprocess.check_call"""
- print("run-bindgen.py: running", command)
- subprocess.check_call(command, **kwargs)
-
-def generate_bindings(bindgen, dummy_uses, flags, header, output):
- """Generate the rust bindings."""
- command = [bindgen, "-o", output]
- if dummy_uses:
- command.extend(["--dummy-uses", dummy_uses])
- command.extend(flags)
- command.append(header)
- run_cmd(command, cwd=os.getcwd(), env=make_bindgen_env())
-
-def check_actual_vs_expected(expected_bindings, rust_bindings_path):
- """
- Check the actual generated rust bindings versus our expected generated rust
- bindings. If they don't match up, print a diff between them and exit with a
- failure.
- """
- if expected_bindings is None:
- return
-
- actual_bindings = get_actual_bindings(rust_bindings_path)
- if actual_bindings == expected_bindings:
- return
-
- print("error: actual generated bindings do not match expected generated bindings!")
-
- def to_diffable(s):
- return map(lambda l: l + "\n", s.split("\n"))
-
- diff = difflib.unified_diff(to_diffable(expected_bindings),
- to_diffable(actual_bindings),
- fromfile="expected_bindings.rs",
- tofile="actual_bindings.rs")
- sys.stderr.writelines(diff)
- sys.stderr.write("\n")
-
- sys.exit(1)
-
-def main():
- args = parse_args()
-
- test_flags = get_bindgen_flags(args.header)
- expected_bindings = get_expected_bindings(args.rust_bindings)
- generate_bindings(args.bindgen,
- args.dummy_uses,
- test_flags,
- args.header,
- args.rust_bindings)
- check_actual_vs_expected(expected_bindings, args.rust_bindings)
- sys.exit(0)
-
-if __name__ == "__main__":
- main()