summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDarren Kulp <darren@kulp.ch>2020-06-23 15:48:31 -0700
committerEmilio Cobos Álvarez <emilio@crisal.io>2020-07-20 18:55:10 +0200
commit03dbd1a3f8d80be52d6105e76e7603d9a3b939e0 (patch)
tree9034215cecaaff8763909cb3c575423c9e883a7e /tests
parent4ea1e21bccfd33d79a9244a849d1de0f8ac42b3b (diff)
Remove testing_only_libclang_3_8 and expectations
Diffstat (limited to 'tests')
-rw-r--r--tests/expectations/build.rs1
-rw-r--r--tests/expectations/tests/libclang-3.8/abi_variadic_function.rs15
-rw-r--r--tests/expectations/tests/libclang-3.8/auto.rs38
-rw-r--r--tests/expectations/tests/libclang-3.8/call-conv-field.rs61
-rw-r--r--tests/expectations/tests/libclang-3.8/const_bool.rs38
-rw-r--r--tests/expectations/tests/libclang-3.8/constant-evaluate.rs41
-rw-r--r--tests/expectations/tests/libclang-3.8/error-E0600-cannot-apply-unary-negation-to-u32.rs9
-rw-r--r--tests/expectations/tests/libclang-3.8/issue-769-bad-instantiation-test.rs61
-rw-r--r--tests/expectations/tests/libclang-3.8/mangling-win32.rs56
-rw-r--r--tests/expectations/tests/libclang-3.8/objc_inheritance.rs66
-rw-r--r--tests/expectations/tests/libclang-3.8/objc_template.rs65
-rw-r--r--tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs51
-rw-r--r--tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs37
-rwxr-xr-xtests/stylo_sanity.rs6
-rw-r--r--tests/tests.rs2
15 files changed, 1 insertions, 546 deletions
diff --git a/tests/expectations/build.rs b/tests/expectations/build.rs
index 46526458..2b426a44 100644
--- a/tests/expectations/build.rs
+++ b/tests/expectations/build.rs
@@ -9,7 +9,6 @@ use std::io::Write;
use std::path::Path;
const LIBCLANG_VERSION_DIRS: &'static [&'static str] = &[
- "libclang-3.8",
"libclang-3.9",
"libclang-4",
"libclang-5",
diff --git a/tests/expectations/tests/libclang-3.8/abi_variadic_function.rs b/tests/expectations/tests/libclang-3.8/abi_variadic_function.rs
deleted file mode 100644
index 415c8cfd..00000000
--- a/tests/expectations/tests/libclang-3.8/abi_variadic_function.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-
-extern "C" {
- #[link_name = "\u{1}_Z1acz"]
- pub fn a(arg1: ::std::os::raw::c_char, ...) -> ::std::os::raw::c_char;
-}
-extern "C" {
- #[link_name = "\u{1}_Z1bcz"]
- pub fn b(arg1: ::std::os::raw::c_char, ...) -> ::std::os::raw::c_char;
-}
diff --git a/tests/expectations/tests/libclang-3.8/auto.rs b/tests/expectations/tests/libclang-3.8/auto.rs
deleted file mode 100644
index fad1722c..00000000
--- a/tests/expectations/tests/libclang-3.8/auto.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct Foo {
- pub _address: u8,
-}
-extern "C" {
- #[link_name = "\u{1}_ZN3Foo4kFooE"]
- pub static Foo_kFoo: bool;
-}
-#[test]
-fn bindgen_test_layout_Foo() {
- assert_eq!(
- ::std::mem::size_of::<Foo>(),
- 1usize,
- concat!("Size of: ", stringify!(Foo))
- );
- assert_eq!(
- ::std::mem::align_of::<Foo>(),
- 1usize,
- concat!("Alignment of ", stringify!(Foo))
- );
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct Bar {
- pub _address: u8,
-}
-extern "C" {
- #[link_name = "\u{1}_Z5Test2v"]
- pub fn Test2() -> ::std::os::raw::c_uint;
-}
diff --git a/tests/expectations/tests/libclang-3.8/call-conv-field.rs b/tests/expectations/tests/libclang-3.8/call-conv-field.rs
deleted file mode 100644
index 2a905a95..00000000
--- a/tests/expectations/tests/libclang-3.8/call-conv-field.rs
+++ /dev/null
@@ -1,61 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-#![cfg(not(test))]
-
-#[repr(C)]
-#[derive(Default, Copy, Clone)]
-pub struct JNINativeInterface_ {
- pub GetVersion: ::std::option::Option<
- unsafe extern "stdcall" fn(
- env: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_int,
- >,
- pub __hack: ::std::os::raw::c_ulonglong,
-}
-#[test]
-fn bindgen_test_layout_JNINativeInterface_() {
- assert_eq!(
- ::std::mem::size_of::<JNINativeInterface_>(),
- 16usize,
- concat!("Size of: ", stringify!(JNINativeInterface_))
- );
- assert_eq!(
- ::std::mem::align_of::<JNINativeInterface_>(),
- 8usize,
- concat!("Alignment of ", stringify!(JNINativeInterface_))
- );
- assert_eq!(
- unsafe {
- &(*(::std::ptr::null::<JNINativeInterface_>())).GetVersion
- as *const _ as usize
- },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(JNINativeInterface_),
- "::",
- stringify!(GetVersion)
- )
- );
- assert_eq!(
- unsafe {
- &(*(::std::ptr::null::<JNINativeInterface_>())).__hack as *const _
- as usize
- },
- 8usize,
- concat!(
- "Offset of field: ",
- stringify!(JNINativeInterface_),
- "::",
- stringify!(__hack)
- )
- );
-}
-extern "C" {
- #[link_name = "\u{1}_bar@0"]
- pub fn bar();
-}
diff --git a/tests/expectations/tests/libclang-3.8/const_bool.rs b/tests/expectations/tests/libclang-3.8/const_bool.rs
deleted file mode 100644
index 838d9a91..00000000
--- a/tests/expectations/tests/libclang-3.8/const_bool.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-
-extern "C" {
- #[link_name = "\u{1}_ZL1k"]
- pub static k: bool;
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct A {
- pub _address: u8,
-}
-extern "C" {
- #[link_name = "\u{1}_ZN1A1kE"]
- pub static A_k: bool;
-}
-#[test]
-fn bindgen_test_layout_A() {
- assert_eq!(
- ::std::mem::size_of::<A>(),
- 1usize,
- concat!("Size of: ", stringify!(A))
- );
- assert_eq!(
- ::std::mem::align_of::<A>(),
- 1usize,
- concat!("Alignment of ", stringify!(A))
- );
-}
-pub type foo = bool;
-extern "C" {
- #[link_name = "\u{1}_ZL2k2"]
- pub static k2: foo;
-}
diff --git a/tests/expectations/tests/libclang-3.8/constant-evaluate.rs b/tests/expectations/tests/libclang-3.8/constant-evaluate.rs
deleted file mode 100644
index a59066c8..00000000
--- a/tests/expectations/tests/libclang-3.8/constant-evaluate.rs
+++ /dev/null
@@ -1,41 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-
-pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo;
-pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar;
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-pub enum _bindgen_ty_1 {
- foo = 4,
- bar = 8,
-}
-pub type EasyToOverflow = ::std::os::raw::c_ulonglong;
-pub const k: EasyToOverflow = 2147483648;
-extern "C" {
- pub static k_expr: EasyToOverflow;
-}
-extern "C" {
- pub static wow: EasyToOverflow;
-}
-extern "C" {
- pub static BAZ: ::std::os::raw::c_longlong;
-}
-extern "C" {
- pub static fuzz: f64;
-}
-extern "C" {
- pub static BAZZ: ::std::os::raw::c_char;
-}
-extern "C" {
- pub static WAT: ::std::os::raw::c_char;
-}
-extern "C" {
- pub static mut bytestring: *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub static mut NOT_UTF8: *const ::std::os::raw::c_char;
-}
diff --git a/tests/expectations/tests/libclang-3.8/error-E0600-cannot-apply-unary-negation-to-u32.rs b/tests/expectations/tests/libclang-3.8/error-E0600-cannot-apply-unary-negation-to-u32.rs
deleted file mode 100644
index 3fa853ee..00000000
--- a/tests/expectations/tests/libclang-3.8/error-E0600-cannot-apply-unary-negation-to-u32.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-#![allow(overflowing_literals)]
-
-pub const a: u32 = 18446744073709551611;
diff --git a/tests/expectations/tests/libclang-3.8/issue-769-bad-instantiation-test.rs b/tests/expectations/tests/libclang-3.8/issue-769-bad-instantiation-test.rs
deleted file mode 100644
index c084de95..00000000
--- a/tests/expectations/tests/libclang-3.8/issue-769-bad-instantiation-test.rs
+++ /dev/null
@@ -1,61 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-
-#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
-pub mod root {
- #[allow(unused_imports)]
- use self::super::root;
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct Rooted<T> {
- pub member: T,
- pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
- }
- impl<T> Default for Rooted<T> {
- fn default() -> Self {
- unsafe { ::std::mem::zeroed() }
- }
- }
- #[test]
- fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation() {
- assert_eq!(
- ::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>(),
- 4usize,
- concat!(
- "Size of template specialization: ",
- stringify!(root::Rooted<::std::os::raw::c_int>)
- )
- );
- assert_eq!(
- ::std::mem::align_of::<root::Rooted<::std::os::raw::c_int>>(),
- 4usize,
- concat!(
- "Alignment of template specialization: ",
- stringify!(root::Rooted<::std::os::raw::c_int>)
- )
- );
- }
- #[test]
- fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation_1() {
- assert_eq!(
- ::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>(),
- 4usize,
- concat!(
- "Size of template specialization: ",
- stringify!(root::Rooted<::std::os::raw::c_int>)
- )
- );
- assert_eq!(
- ::std::mem::align_of::<root::Rooted<::std::os::raw::c_int>>(),
- 4usize,
- concat!(
- "Alignment of template specialization: ",
- stringify!(root::Rooted<::std::os::raw::c_int>)
- )
- );
- }
-}
diff --git a/tests/expectations/tests/libclang-3.8/mangling-win32.rs b/tests/expectations/tests/libclang-3.8/mangling-win32.rs
deleted file mode 100644
index 4c11ba9e..00000000
--- a/tests/expectations/tests/libclang-3.8/mangling-win32.rs
+++ /dev/null
@@ -1,56 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-
-extern "C" {
- pub fn foo();
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct Foo {
- pub _address: u8,
-}
-extern "C" {
- #[link_name = "\u{1}?sBar@Foo@@2_NA"]
- pub static mut Foo_sBar: bool;
-}
-#[test]
-fn bindgen_test_layout_Foo() {
- assert_eq!(
- ::std::mem::size_of::<Foo>(),
- 1usize,
- concat!("Size of: ", stringify!(Foo))
- );
- assert_eq!(
- ::std::mem::align_of::<Foo>(),
- 1usize,
- concat!("Alignment of ", stringify!(Foo))
- );
-}
-extern "C" {
- #[link_name = "\u{1}@fast_call_func_no_args@0"]
- pub fn fast_call_func_no_args() -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[link_name = "\u{1}@fast_call_func_many_args@12"]
- pub fn fast_call_func_many_args(
- arg1: ::std::os::raw::c_int,
- arg2: ::std::os::raw::c_int,
- arg3: ::std::os::raw::c_int,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[link_name = "\u{1}_std_call_func_no_args@0"]
- pub fn std_call_func_no_args() -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[link_name = "\u{1}_std_call_func_many_args@12"]
- pub fn std_call_func_many_args(
- arg1: ::std::os::raw::c_int,
- arg2: ::std::os::raw::c_int,
- arg3: ::std::os::raw::c_int,
- ) -> ::std::os::raw::c_int;
-}
diff --git a/tests/expectations/tests/libclang-3.8/objc_inheritance.rs b/tests/expectations/tests/libclang-3.8/objc_inheritance.rs
deleted file mode 100644
index cd2b085d..00000000
--- a/tests/expectations/tests/libclang-3.8/objc_inheritance.rs
+++ /dev/null
@@ -1,66 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-#![cfg(target_os = "macos")]
-
-#[macro_use]
-extern crate objc;
-#[allow(non_camel_case_types)]
-pub type id = *mut objc::runtime::Object;
-#[repr(transparent)]
-#[derive(Clone, Copy)]
-pub struct Foo(pub id);
-impl std::ops::Deref for Foo {
- type Target = objc::runtime::Object;
- fn deref(&self) -> &Self::Target {
- unsafe { &*self.0 }
- }
-}
-unsafe impl objc::Message for Foo {}
-impl Foo {
- pub fn alloc() -> Self {
- Self(unsafe { msg_send!(objc::class!(Foo), alloc) })
- }
-}
-impl IFoo for Foo {}
-pub trait IFoo: Sized + std::ops::Deref {}
-#[repr(transparent)]
-#[derive(Clone, Copy)]
-pub struct Bar(pub id);
-impl std::ops::Deref for Bar {
- type Target = objc::runtime::Object;
- fn deref(&self) -> &Self::Target {
- unsafe { &*self.0 }
- }
-}
-unsafe impl objc::Message for Bar {}
-impl Bar {
- pub fn alloc() -> Self {
- Self(unsafe { msg_send!(objc::class!(Bar), alloc) })
- }
-}
-impl IFoo for Bar {}
-impl IBar for Bar {}
-pub trait IBar: Sized + std::ops::Deref {}
-#[repr(transparent)]
-#[derive(Clone, Copy)]
-pub struct Baz(pub id);
-impl std::ops::Deref for Baz {
- type Target = objc::runtime::Object;
- fn deref(&self) -> &Self::Target {
- unsafe { &*self.0 }
- }
-}
-unsafe impl objc::Message for Baz {}
-impl Baz {
- pub fn alloc() -> Self {
- Self(unsafe { msg_send!(objc::class!(Baz), alloc) })
- }
-}
-impl IBar for Baz {}
-impl IFoo for Baz {}
-impl IBaz for Baz {}
-pub trait IBaz: Sized + std::ops::Deref {}
diff --git a/tests/expectations/tests/libclang-3.8/objc_template.rs b/tests/expectations/tests/libclang-3.8/objc_template.rs
deleted file mode 100644
index 9c5a5b75..00000000
--- a/tests/expectations/tests/libclang-3.8/objc_template.rs
+++ /dev/null
@@ -1,65 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-#![cfg(target_os = "macos")]
-
-#[macro_use]
-extern crate objc;
-#[allow(non_camel_case_types)]
-pub type id = *mut objc::runtime::Object;
-#[repr(transparent)]
-#[derive(Clone, Copy)]
-pub struct Foo(pub id);
-impl std::ops::Deref for Foo {
- type Target = objc::runtime::Object;
- fn deref(&self) -> &Self::Target {
- unsafe { &*self.0 }
- }
-}
-unsafe impl objc::Message for Foo {}
-impl Foo {
- pub fn alloc() -> Self {
- Self(unsafe { msg_send!(objc::class!(Foo), alloc) })
- }
-}
-impl<ObjectType: 'static> IFoo<ObjectType> for Foo {}
-pub trait IFoo<ObjectType>: Sized + std::ops::Deref {
- unsafe fn get(self) -> id
- where
- <Self as std::ops::Deref>::Target: objc::Message + Sized,
- {
- msg_send!(self, get)
- }
-}
-#[repr(transparent)]
-#[derive(Clone, Copy)]
-pub struct FooMultiGeneric(pub id);
-impl std::ops::Deref for FooMultiGeneric {
- type Target = objc::runtime::Object;
- fn deref(&self) -> &Self::Target {
- unsafe { &*self.0 }
- }
-}
-unsafe impl objc::Message for FooMultiGeneric {}
-impl FooMultiGeneric {
- pub fn alloc() -> Self {
- Self(unsafe { msg_send!(objc::class!(FooMultiGeneric), alloc) })
- }
-}
-impl<KeyType: 'static, ObjectType: 'static>
- IFooMultiGeneric<KeyType, ObjectType> for FooMultiGeneric
-{
-}
-pub trait IFooMultiGeneric<KeyType, ObjectType>:
- Sized + std::ops::Deref
-{
- unsafe fn objectForKey_(self, key: id) -> id
- where
- <Self as std::ops::Deref>::Target: objc::Message + Sized,
- {
- msg_send!(self, objectForKey: key)
- }
-}
diff --git a/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs b/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs
deleted file mode 100644
index b68610e1..00000000
--- a/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct Base {
- pub _address: u8,
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct Derived {
- pub b: bool,
-}
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct Usage {
- pub _address: u8,
-}
-extern "C" {
- #[link_name = "\u{1}_ZN5Usage13static_memberE"]
- pub static mut Usage_static_member: [u32; 2usize];
-}
-#[test]
-fn bindgen_test_layout_Usage() {
- assert_eq!(
- ::std::mem::size_of::<Usage>(),
- 1usize,
- concat!("Size of: ", stringify!(Usage))
- );
- assert_eq!(
- ::std::mem::align_of::<Usage>(),
- 1usize,
- concat!("Alignment of ", stringify!(Usage))
- );
-}
-extern "C" {
- #[link_name = "\u{1}_ZN5UsageC1Ev"]
- pub fn Usage_Usage(this: *mut Usage);
-}
-impl Usage {
- #[inline]
- pub unsafe fn new() -> Self {
- let mut __bindgen_tmp = ::std::mem::MaybeUninit::uninit();
- Usage_Usage(__bindgen_tmp.as_mut_ptr());
- __bindgen_tmp.assume_init()
- }
-}
diff --git a/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs
deleted file mode 100644
index 67e1c5ae..00000000
--- a/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-#![allow(
- dead_code,
- non_snake_case,
- non_camel_case_types,
- non_upper_case_globals
-)]
-
-#[repr(C)]
-#[derive(Debug, Default, Copy, Clone)]
-pub struct Rooted {
- pub ptr: ::std::os::raw::c_int,
-}
-#[test]
-fn bindgen_test_layout_Rooted() {
- assert_eq!(
- ::std::mem::size_of::<Rooted>(),
- 4usize,
- concat!("Size of: ", stringify!(Rooted))
- );
- assert_eq!(
- ::std::mem::align_of::<Rooted>(),
- 4usize,
- concat!("Alignment of ", stringify!(Rooted))
- );
- assert_eq!(
- unsafe { &(*(::std::ptr::null::<Rooted>())).ptr as *const _ as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(Rooted),
- "::",
- stringify!(ptr)
- )
- );
-}
-/// <div rustbindgen replaces="MaybeWrapped"></div>
-pub type MaybeWrapped<a> = a;
diff --git a/tests/stylo_sanity.rs b/tests/stylo_sanity.rs
index 3f59275c..88d87adb 100755
--- a/tests/stylo_sanity.rs
+++ b/tests/stylo_sanity.rs
@@ -14,11 +14,7 @@ extern crate bindgen;
/// how long bindings generation takes for Stylo. Stylo bindings generation
/// takes too long to be a proper `#[bench]`.
#[test]
-#[cfg(not(any(
- debug_assertions,
- feature = "testing_only_extra_assertions",
- feature = "testing_only_libclang_3_8"
-)))]
+#[cfg(not(any(debug_assertions, feature = "testing_only_extra_assertions",)))]
#[cfg(any(
feature = "testing_only_libclang_3_9",
feature = "testing_only_libclang_4",
diff --git a/tests/tests.rs b/tests/tests.rs
index 4cf39460..f8419b53 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -144,8 +144,6 @@ fn compare_generated_header(
expectation.push("libclang-4");
} else if cfg!(feature = "testing_only_libclang_3_9") {
expectation.push("libclang-3.9");
- } else if cfg!(feature = "testing_only_libclang_3_8") {
- expectation.push("libclang-3.8");
} else {
match clang_version().parsed {
None => {}