[Kde-bindings] KDE/kdebindings/php/phpqt
Thomas Moenicke
tm at php-qt.org
Sat Nov 8 18:02:12 UTC 2008
SVN commit 881657 by moenicke:
* added unittests:
QtQStringTestCase.php
QtClassTestCase.php
QtMarshallingTestCase.php
QtObjectTestCase.php
QtInternalTestCase.php
QtModelViewTestCase.php
QtStressTestCase.php
* cleaning
CCMAIL: kde-bindings at kde.org
M +62 -0 CMakeLists.txt
M +1 -5 CMakeLists.txt.php-qt
D tests/QtAdvancedTestCase.php
M +11 -3 tests/QtClassTestCase.php
M +5 -5 tests/QtObjectTestCase.php
M +5 -5 tests/QtStressTestCase.php
D tests/box2buttons.php
D tests/callbackTests.php
D tests/cannonfield.php
M +1 -1 tests/config.php.conf
D tests/designer.php
D tests/designer.ui
D tests/lcdrange.php
A tests/misc (directory)
A tests/misc/box2buttons.php tests/box2buttons.php#848315
A tests/misc/callbackTests.php tests/callbackTests.php#878198
A tests/misc/cannonfield.php tests/cannonfield.php#878198
A tests/misc/designer.php tests/designer.php#880611
A tests/misc/designer.ui tests/designer.ui#881569
A tests/misc/lcdrange.php tests/lcdrange.php#878198
A tests/misc/qFunctions.php tests/qFunctions.php#848315
A tests/misc/testMinimalItemModel.php tests/testMinimalItemModel.php#848315
A tests/misc/ui_designer.php tests/ui_designer.php#848315
A tests/misc/unicode.php tests/unicode.php#848315
A tests/misc/unicode.xml tests/unicode.xml#848315
D tests/phpqt_from_scratch.sh
D tests/qFunctions.php
D tests/runAllTests.sh
D tests/testMinimalItemModel.php
M +0 -10 tests/testModelView.php
D tests/ui_designer.php
D tests/unicode.php
D tests/unicode.xml
A tests/unittesthelper (directory)
A tests/unittesthelper/testModelView.php tests/testModelView.php#848315
--- trunk/KDE/kdebindings/php/phpqt/CMakeLists.txt #881656:881657
@@ -1,3 +1,65 @@
+#
+# to use the file to build a Qt only version of PHP-Qt, copy it to CMakeLists.txt
+#
+# run prepare_svn.sh
+# make a build/ dir, step into
+# run: cmake ..
+# run: make
+#
+# for further information read the README file in php/phpqt
+#
+
+cmake_minimum_required(VERSION 2.6)
+
+project(PHP-Qt)
+
+# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
+
+FIND_PACKAGE(Perl REQUIRED)
+FIND_PACKAGE (Qt4 REQUIRED)
+
+add_definitions (${QT_DEFINITIONS} -DHAVE_CONFIG_H=1)
+include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${QT_INCLUDES} )
+
+FIND_PACKAGE (PHP5 REQUIRED)
+FIND_PACKAGE (OpenGL REQUIRED)
+
+OPTION(ENABLE_SMOKE "build Smoke" OFF)
+OPTION(ENABLE_QTWEBKIT_SMOKE "build QtWebKitSmoke" OFF)
+OPTION(ENABLE_QTSCRIPT_SMOKE "build QtScriptSmoke" OFF)
+OPTION(ENABLE_QTUITOOLS_SMOKE "build QtUiToolsSmoke" OFF)
+OPTION(ENABLE_PHONON_SMOKE "build PhononSmoke" OFF)
+OPTION(ENABLE_QSCI_SMOKE "build QsciSmoke" OFF)
+OPTION(ENABLE_QWT_SMOKE "build QwtSmoke" OFF)
+OPTION(ENABLE_KDE_SMOKE "build KDESmoke" OFF)
+OPTION(ENABLE_KDEVPLATFORM_SMOKE "build KDevPlatformSmoke" OFF)
+OPTION(ENABLE_KHTML_SMOKE "build KHTMLSmoke" OFF)
+OPTION(ENABLE_KTEXTEDITOR_SMOKE "build KTextEditorSmoke" OFF)
+OPTION(ENABLE_SOLID_SMOKE "build SolidSmoke" OFF)
+OPTION(ENABLE_PHP-QT "build PHP-Qt" ON)
+
+set(kdebindings_SOURCE_DIR ${CMAKE_SOURCE_DIR})
+add_subdirectory(smoke)
add_subdirectory(src)
add_subdirectory(tests)
add_subdirectory(tools)
+include(tests/CMakeLists.txt)
+
+if(PHPUNIT_EXECUTABLE)
+ MESSAGE(STATUS "phpunit found: configuring for tests")
+ ENABLE_TESTING()
+ SET(RUNTIME_OUTPUT_DIRECTORY_ORIG)
+ SET(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}"/tests/")
+
+ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/tests/config.php.conf ${CMAKE_BUILD_DIR}config.php @ONLY )
+ FOREACH(TEST_CASE ${PHPQT_TEST_FILES} )
+ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/tests/${TEST_CASE} ${CMAKE_BUILD_DIR}${TEST_CASE} COPYONLY )
+ ADD_TEST( ${TEST_CASE} ${PHPUNIT_EXECUTABLE} --log-tap ${TEST_CASE}.log ${TEST_CASE} )
+ MESSAGE(STATUS "added "${TEST_CASE} )
+ ENDFOREACH(TEST_CASE)
+
+ SET(RUNTIME_OUTPUT_DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY_ORIG})
+elseif(PHPUNIT_EXECUTABLE)
+ MESSAGE(STATUS "no tests configured (needs phpunit)")
+endif(PHPUNIT_EXECUTABLE)
--- trunk/KDE/kdebindings/php/phpqt/CMakeLists.txt.php-qt #881656:881657
@@ -44,6 +44,7 @@
add_subdirectory(src)
add_subdirectory(tests)
add_subdirectory(tools)
+include(tests/CMakeLists.txt)
if(PHPUNIT_EXECUTABLE)
MESSAGE(STATUS "phpunit found: configuring for tests")
@@ -51,11 +52,6 @@
SET(RUNTIME_OUTPUT_DIRECTORY_ORIG)
SET(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}"/tests/")
- SET(PHPQT_TEST_FILES
- QtLoadModuleTestCase.php
- QtBasicTestCase.php
- )
-
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/tests/config.php.conf ${CMAKE_BUILD_DIR}config.php @ONLY )
FOREACH(TEST_CASE ${PHPQT_TEST_FILES} )
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/tests/${TEST_CASE} ${CMAKE_BUILD_DIR}${TEST_CASE} COPYONLY )
--- trunk/KDE/kdebindings/php/phpqt/tests/QtClassTestCase.php #881656:881657
@@ -6,8 +6,11 @@
require_once('PHPUnit/Framework/TestCase.php');
require_once('PHPUnit/Framework/TestSuite.php');
- require_once('testHelper.php');
+ require_once('config.php');
+ require_once($tests_path.'/testHelper.php');
+
+
/*
* test cases
*/
@@ -24,9 +27,14 @@
public function createQApplicationInstance()
{
+ if( !QCoreApplication::instance() )
+ {
$argc=1;
- $argv=array("argv");
- $this->app = new QApplication($argc,$argv);
+ $argv=array("argv");
+ $this->app = new QApplication($argc,$argv);
+ } else {
+ $this->app = QCoreApplication::instance();
+ }
}
public function testEmitSignal()
--- trunk/KDE/kdebindings/php/phpqt/tests/QtObjectTestCase.php #881656:881657
@@ -34,7 +34,7 @@
$app = new QApplication($argc, $argv);
- class QtAdvancedTestCase extends PHPUnit_Framework_TestCase {
+ class QtObjectTestCase extends PHPUnit_Framework_TestCase {
public function __construct($name="") {
parent::__construct($name);
@@ -110,15 +110,15 @@
$widget_a = new QWidget();
$widget_a->resize( 24, 28 );
$size_a = $widget_a->size();
- $this->assertEqual( $size_a->width(), $widget_a->width(), "return value of QWidget::size() is not correct\n" );
+ $this->assertEquals( $size_a->width(), $widget_a->width(), "return value of QWidget::size() is not correct\n" );
echo "passed\n";
echo "testing returning a Stack item, changing values ";
$widget_a->resize( 26, 30 );
$size_b = $widget_a->size();
- $this->assertEqual( $size_b->width(), 26, "" );
- $this->assertEqual( $size_a->width(), 24, "" );
- $this->assertEqual( $this->widget_a->size(), $size_b->width() );
+ $this->assertEquals( $size_b->width(), 26, "" );
+ $this->assertEquals( $size_a->width(), 24, "" );
+// $this->assertEquals( $widget_a->size(), $size_b->width() );
}
--- trunk/KDE/kdebindings/php/phpqt/tests/QtStressTestCase.php #881656:881657
@@ -15,14 +15,14 @@
}
function testCreatingObjects() {
-// for($i = 0; $i < 8000; $i++){
+ for($i = 0; $i < 8000; $i++){
- while(true){
- $b = new QObject();
- $b->setObjectName("hallo");
+// while(true){
+ $b = new QObject();
+ $b->setObjectName("hallo");
echo $i++."\n";
echo $b->objectName();
- $b->__destruct();
+ $b->__destruct();
}
}
--- trunk/KDE/kdebindings/php/phpqt/tests/config.php.conf #881656:881657
@@ -2,5 +2,5 @@
/*
* helper file, don't touch
*/
-$tests_path = "@CMAKE_SOURCE_DIR@/tests/"
+$tests_path = "@CMAKE_SOURCE_DIR@/tests/unittesthelper/"
?>
\ No newline at end of file
--- trunk/KDE/kdebindings/php/phpqt/tests/testModelView.php #881656:881657
@@ -35,14 +35,4 @@
}
}
- $app = new QApplication( $argc, $argv );
-
- $model_a = new MyItemModel();
-
- $treeView = new QTableView();
- $treeView->setModel( $model_a );
-
- $treeView->show();
- $app->exec();
-
?>
\ No newline at end of file
More information about the Kde-bindings
mailing list