From 57f2622e34df48d0901243b098f1447b5f260803 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 2 May 2015 12:54:03 +0200 Subject: [PATCH 1/4] tests: merge build of tests within main build Instead of a separate CMakeLists.txt for the tests, make them built together with the rest of the main project. This behaviour is off by default, and can be enabled using ENABLE_TESTING. Furthermore, the testing facilities of cmake are now used, so ctest (invoked by `make test`) knows about the sqlb-unittests. Thus, adapt the Travis build steps, building the main sources and executing the tests twice, one for sqlite and one for sqlcipher. --- .travis.yml | 13 +++---- CMakeLists.txt | 10 +++++ src/tests/CMakeLists.txt | 65 +++++++++++++++++++++++++++++++ tests/CMakeLists.txt | 84 ---------------------------------------- 4 files changed, 80 insertions(+), 92 deletions(-) create mode 100644 src/tests/CMakeLists.txt delete mode 100644 tests/CMakeLists.txt diff --git a/.travis.yml b/.travis.yml index 0bb5d290..e806b468 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,19 +9,16 @@ before_install: - sudo apt-get install -qq libqt4-dev libsqlite3-dev libsqlcipher-dev script: - - mkdir tests/build - mkdir build - mkdir build_cipher - - cd tests/build - - cmake .. - - make - - ./sqlb-unittests - - cd ../../build - - cmake .. + - cd build + - cmake -DENABLE_TESTING=ON .. - make + - ctest -V - cd ../build_cipher - - cmake -Dsqlcipher=1 .. + - cmake -DENABLE_TESTING=ON -Dsqlcipher=1 .. - make + - ctest -V matrix: fast_finish: true diff --git a/CMakeLists.txt b/CMakeLists.txt index f8899c18..4a1185e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ project(sqlitebrowser) cmake_minimum_required(VERSION 2.8.7) OPTION(USE_QT5 FALSE "Build with qt5") +OPTION(ENABLE_TESTING FALSE "Enable the unit tests") if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") @@ -42,6 +43,10 @@ else() add_definitions(${QT_DEFINITIONS}) endif() +if(ENABLE_TESTING) + enable_testing() +endif() + set(SQLB_HDR src/gen_version.h src/sqlitetypes.h @@ -260,6 +265,11 @@ install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib) + +if(ENABLE_TESTING) + add_subdirectory(src/tests) +endif() + if(UNIX AND NOT APPLE) install(FILES src/icons/${PROJECT_NAME}.png DESTINATION share/icons/hicolor/256x256/apps/) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt new file mode 100644 index 00000000..997a0385 --- /dev/null +++ b/src/tests/CMakeLists.txt @@ -0,0 +1,65 @@ +if(USE_QT5) +else() + find_package(Qt4 COMPONENTS QtTest REQUIRED) + include("${QT_USE_FILE}") + add_definitions(${QT_DEFINITIONS}) +endif() + +set(SQLB_UNITTESTS_SRC + ../sqlitedb.cpp + ../sqlitetablemodel.cpp + ../sqlitetypes.cpp + ../csvparser.cpp + ../grammar/Sqlite3Lexer.cpp + ../grammar/Sqlite3Parser.cpp + ../PreferencesDialog.cpp + TestImport.cpp + testsqlobjects.cpp + TestMain.cpp + ../FileDialog.cpp +) + +set(SQLB_UNITTESTS_HDR + ../grammar/sqlite3TokenTypes.hpp + ../grammar/Sqlite3Lexer.hpp + ../grammar/Sqlite3Parser.hpp + ../csvparser.h + ../sqlitetypes.h) + +set(SQLB_UNITTESTS_FORMS + ../PreferencesDialog.ui) + +set(SQLB_UNITTESTS_MOC_HDR + ../sqlitedb.h + ../sqlitetablemodel.h + ../PreferencesDialog.h + TestImport.h + testsqlobjects.h + ../FileDialog.h +) + +if(sqlcipher) + list(APPEND SQLB_UNITTESTS_SRC ../CipherDialog.cpp) + list(APPEND SQLB_UNITTESTS_FORMS ../CipherDialog.ui) + list(APPEND SQLB_UNITTESTS_MOC_HDR ../CipherDialog.h) +endif() + +if(USE_QT5) + QT5_WRAP_UI(SQLB_UNITTESTS_FORM_HDR ${SQLB_UNITTESTS_FORMS}) +else() + QT4_WRAP_CPP(SQLB_UNITTESTS_MOC ${SQLB_UNITTESTS_MOC_HDR}) + QT4_WRAP_UI(SQLB_UNITTESTS_FORM_HDR ${SQLB_UNITTESTS_FORMS}) +endif() + +include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${ANTLR_DIR}" ..) + +add_executable(sqlb-unittests ${SQLB_UNITTESTS_MOC} ${SQLB_UNITTESTS_HDR} ${SQLB_UNITTESTS_SRC} ${SQLB_UNITTESTS_FORM_HDR}) + +if(USE_QT5) + qt5_use_modules(sqlb-unittests Test Widgets Gui) + set(QT_LIBRARIES "") +endif() + +add_dependencies(sqlb-unittests antlr) +target_link_libraries(sqlb-unittests antlr ${QT_LIBRARIES} ${LIBSQLITE}) +add_test(sqlb-unittests sqlb-unittests) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt deleted file mode 100644 index ea5e52eb..00000000 --- a/tests/CMakeLists.txt +++ /dev/null @@ -1,84 +0,0 @@ -project(sqlb-unittests) -cmake_minimum_required(VERSION 2.8.7) - -OPTION(USE_QT5 FALSE "Build with qt5") - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif() - -set(ANTLR_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../libs/antlr-2.7.7") -add_subdirectory("${ANTLR_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/antlr") - -if(USE_QT5) - find_package(Qt5Widgets REQUIRED) - set(CMAKE_AUTOMOC ON) - set(CMAKE_INCLUDE_CURRENT_DIR ON) -else() - find_package(Qt4 COMPONENTS QtCore QtTest QtGui REQUIRED) - include("${QT_USE_FILE}") - add_definitions(${QT_DEFINITIONS}) -endif() - -# add extra library path for MacOS -if(APPLE) - find_library(LIBSQLITE sqlite3 HINTS /usr/local/lib /usr/local/opt/sqlite/lib) - set(ADDITIONAL_INCLUDE_PATHS /usr/local/include /usr/local/opt/sqlite/include) -else(APPLE) - find_library(LIBSQLITE sqlite3) -endif(APPLE) - -set(SQLB_SRC - ../src/sqlitedb.cpp - ../src/sqlitetablemodel.cpp - ../src/sqlitetypes.cpp - ../src/csvparser.cpp - ../src/grammar/Sqlite3Lexer.cpp - ../src/grammar/Sqlite3Parser.cpp - ../src/PreferencesDialog.cpp - ../src/tests/TestImport.cpp - ../src/tests/testsqlobjects.cpp - ../src/tests/TestMain.cpp - ../src/FileDialog.cpp -) - -set(SQLB_HDR - ../src/grammar/sqlite3TokenTypes.hpp - ../src/grammar/Sqlite3Lexer.hpp - ../src/grammar/Sqlite3Parser.hpp - ../src/csvparser.h - ../src/sqlitetypes.h) - -set(SQLB_FORMS - ../src/PreferencesDialog.ui) - -set(SQLB_MOC_HDR - ../src/sqlitedb.h - ../src/sqlitetablemodel.h - ../src/PreferencesDialog.h - ../src/tests/TestImport.h - ../src/tests/testsqlobjects.h - ../src/FileDialog.h -) - -if(USE_QT5) - QT5_WRAP_CPP(SQLB_MOC ${SQLB_MOC_HDR}) - QT5_WRAP_UI(SQLB_FORM_HDR ${SQLB_FORMS}) -else() - QT4_WRAP_CPP(SQLB_MOC ${SQLB_MOC_HDR}) - QT4_WRAP_UI(SQLB_FORM_HDR ${SQLB_FORMS}) -endif() - -include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${ANTLR_DIR}" ../src) - -add_executable(${PROJECT_NAME} ${SQLB_MOC} ${SQLB_HDR} ${SQLB_SRC} ${SQLB_FORM_HDR}) - -if(USE_QT5) - qt5_use_modules(${PROJECT_NAME} Test Widgets Gui) - set(QT_LIBRARIES "") -endif() - -add_dependencies(${PROJECT_NAME} antlr) -target_link_libraries(${PROJECT_NAME} antlr ${QT_LIBRARIES} ${LIBSQLITE}) - -MESSAGE(STATUS "Build type is ${CMAKE_BUILD_TYPE}") From 27df9cfa4d7e9607dfdb32230888cd990d3a359f Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 2 May 2015 13:51:23 +0200 Subject: [PATCH 2/4] tests: split sqlb-unittests Instead of a single executable running different unit tests at the same time, split the sqlobjects and import parts out of it. While this currently duplicates the cmake boilerplate for each, it allows to finetune each properly (like build only the sources for it, in the future), and to call each separately. Add the QTEST_MAIN in each test, and remove the manual QCoreApplication handling in TestImport (handled by QTEST_MAIN). --- src/tests/CMakeLists.txt | 94 ++++++++++++++++++++++++++++-------- src/tests/TestImport.cpp | 13 ++--- src/tests/TestImport.h | 6 --- src/tests/TestMain.cpp | 17 ------- src/tests/testsqlobjects.cpp | 2 + 5 files changed, 80 insertions(+), 52 deletions(-) delete mode 100644 src/tests/TestMain.cpp diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 997a0385..a9dd651e 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -5,7 +5,66 @@ else() add_definitions(${QT_DEFINITIONS}) endif() -set(SQLB_UNITTESTS_SRC +include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${ANTLR_DIR}" ..) + +# test-sqlobjects + +set(TESTSQLOBJECTS_SRC + ../sqlitedb.cpp + ../sqlitetablemodel.cpp + ../sqlitetypes.cpp + ../csvparser.cpp + ../grammar/Sqlite3Lexer.cpp + ../grammar/Sqlite3Parser.cpp + ../PreferencesDialog.cpp + testsqlobjects.cpp + ../FileDialog.cpp +) + +set(TESTSQLOBJECTS_HDR + ../grammar/sqlite3TokenTypes.hpp + ../grammar/Sqlite3Lexer.hpp + ../grammar/Sqlite3Parser.hpp + ../sqlitetypes.h) + +set(TESTSQLOBJECTS_FORMS + ../PreferencesDialog.ui) + +set(TESTSQLOBJECTS_MOC_HDR + ../sqlitedb.h + ../sqlitetablemodel.h + ../PreferencesDialog.h + testsqlobjects.h + ../FileDialog.h +) + +if(sqlcipher) + list(APPEND TESTSQLOBJECTS_SRC ../CipherDialog.cpp) + list(APPEND TESTSQLOBJECTS_FORMS ../CipherDialog.ui) + list(APPEND TESTSQLOBJECTS_MOC_HDR ../CipherDialog.h) +endif() + +if(USE_QT5) + QT5_WRAP_UI(TESTSQLOBJECTS_FORM_HDR ${TESTSQLOBJECTS_FORMS}) +else() + QT4_WRAP_CPP(TESTSQLOBJECTS_MOC ${TESTSQLOBJECTS_MOC_HDR}) + QT4_WRAP_UI(TESTSQLOBJECTS_FORM_HDR ${TESTSQLOBJECTS_FORMS}) +endif() + +add_executable(test-sqlobjects ${TESTSQLOBJECTS_MOC} ${TESTSQLOBJECTS_HDR} ${TESTSQLOBJECTS_SRC} ${TESTSQLOBJECTS_FORM_HDR}) + +if(USE_QT5) + qt5_use_modules(test-sqlobjects Test Widgets Gui) + set(QT_LIBRARIES "") +endif() + +add_dependencies(test-sqlobjects antlr) +target_link_libraries(test-sqlobjects antlr ${QT_LIBRARIES} ${LIBSQLITE}) +add_test(test-sqlobjects test-sqlobjects) + +# test-import + +set(TESTIMPORT_SRC ../sqlitedb.cpp ../sqlitetablemodel.cpp ../sqlitetypes.cpp @@ -14,52 +73,47 @@ set(SQLB_UNITTESTS_SRC ../grammar/Sqlite3Parser.cpp ../PreferencesDialog.cpp TestImport.cpp - testsqlobjects.cpp - TestMain.cpp ../FileDialog.cpp ) -set(SQLB_UNITTESTS_HDR +set(TESTIMPORT_HDR ../grammar/sqlite3TokenTypes.hpp ../grammar/Sqlite3Lexer.hpp ../grammar/Sqlite3Parser.hpp ../csvparser.h ../sqlitetypes.h) -set(SQLB_UNITTESTS_FORMS +set(TESTIMPORT_FORMS ../PreferencesDialog.ui) -set(SQLB_UNITTESTS_MOC_HDR +set(TESTIMPORT_MOC_HDR ../sqlitedb.h ../sqlitetablemodel.h ../PreferencesDialog.h TestImport.h - testsqlobjects.h ../FileDialog.h ) if(sqlcipher) - list(APPEND SQLB_UNITTESTS_SRC ../CipherDialog.cpp) - list(APPEND SQLB_UNITTESTS_FORMS ../CipherDialog.ui) - list(APPEND SQLB_UNITTESTS_MOC_HDR ../CipherDialog.h) + list(APPEND TESTIMPORT_SRC ../CipherDialog.cpp) + list(APPEND TESTIMPORT_FORMS ../CipherDialog.ui) + list(APPEND TESTIMPORT_MOC_HDR ../CipherDialog.h) endif() if(USE_QT5) - QT5_WRAP_UI(SQLB_UNITTESTS_FORM_HDR ${SQLB_UNITTESTS_FORMS}) + QT5_WRAP_UI(TESTIMPORT_FORM_HDR ${TESTIMPORT_FORMS}) else() - QT4_WRAP_CPP(SQLB_UNITTESTS_MOC ${SQLB_UNITTESTS_MOC_HDR}) - QT4_WRAP_UI(SQLB_UNITTESTS_FORM_HDR ${SQLB_UNITTESTS_FORMS}) + QT4_WRAP_CPP(TESTIMPORT_MOC ${TESTIMPORT_MOC_HDR}) + QT4_WRAP_UI(TESTIMPORT_FORM_HDR ${TESTIMPORT_FORMS}) endif() -include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${ANTLR_DIR}" ..) - -add_executable(sqlb-unittests ${SQLB_UNITTESTS_MOC} ${SQLB_UNITTESTS_HDR} ${SQLB_UNITTESTS_SRC} ${SQLB_UNITTESTS_FORM_HDR}) +add_executable(test-import ${TESTIMPORT_MOC} ${TESTIMPORT_HDR} ${TESTIMPORT_SRC} ${TESTIMPORT_FORM_HDR}) if(USE_QT5) - qt5_use_modules(sqlb-unittests Test Widgets Gui) + qt5_use_modules(test-import Test Widgets Gui) set(QT_LIBRARIES "") endif() -add_dependencies(sqlb-unittests antlr) -target_link_libraries(sqlb-unittests antlr ${QT_LIBRARIES} ${LIBSQLITE}) -add_test(sqlb-unittests sqlb-unittests) +add_dependencies(test-import antlr) +target_link_libraries(test-import antlr ${QT_LIBRARIES} ${LIBSQLITE}) +add_test(test-import test-import) diff --git a/src/tests/TestImport.cpp b/src/tests/TestImport.cpp index e6f3f8f9..17710a35 100644 --- a/src/tests/TestImport.cpp +++ b/src/tests/TestImport.cpp @@ -1,3 +1,5 @@ +// force QtCore-only main application by QTEST_MAIN +#undef QT_GUI_LIB #include #include #include @@ -7,23 +9,16 @@ #include "TestImport.h" #include "../sqlitedb.h" +QTEST_MAIN(TestImport) + Q_DECLARE_METATYPE(CSVParser::TCSVResult) TestImport::TestImport() { - // Init basic application - // The app needs to be initialized for the utf8 test - // to work - argcount = 1; - args[0] = new char[20]; - strcpy(args[0], "sqlb-unittests"); - app = new QCoreApplication(argcount, args); } TestImport::~TestImport() { - delete[] args[0]; - delete app; } void TestImport::csvImport() diff --git a/src/tests/TestImport.h b/src/tests/TestImport.h index e9edb3f9..18de5619 100644 --- a/src/tests/TestImport.h +++ b/src/tests/TestImport.h @@ -2,7 +2,6 @@ #define TESTIMPORT_H #include -#include class TestImport : public QObject { @@ -12,11 +11,6 @@ public: TestImport(); ~TestImport(); -private: - int argcount; - char *args[1]; // the size must match what 'argcount' is set to - QCoreApplication* app; - private slots: void csvImport(); void csvImport_data(); diff --git a/src/tests/TestMain.cpp b/src/tests/TestMain.cpp deleted file mode 100644 index f26741b6..00000000 --- a/src/tests/TestMain.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include "tests/testsqlobjects.h" -#include "tests/TestImport.h" - -int main(int argc, char** argv) -{ - int status = 0; - { - TestTable tc; - status |= QTest::qExec(&tc, argc, argv); - } - { - TestImport tc; - status |= QTest::qExec(&tc, argc, argv); - } - return status; -} diff --git a/src/tests/testsqlobjects.cpp b/src/tests/testsqlobjects.cpp index b1e83b37..63ecaba2 100644 --- a/src/tests/testsqlobjects.cpp +++ b/src/tests/testsqlobjects.cpp @@ -3,6 +3,8 @@ #include +QTEST_APPLESS_MAIN(TestTable) + using namespace sqlb; void TestTable::sqlOutput() From 8d07f120bf7fca2e30b7fd85429e9b3ed3ea1b78 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 2 May 2015 13:56:34 +0200 Subject: [PATCH 3/4] tests: remove DBBrowserDB usage from test-import Apparently DBBrowserDB is not really used, so remove it and cleanup test-import from the extra sources and dependencies needed by that. --- src/tests/CMakeLists.txt | 36 +++--------------------------------- src/tests/TestImport.cpp | 4 ---- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index a9dd651e..ebe2203e 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -65,55 +65,25 @@ add_test(test-sqlobjects test-sqlobjects) # test-import set(TESTIMPORT_SRC - ../sqlitedb.cpp - ../sqlitetablemodel.cpp - ../sqlitetypes.cpp ../csvparser.cpp - ../grammar/Sqlite3Lexer.cpp - ../grammar/Sqlite3Parser.cpp - ../PreferencesDialog.cpp TestImport.cpp - ../FileDialog.cpp ) -set(TESTIMPORT_HDR - ../grammar/sqlite3TokenTypes.hpp - ../grammar/Sqlite3Lexer.hpp - ../grammar/Sqlite3Parser.hpp - ../csvparser.h - ../sqlitetypes.h) - -set(TESTIMPORT_FORMS - ../PreferencesDialog.ui) - set(TESTIMPORT_MOC_HDR - ../sqlitedb.h - ../sqlitetablemodel.h - ../PreferencesDialog.h TestImport.h - ../FileDialog.h ) -if(sqlcipher) - list(APPEND TESTIMPORT_SRC ../CipherDialog.cpp) - list(APPEND TESTIMPORT_FORMS ../CipherDialog.ui) - list(APPEND TESTIMPORT_MOC_HDR ../CipherDialog.h) -endif() - if(USE_QT5) - QT5_WRAP_UI(TESTIMPORT_FORM_HDR ${TESTIMPORT_FORMS}) else() QT4_WRAP_CPP(TESTIMPORT_MOC ${TESTIMPORT_MOC_HDR}) - QT4_WRAP_UI(TESTIMPORT_FORM_HDR ${TESTIMPORT_FORMS}) endif() -add_executable(test-import ${TESTIMPORT_MOC} ${TESTIMPORT_HDR} ${TESTIMPORT_SRC} ${TESTIMPORT_FORM_HDR}) +add_executable(test-import ${TESTIMPORT_MOC} ${TESTIMPORT_SRC}) if(USE_QT5) - qt5_use_modules(test-import Test Widgets Gui) + qt5_use_modules(test-import Test Core) set(QT_LIBRARIES "") endif() -add_dependencies(test-import antlr) -target_link_libraries(test-import antlr ${QT_LIBRARIES} ${LIBSQLITE}) +target_link_libraries(test-import ${QT_LIBRARIES}) add_test(test-import test-import) diff --git a/src/tests/TestImport.cpp b/src/tests/TestImport.cpp index 17710a35..6e53bc19 100644 --- a/src/tests/TestImport.cpp +++ b/src/tests/TestImport.cpp @@ -7,7 +7,6 @@ #include "csvparser.h" #include "TestImport.h" -#include "../sqlitedb.h" QTEST_MAIN(TestImport) @@ -41,9 +40,6 @@ void TestImport::csvImport() } file.flush(); - // Call decodeCSV function - DBBrowserDB db; - CSVParser csvparser(true, separator, quote); file.seek(0); QTextStream tstream(&file); From e8b9de3212579436fe26becc45c6b05d7242fba8 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 3 May 2015 09:33:27 +0200 Subject: [PATCH 4/4] Update build instructions for tests Update BUILDING.md regarding the unit tests, mentioning ENABLE_TESTING during the build, and make test or ctest for running them. --- BUILDING.md | 90 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 27 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 3758193b..9a8fc564 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -172,46 +172,82 @@ qmake qmake CONFIG+=sqlcipher ## Building and running the Unit Tests -DB Browser for SQLite has unit tests in the "tests" subdirectory. +DB Browser for SQLite has unit tests in the "src/tests" subdirectory. ### Build the unit tests -Compile them like this: +The unit tests are enabled using the cmake variable `ENABLE_TESTING`; +it can be passed when running `cmake` to configure sqlitebrowser, +for example like this: -``` -$ cd tests +```bash $ mkdir build $ cd build -$ cmake .. +$ cmake -DENABLE_TESTING=ON .. $ make ``` ### Run the unit tests -Then run them like this: +Tests can be then run using `make test` or invoking `ctest` directly, +for example like this: ``` -$ ./sqlb-unittests -********* Start testing of TestTable ********* -Config: Using QTest library 4.8.6, Qt 4.8.6 -PASS : TestTable::initTestCase() -PASS : TestTable::sqlOutput() -PASS : TestTable::autoincrement() -PASS : TestTable::notnull() -PASS : TestTable::withoutRowid() -PASS : TestTable::parseSQL() -PASS : TestTable::parseSQLdefaultexpr() -PASS : TestTable::parseSQLMultiPk() -PASS : TestTable::parseSQLForeignKey() -PASS : TestTable::parseSQLSingleQuotes() -PASS : TestTable::parseSQLKeywordInIdentifier() -PASS : TestTable::parseSQLWithoutRowid() -PASS : TestTable::parseNonASCIIChars() -PASS : TestTable::createTableWithIn() -PASS : TestTable::createTableWithNotLikeConstraint() -PASS : TestTable::cleanupTestCase() -Totals: 16 passed, 0 failed, 0 skipped -********* Finished testing of TestTable ********* +$ ctest -V +UpdateCTestConfiguration from :SRCDIR/build/DartConfiguration.tcl +UpdateCTestConfiguration from :SRCDIR/build/DartConfiguration.tcl +Test project SRCDIR/build +Constructing a list of tests +Done constructing a list of tests +Checking test dependency graph... +Checking test dependency graph end +test 1 + Start 1: test-sqlobjects + +1: Test command: SRCDIR/build/src/tests/test-sqlobjects +1: Test timeout computed to be: 9.99988e+06 +1: ********* Start testing of TestTable ********* +1: Config: Using QTest library 4.8.6, Qt 4.8.6 +1: PASS : TestTable::initTestCase() +1: PASS : TestTable::sqlOutput() +1: PASS : TestTable::autoincrement() +1: PASS : TestTable::notnull() +1: PASS : TestTable::withoutRowid() +1: PASS : TestTable::foreignKeys() +1: PASS : TestTable::parseSQL() +1: PASS : TestTable::parseSQLdefaultexpr() +1: PASS : TestTable::parseSQLMultiPk() +1: PASS : TestTable::parseSQLForeignKey() +1: PASS : TestTable::parseSQLSingleQuotes() +1: PASS : TestTable::parseSQLKeywordInIdentifier() +1: PASS : TestTable::parseSQLWithoutRowid() +1: PASS : TestTable::parseNonASCIIChars() +1: PASS : TestTable::parseSQLEscapedQuotes() +1: PASS : TestTable::parseSQLForeignKeys() +1: PASS : TestTable::parseSQLCheckConstraint() +1: PASS : TestTable::createTableWithIn() +1: PASS : TestTable::createTableWithNotLikeConstraint() +1: PASS : TestTable::cleanupTestCase() +1: Totals: 20 passed, 0 failed, 0 skipped +1: ********* Finished testing of TestTable ********* +1/2 Test #1: test-sqlobjects .................. Passed 0.02 sec +test 2 + Start 2: test-import + +2: Test command: SRCDIR/build/src/tests/test-import +2: Test timeout computed to be: 9.99988e+06 +2: ********* Start testing of TestImport ********* +2: Config: Using QTest library 4.8.6, Qt 4.8.6 +2: PASS : TestImport::initTestCase() +2: PASS : TestImport::csvImport() +2: PASS : TestImport::cleanupTestCase() +2: Totals: 3 passed, 0 failed, 0 skipped +2: ********* Finished testing of TestImport ********* +2/2 Test #2: test-import ...................... Passed 0.01 sec + +100% tests passed, 0 tests failed out of 2 + +Total Test time (real) = 0.04 sec ``` Everything should PASS, with no failures, and nothing skipped.