10 -DEDS_TEST_WORK_DIR=\"${CMAKE_BINARY_DIR}/tests/test-server-utils/cache\"
11 -DEDS_TEST_SQLITE_BOOKS=\"${CMAKE_SOURCE_DIR}/tests/book-migration/db\"
12 -DEDS_TEST_BUILT_BOOKS=\"${CMAKE_BINARY_DIR}/tests/book-migration/db\"
15 # If db_load is detected at configure time, then we've built
16 # an addressbook.db to test the migration from 3.6 -> Current.
18 # Instead of committing a BDB file directly which might have
19 # compatibility issues, we use a text dump (for SQLite we
20 # rely on compatilbility).
22 list(APPEND extra_defines
23 -DTEST_VERSIONS_WITH_BDB
32 ${ADDRESSBOOK_INCLUDE_DIRS}
33 ${CMAKE_BINARY_DIR}/tests/libebook/client
34 ${CMAKE_SOURCE_DIR}/tests/libebook/client
38 ${ADDRESSBOOK_LDFLAGS}
41 # Should be kept ordered approximately from least to most difficult/complex
46 foreach(_test ${TESTS})
47 set(SOURCES ${_test}.c)
49 build_only_installable_test(${_test}
57 add_check_test(${_test})
60 # This is a little cheat, it's not a real test, but can be built with the macro
61 set(SOURCES setup-migration-test.c)
63 build_only_installable_test(setup-migration-test
72 # This rule should be run once every stable release and then the
73 # newly created 'contacts.db' file added to git.
75 # For instance, when the EDS version is 3.12, the file:
76 # $(top_srcdir)/tests/book-migration/db/3.12/contacts.db
77 # will be created as a result of running 'make setup-migration'.
79 # Note that the 'setup-migration-test' program can be compiled
80 # with EDS versions back to 3.0. If you really need to rebuild
81 # the older test sandboxes, then setup-migration-test can be
82 # manually compiled and used with older builds of EDS.
83 set(_use_db_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
84 add_custom_target(setup-migration
85 COMMAND ${CMAKE_COMMAND} -E echo "Setting up new migration sandbox in ${CMAKE_SOURCE_DIR}/tests/book-migration/db/${_use_db_version}..."
86 COMMAND ${CMAKE_BINARY_DIR}/tests/book-migration/setup-migration-test
87 --use-test-sandbox --book-id ${_use_db_version}
88 --contacts-directory ${CMAKE_SOURCE_DIR}/tests/book-migration/vcards
89 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_SOURCE_DIR}/tests/book-migration/db/${_use_db_version}
90 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/tests/test-server-utils/cache/evolution/addressbook/${_use_db_version}/contacts.db
91 ${CMAKE_SOURCE_DIR}/tests/book-migration/db/${_use_db_version}/
92 COMMAND ${CMAKE_COMMAND} -E echo "Done."
93 DEPENDS setup-migration-test