File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ option(STATIC "Build plugin as a static library" OFF)
1717if (STATIC )
1818 set (LIBTYPE STATIC )
1919 add_definitions (-DQT_STATICPLUGIN)
20- add_subdirectory ( test -static )
20+ set (TEST_DIR test -static )
2121else ()
2222 set (LIBTYPE MODULE)
23- add_subdirectory ( test -shared)
23+ set (TEST_DIR test -shared)
2424endif ()
2525
2626add_library (qsqlcipher ${LIBTYPE}
@@ -38,3 +38,7 @@ target_link_libraries(qsqlcipher
3838 ${SQLCIPHER_LIBRARIES}
3939)
4040
41+ include (CTest)
42+ if (BUILD_TESTING)
43+ add_subdirectory (${TEST_DIR} )
44+ endif ()
Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ Note that setting ``-DSTATIC=ON`` only builds *this plugin* as a static library.
4747If you also want to link to static versions of Qt and/or SQLCipher, it's up to
4848you to make sure CMake finds static versions of those libraries.
4949
50+
51+ ## Tests
52+
53+ Some basic tests are included - run `` make test `` . Note that while pretty much
54+ any C++ compiler can build the actual plugin, the tests require support for
55+ C++14. If you have an old compiler you can pass `` -DBUILD_TESTING=OFF `` to CMake
56+ to skip building the tests.
57+
5058-----
5159
5260## Old version
Original file line number Diff line number Diff line change @@ -3,3 +3,5 @@ set(CMAKE_CXX_FLAGS "-std=c++14")
33
44add_executable (qsqlcipher-test main.cpp)
55target_link_libraries (qsqlcipher-test Qt5::Sql)
6+
7+ add_test (NAME qsqlcipher-test COMMAND qsqlcipher-test )
You can’t perform that action at this time.
0 commit comments