aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pysidetest/CMakeLists.txt
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-10-05 16:10:50 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-10-11 17:47:03 -0300
commit4b3b56acd7caaa7ff0d9c7b913cfe73db12afd4a (patch)
tree2ab76c7159380a8cc5e76776ed13ca39fc2d31f1 /tests/pysidetest/CMakeLists.txt
parent42516e6f864c2beb912c593f6198ab394a5a243f (diff)
Added a PySide derived test library.
The test library is intended to provide specific test cases in a way that problems could be isolated easier than using the ones provided by the Qt library. Cases commons to all Python bindings must go into the Shiboken test libraries, the one added here is intended to test Qt specifics (e.g. signals). A Python unit test was added for the case when a method and a signal have the same name.
Diffstat (limited to 'tests/pysidetest/CMakeLists.txt')
-rw-r--r--tests/pysidetest/CMakeLists.txt71
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/pysidetest/CMakeLists.txt b/tests/pysidetest/CMakeLists.txt
new file mode 100644
index 000000000..86d232f95
--- /dev/null
+++ b/tests/pysidetest/CMakeLists.txt
@@ -0,0 +1,71 @@
+project(pysidetest)
+project(testbinding)
+
+cmake_minimum_required(VERSION 2.6)
+find_package(Qt4 4.5.0 REQUIRED)
+find_package(PythonLibs REQUIRED)
+find_package(PythonInterpWithDebug REQUIRED)
+find_package(GeneratorRunner 0.6 REQUIRED)
+find_package(Shiboken 0.5 REQUIRED)
+
+
+set(QT_USE_QTCORE 1)
+include(${QT_USE_FILE})
+add_definitions(${QT_DEFINITIONS})
+add_definitions(-DQT_SHARED)
+add_definitions(-DRXX_ALLOCATOR_INIT_0)
+
+set(pysidetest_SRC
+testobject.cpp
+)
+
+set(pysidetest_MOC_HEADERS
+testobject.h
+)
+
+qt4_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS})
+
+set(testbinding_SRC
+${CMAKE_CURRENT_BINARY_DIR}/testbinding/testobject_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/testbinding/testbinding_module_wrapper.cpp
+)
+
+set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
+add_custom_command(OUTPUT ${testbinding_SRC}
+COMMAND ${GENERATORRUNNER_BINARY} ${GENERATOR_EXTRA_FLAGS}
+ ${CMAKE_CURRENT_SOURCE_DIR}/global.h
+ --include-paths=${CMAKE_CURRENT_SOURCE_DIR}:${QT_INCLUDE_DIR}:${QT_QTCORE_INCLUDE_DIR}
+ --typesystem-paths=${CMAKE_CURRENT_SOURCE_DIR}:${pyside_SOURCE_DIR}:${QtCore_SOURCE_DIR}
+ --output-directory=${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_pysidetest.xml
+WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+COMMENT "Running generator for test binding..."
+)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${QT_INCLUDE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${QtCore_BINARY_DIR}/PySide/QtCore
+ ${libpyside_SOURCE_DIR}
+ ${PYTHON_INCLUDE_PATH})
+
+add_library(pysidetest SHARED ${pysidetest_SRC} ${pysidetest_MOC_SRC})
+target_link_libraries(pysidetest ${QT_QTCORE_LIBRARY})
+
+add_library(testbinding MODULE ${testbinding_SRC})
+set_property(TARGET testbinding PROPERTY PREFIX "")
+target_link_libraries(testbinding
+ pysidetest
+ pyside
+ ${PYTHON_LIBRARIES}
+ ${SHIBOKEN_LIBRARY}
+ ${QT_QTCORE_LIBRARY}
+ ${SBK_PYTHON_LIBRARIES})
+
+add_dependencies(testbinding pyside QtCore libpyside pysidetest)
+
+
+PYSIDE_TEST(homonimoussignalandmethod_test.py)
+