I#27 - [IMAPx] Ignore DavMail's CR/LF in BODYSTRUCTURE response
[evolution-data-server.git] / tests / book-migration / CMakeLists.txt
blob93a657174921e3b947ec677f0423ca3d76dc8bb8
1 set(extra_deps
2         ebook
3         ebook-contacts
4         edbus-private
5         client-test-utils
9 set(extra_defines
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).
21 if(HAVE_DB_LOAD)
22         list(APPEND extra_defines
23                 -DTEST_VERSIONS_WITH_BDB
24         )
25 endif(HAVE_DB_LOAD)
27 set(extra_cflags
28         ${ADDRESSBOOK_CFLAGS}
31 set(extra_incdirs
32         ${ADDRESSBOOK_INCLUDE_DIRS}
33         ${CMAKE_BINARY_DIR}/tests/libebook/client
34         ${CMAKE_SOURCE_DIR}/tests/libebook/client
37 set(extra_ldflags
38         ${ADDRESSBOOK_LDFLAGS}
41 # Should be kept ordered approximately from least to most difficult/complex
42 set(TESTS
43         test-migration
46 foreach(_test ${TESTS})
47         set(SOURCES ${_test}.c)
49         build_only_installable_test(${_test}
50                 SOURCES
51                 extra_deps
52                 extra_defines
53                 extra_cflags
54                 extra_incdirs
55                 extra_ldflags
56         )
57         add_check_test(${_test})
58 endforeach(_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
64         SOURCES
65         extra_deps
66         extra_defines
67         extra_cflags
68         extra_incdirs
69         extra_ldflags
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
96 add_subdirectory(db)