diff options
| -rw-r--r-- | tests/GenerateSipBindings/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | tests/GenerateSipBindings/subdir/subdirfile.cpp | 7 | ||||
| -rw-r--r-- | tests/GenerateSipBindings/subdir/subdirfile.h | 8 | ||||
| -rw-r--r-- | tests/GenerateSipBindings/testscript.py | 3 | 
4 files changed, 24 insertions, 1 deletions
| diff --git a/tests/GenerateSipBindings/CMakeLists.txt b/tests/GenerateSipBindings/CMakeLists.txt index c223bcef..151db9fc 100644 --- a/tests/GenerateSipBindings/CMakeLists.txt +++ b/tests/GenerateSipBindings/CMakeLists.txt @@ -14,12 +14,16 @@ add_library(ExternalLib SHARED external_lib.cpp)  target_link_libraries(ExternalLib PUBLIC Qt5::Core)  target_compile_features(ExternalLib PUBLIC cxx_nullptr) -add_library(CppLib SHARED cpplib.cpp) +add_library(CppLib SHARED +  cpplib.cpp +  subdir/subdirfile.cpp +)  target_link_libraries(CppLib      PUBLIC Qt5::Core      PRIVATE ExternalLib  )  target_compile_features(CppLib PUBLIC cxx_nullptr) +target_include_directories(CppLib PUBLIC subdir)  list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../find-modules) @@ -44,4 +48,5 @@ ecm_generate_python_binding(      QtCore/QtCoremod.sip    HEADERS      cpplib.h +    subdir/subdirfile.h  ) diff --git a/tests/GenerateSipBindings/subdir/subdirfile.cpp b/tests/GenerateSipBindings/subdir/subdirfile.cpp new file mode 100644 index 00000000..d874243b --- /dev/null +++ b/tests/GenerateSipBindings/subdir/subdirfile.cpp @@ -0,0 +1,7 @@ + +#include "subdirfile.h" + +int SubdirObject::mul(int a, int b) +{ +  return a * b; +} diff --git a/tests/GenerateSipBindings/subdir/subdirfile.h b/tests/GenerateSipBindings/subdir/subdirfile.h new file mode 100644 index 00000000..5fd18db4 --- /dev/null +++ b/tests/GenerateSipBindings/subdir/subdirfile.h @@ -0,0 +1,8 @@ + +#pragma once + +class SubdirObject +{ +public: +    int mul(int a, int b); +}; diff --git a/tests/GenerateSipBindings/testscript.py b/tests/GenerateSipBindings/testscript.py index 9e12bd17..e79706bc 100644 --- a/tests/GenerateSipBindings/testscript.py +++ b/tests/GenerateSipBindings/testscript.py @@ -118,3 +118,6 @@ assert(PyTest.CppLib.SomeNS.useEnum(PyTest.CppLib.SomeNS.EnumValueTwo) == 2.0)  assert(PyTest.CppLib.SomeNS.customMethod([2, 3, 5]) == 10)  assert(PyTest.CppLib.anotherCustomMethod([2, 3, 5]) == 52) + +sdo = PyTest.CppLib.SubdirObject() +assert(sdo.mul(5, 6) == 30) | 
