tests: Remove Cython-specific configs

This commit is contained in:
Vadim Petrochenkov
2020-11-18 16:50:59 +03:00
committed by Emilio Cobos Álvarez
parent 51405d1277
commit 1c1d4754ce
167 changed files with 1080 additions and 277 deletions
-17
View File
@@ -1,17 +0,0 @@
[export.body]
"MyCLikeEnum" = """
BogusVariantForSerializationForExample,
"""
"MyUnion" = """
int32_t extra_member; # yolo
"""
[export.pre_body]
"MyCLikeEnum_Prepended" = """
BogusVariantForSerializationForExample,
"""
"MyUnion_Prepended" = """
int32_t extra_member; # yolo
"""
+7 -8
View File
@@ -1,13 +1,13 @@
[export.body]
"MyFancyStruct" = """
#ifdef __cplusplus
inline void foo();
inline void foo();
#endif
"""
"MyFancyEnum" = """
#ifdef __cplusplus
inline void wohoo();
inline void wohoo();
#endif
"""
@@ -16,20 +16,20 @@
"""
"MyUnion" = """
int32_t extra_member; // yolo
int32_t extra_member;
"""
[export.pre_body]
"MyFancyStruct_Prepended" = """
#ifdef __cplusplus
inline void prepended_wohoo();
inline void prepended_wohoo();
#endif
"""
"MyFancyEnum_Prepended" = """
#ifdef __cplusplus
#ifdef __cplusplus
inline void wohoo();
#endif
#endif
"""
"MyCLikeEnum_Prepended" = """
@@ -37,6 +37,5 @@
"""
"MyUnion_Prepended" = """
int32_t extra_member; // yolo
int32_t extra_member;
"""
-10
View File
@@ -1,10 +0,0 @@
# header = """
# #ifdef __cplusplus
# template <typename T>
# using Box = T*;
# #endif
# """
[export]
exclude = [
"Box",
]
+8 -1
View File
@@ -1,11 +1,18 @@
header = """
#if 0
''' '
#endif
#ifdef __cplusplus
template <typename T>
using Box = T*;
#endif
#if 0
' '''
#endif
"""
[export]
exclude = [
"Box",
]
-15
View File
@@ -1,15 +0,0 @@
header = """
DEF PLATFORM_UNIX = 0
DEF PLATFORM_WIN = 0
DEF X11 = 0
DEF M_32 = 0
"""
[defines]
"unix" = "PLATFORM_UNIX"
"windows" = "PLATFORM_WIN"
"x11" = "X11"
"target_pointer_width = 32" = "M_32"
[export]
exclude = ["C"] # conditional compilation is not supported for enumerators
+9
View File
@@ -1,3 +1,12 @@
header = """
#if 0
DEF PLATFORM_UNIX = 0
DEF PLATFORM_WIN = 0
DEF X11 = 0
DEF M_32 = 0
#endif
"""
[defines]
"unix" = "PLATFORM_UNIX"
"windows" = "PLATFORM_WIN"
-9
View File
@@ -1,9 +0,0 @@
header = """
DEF DEFINED = 1
DEF NOT_DEFINED = 0
"""
[defines]
"unix" = "DEFINED"
"macos" = "NOT_DEFINED"
"windows" = "NOT_DEFINED"
+7
View File
@@ -1,3 +1,10 @@
header = """
#if 0
DEF DEFINED = 1
DEF NOT_DEFINED = 0
#endif
"""
[defines]
"unix" = "DEFINED"
"macos" = "NOT_DEFINED"
-5
View File
@@ -1,5 +0,0 @@
[export]
exclude = [
"XFALSE", # right hand side crashes Cython compiler
"XTRUE", # right hand side crashes Cython compiler
]
+5 -2
View File
@@ -23,8 +23,11 @@ pub const NEG_ONE: i8 = -1;
// Some doc for shifting //
pub const SHIFT: i64 = 3;
pub const XBOOL: i64 = 1;
pub const XFALSE: i64 = (0 << SHIFT) | XBOOL;
pub const XTRUE: i64 = 1 << (SHIFT | XBOOL);
// pub const XFALSE: i64 = (0 << SHIFT) | XBOOL; // Crashes Cython compiler
// pub const XTRUE: i64 = 1 << (SHIFT | XBOOL); // Crashes Cython compiler
pub const XFALSE1: i64 = (0 << 3) | 1;
pub const XTRUE1: i64 = 1 << (3 | 1);
pub const XFALSE2: i64 = 0 << SHIFT;
pub const CAST: u8 = 'A' as u8;
pub const DOUBLE_CAST: u32 = 1 as f32 as u32;
-5
View File
@@ -1,5 +0,0 @@
no_includes = true
header = "# This file is generated by cbindgen. DO NOT EDIT"
trailer = """
# This is a simple test to ensure that trailers don't cause extra newlines in files
"""
+9 -3
View File
@@ -1,5 +1,11 @@
no_includes = true
header = "// This file is generated by cbindgen. DO NOT EDIT"
trailer = """
/* This is a simple test to ensure that trailers don't cause extra newlines in files */
header = """
#if 0
# This file is generated by cbindgen. DO NOT EDIT
#endif
"""
trailer = """
#if 0
# This is a simple test to ensure that trailers do not cause extra newlines in files
#endif
"""
View File
+9 -1
View File
@@ -1,8 +1,16 @@
trailer = """
#if 0
''' '
#endif
#include <stddef.h>
#include "testing-helpers.h"
static_assert(offsetof(CBINDGEN_STRUCT(P), tag) == 0, "unexpected offset for tag");
static_assert(offsetof(CBINDGEN_STRUCT(P), p0) == 1, "unexpected offset for p0");
static_assert(offsetof(CBINDGEN_STRUCT(P), p0) == 1, "unexpected offset for p1");
static_assert(sizeof(CBINDGEN_STRUCT(P)) == 4, "unexpected size for P");
"""
#if 0
' '''
#endif
"""
-2
View File
@@ -1,2 +0,0 @@
[export]
exclude = ["root_no_cython"]
+2 -9
View File
@@ -7,16 +7,9 @@ enum E {
C = 1 + 2,
D = FOUR,
F = (5),
}
#[repr(i8)]
enum E_NoCython {
G = '6' as i8, // Not supported
H = false as i8, // Not supported
G = b'6' as i8,
H = false as i8,
}
#[no_mangle]
pub extern "C" fn root(_: &E) {}
#[no_mangle]
pub extern "C" fn root_no_cython(_: &E_NoCython) {}
@@ -1,9 +0,0 @@
header = """
from libc.stdint cimport uint64_t
ctypedef uint64_t Option_Foo
"""
[export]
exclude = [
"Option_Foo",
]
+13
View File
@@ -2,7 +2,20 @@ language = "C"
header = """
#include <stdint.h>
#if 0
''' '
#endif
typedef uint64_t Option_Foo;
#if 0
' '''
#endif
#if 0
from libc.stdint cimport uint64_t
ctypedef uint64_t Option_Foo
#endif
"""
[export]
-4
View File
@@ -1,4 +0,0 @@
[export]
exclude = [
"ManuallyDrop",
]
+8
View File
@@ -1,8 +1,16 @@
header = """
#if 0
''' '
#endif
#ifdef __cplusplus
template <typename T>
using ManuallyDrop = T;
#endif
#if 0
' '''
#endif
"""
[export]
exclude = [
-4
View File
@@ -1,4 +0,0 @@
[export]
exclude = [
"MaybeUninit",
]
+8
View File
@@ -1,8 +1,16 @@
header = """
#if 0
''' '
#endif
#ifdef __cplusplus
template <typename T>
using MaybeUninit = T;
#endif
#if 0
' '''
#endif
"""
[export]
exclude = [
-9
View File
@@ -1,9 +0,0 @@
header = """
DEF FOO = 0
DEF BAR = 0
"""
[defines]
"foo" = "FOO"
"bar" = "BAR"
# "feature = foobar" = "FOOBAR"
+7
View File
@@ -1,3 +1,10 @@
header = """
#if 0
DEF FOO = 0
DEF BAR = 0
#endif
"""
[defines]
"foo" = "FOO"
"bar" = "BAR"
View File
+8
View File
@@ -1,4 +1,8 @@
header = """
#if 0
''' '
#endif
#ifdef __cplusplus
// These could be added as opaque types I guess.
template <typename T>
@@ -6,4 +10,8 @@ struct BuildHasherDefault;
struct DefaultHasher;
#endif
#if 0
' '''
#endif
"""
-5
View File
@@ -1,5 +0,0 @@
[export]
prefix = "PREFIX_"
exclude = [
"Y", # right hand side crashes Cython compiler
]
+5 -1
View File
@@ -16,5 +16,9 @@ pub extern "C" fn root(x: NamedLenArray, y: ValuedLenArray, z: AbsoluteFontWeigh
#[no_mangle]
pub const X: i64 = 22 << 22;
// #[no_mangle]
// pub const Y: i64 = X + X; // Crashes Cython compiler
#[no_mangle]
pub const Y: i64 = X + X;
pub const Y1: i64 = (22 << 22) + (22 << 22);
#[no_mangle]
pub const Y2: i64 = X;
-8
View File
@@ -1,8 +0,0 @@
header = """
DEF DEFINE_FREEBSD = 0
"""
[parse]
parse_deps = true
[defines]
"target_os = freebsd" = "DEFINE_FREEBSD"
+6
View File
@@ -1,3 +1,9 @@
header = """
#if 0
DEF DEFINE_FREEBSD = 0
#endif
"""
[parse]
parse_deps = true
[defines]
-9
View File
@@ -1,9 +0,0 @@
header = "#define CF_SWIFT_NAME(_name) __attribute__((swift_name(#_name)))"
[fn]
swift_name_macro = "CF_SWIFT_NAME"
[export]
exclude = [
"PointerToOpaque_sayHello", # has postfix with a C-style comment incompatible with Cython
]
-1
View File
@@ -122,7 +122,6 @@ impl PointerToOpaque {
PointerToOpaque { ptr: Box::into_raw(Box::new(Opaque { times })) }
}
/// cbindgen:postfix=/*a comment!*/
#[export_name="PointerToOpaque_sayHello"]
pub extern fn say_hello(self: PointerToOpaque) {
if let Some(nonnull) = std::ptr::NonNull::new(self.ptr) {