diff options
Diffstat (limited to 'tests/headers')
-rw-r--r-- | tests/headers/allowlist-file.hpp | 21 | ||||
-rw-r--r-- | tests/headers/allowlisted/file.hpp | 22 |
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/headers/allowlist-file.hpp b/tests/headers/allowlist-file.hpp new file mode 100644 index 00000000..b0354a04 --- /dev/null +++ b/tests/headers/allowlist-file.hpp @@ -0,0 +1,21 @@ +// bindgen-flags: --allowlist-file ".*/allowlisted/file.*" --allowlist-type AllowlistMe -- -Itests/headers + + +// Forward declaration of struct that's defined in an allowlisted file. +struct StructWithAllowlistedDefinition; + +#include "allowlisted/file.hpp" + +// Actual definition of struct that has a forward declaration in an allowlisted file. +struct StructWithAllowlistedFwdDecl { + int b; +}; + +class Ignored { + char c; +}; + +// Also have an explicitly allowlisted type +class AllowlistMe { + int foo; +}; diff --git a/tests/headers/allowlisted/file.hpp b/tests/headers/allowlisted/file.hpp new file mode 100644 index 00000000..5f360e5e --- /dev/null +++ b/tests/headers/allowlisted/file.hpp @@ -0,0 +1,22 @@ +void SomeFunction(); +extern int someVar; +#define SOME_DEFUN 123 + +class someClass { + void somePrivateMethod(); +public: + void somePublicMethod(int foo); +}; + +extern "C" void ExternFunction(); + +namespace foo { + void NamespacedFunction(); +} + + +struct StructWithAllowlistedFwdDecl; + +struct StructWithAllowlistedDefinition { + StructWithAllowlistedFwdDecl* other; +}; |