From d00aeeafdd54134ff294dc4459a6b8cbaa560f8d Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Tue, 27 Nov 2018 18:06:17 -0500 Subject: add syntax cIncludeDir "$projpath/include"; do not use recursive search paths; add test tests/tnimterop_cpp.nim --- tests/include/test2.cpp | 8 ++++++++ tests/include/test2.hpp | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/include/test2.cpp create mode 100644 tests/include/test2.hpp (limited to 'tests/include') diff --git a/tests/include/test2.cpp b/tests/include/test2.cpp new file mode 100644 index 0000000..4a40e90 --- /dev/null +++ b/tests/include/test2.cpp @@ -0,0 +1,8 @@ +#include "test2.hpp" + +// BUG: should complain +// # include test2.h + +int test_call_int() { + return 5; +} diff --git a/tests/include/test2.hpp b/tests/include/test2.hpp new file mode 100644 index 0000000..1ba9a8d --- /dev/null +++ b/tests/include/test2.hpp @@ -0,0 +1,20 @@ +#define TEST_INT 512 + +int test_call_int(); + +struct Foo{ + int bar; +}; + +class Foo1{ + int bar1; +}; + +template +struct Foo2{ + int bar2; +}; + +typedef Foo2 Foo2_int; + + -- cgit v1.2.3 From 6a4158dab4ee36214678a92a1e5605a00402f01c Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Tue, 27 Nov 2018 18:25:34 -0500 Subject: fixup --- tests/include/test.h | 2 +- tests/include/test2.cpp | 3 --- tests/include/test2.hpp | 4 ++++ 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/include') diff --git a/tests/include/test.h b/tests/include/test.h index 7de6eed..6138ca3 100644 --- a/tests/include/test.h +++ b/tests/include/test.h @@ -40,4 +40,4 @@ int test_call_int(); struct STRUCT1 _test_call_int_param_(int param1); STRUCT2 test_call_int_param2(int param1, STRUCT2 param2); STRUCT2 test_call_int_param3(int param1, struct STRUCT1 param2); -ENUM2 test_call_int_param4(enum ENUM param1); \ No newline at end of file +ENUM2 test_call_int_param4(enum ENUM param1); diff --git a/tests/include/test2.cpp b/tests/include/test2.cpp index 4a40e90..7039cde 100644 --- a/tests/include/test2.cpp +++ b/tests/include/test2.cpp @@ -1,8 +1,5 @@ #include "test2.hpp" -// BUG: should complain -// # include test2.h - int test_call_int() { return 5; } diff --git a/tests/include/test2.hpp b/tests/include/test2.hpp index 1ba9a8d..0fd90ee 100644 --- a/tests/include/test2.hpp +++ b/tests/include/test2.hpp @@ -1,4 +1,8 @@ +#include + #define TEST_INT 512 +#define TEST_FLOAT 5.12 +#define TEST_HEX 0x512 int test_call_int(); -- cgit v1.2.3