tests: Remove Cython-specific configs
This commit is contained in:
committed by
Emilio Cobos Álvarez
parent
51405d1277
commit
1c1d4754ce
@@ -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
|
||||
"""
|
||||
@@ -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;
|
||||
"""
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# header = """
|
||||
# #ifdef __cplusplus
|
||||
# template <typename T>
|
||||
# using Box = T*;
|
||||
# #endif
|
||||
# """
|
||||
[export]
|
||||
exclude = [
|
||||
"Box",
|
||||
]
|
||||
+8
-1
@@ -1,11 +1,18 @@
|
||||
header = """
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
"""
|
||||
[export]
|
||||
exclude = [
|
||||
"Box",
|
||||
]
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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"
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
header = """
|
||||
DEF DEFINED = 1
|
||||
DEF NOT_DEFINED = 0
|
||||
"""
|
||||
|
||||
[defines]
|
||||
"unix" = "DEFINED"
|
||||
"macos" = "NOT_DEFINED"
|
||||
"windows" = "NOT_DEFINED"
|
||||
@@ -1,3 +1,10 @@
|
||||
header = """
|
||||
#if 0
|
||||
DEF DEFINED = 1
|
||||
DEF NOT_DEFINED = 0
|
||||
#endif
|
||||
"""
|
||||
|
||||
[defines]
|
||||
"unix" = "DEFINED"
|
||||
"macos" = "NOT_DEFINED"
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
[export]
|
||||
exclude = [
|
||||
"XFALSE", # right hand side crashes Cython compiler
|
||||
"XTRUE", # right hand side crashes Cython compiler
|
||||
]
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
[export]
|
||||
exclude = ["root_no_cython"]
|
||||
@@ -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",
|
||||
]
|
||||
@@ -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]
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[export]
|
||||
exclude = [
|
||||
"ManuallyDrop",
|
||||
]
|
||||
@@ -1,8 +1,16 @@
|
||||
header = """
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using ManuallyDrop = T;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
"""
|
||||
[export]
|
||||
exclude = [
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[export]
|
||||
exclude = [
|
||||
"MaybeUninit",
|
||||
]
|
||||
@@ -1,8 +1,16 @@
|
||||
header = """
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using MaybeUninit = T;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
"""
|
||||
[export]
|
||||
exclude = [
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
header = """
|
||||
DEF FOO = 0
|
||||
DEF BAR = 0
|
||||
"""
|
||||
|
||||
[defines]
|
||||
"foo" = "FOO"
|
||||
"bar" = "BAR"
|
||||
# "feature = foobar" = "FOOBAR"
|
||||
@@ -1,3 +1,10 @@
|
||||
header = """
|
||||
#if 0
|
||||
DEF FOO = 0
|
||||
DEF BAR = 0
|
||||
#endif
|
||||
"""
|
||||
|
||||
[defines]
|
||||
"foo" = "FOO"
|
||||
"bar" = "BAR"
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
[export]
|
||||
prefix = "PREFIX_"
|
||||
exclude = [
|
||||
"Y", # right hand side crashes Cython compiler
|
||||
]
|
||||
@@ -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;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
header = """
|
||||
DEF DEFINE_FREEBSD = 0
|
||||
"""
|
||||
|
||||
[parse]
|
||||
parse_deps = true
|
||||
[defines]
|
||||
"target_os = freebsd" = "DEFINE_FREEBSD"
|
||||
@@ -1,3 +1,9 @@
|
||||
header = """
|
||||
#if 0
|
||||
DEF DEFINE_FREEBSD = 0
|
||||
#endif
|
||||
"""
|
||||
|
||||
[parse]
|
||||
parse_deps = true
|
||||
[defines]
|
||||
|
||||
@@ -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
|
||||
]
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user