upstream_Use-database-in-source-directory-while-running-tests.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 3f74b78e4ee9f1d400ebbf2b9093a0f9c48c6307 Mon Sep 17 00:00:00 2001
  2. From: Sebastian Kraft <mail@sebastiankraft.net>
  3. Date: Sat, 9 Jan 2016 20:48:16 +0100
  4. Subject: [PATCH] Use database in source directory while running tests. Fixes
  5. bug #46.
  6. ---
  7. tests/CMakeLists.txt | 4 ++--
  8. tests/test_database.cpp | 2 +-
  9. 2 files changed, 3 insertions(+), 3 deletions(-)
  10. diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
  11. index b79fda6..4056072 100644
  12. --- a/tests/CMakeLists.txt
  13. +++ b/tests/CMakeLists.txt
  14. @@ -1,6 +1,6 @@
  15. ADD_EXECUTABLE(test_database test_database.cpp)
  16. TARGET_LINK_LIBRARIES(test_database lensfun ${COMMON_LIBS})
  17. -ADD_TEST(Database test_database)
  18. +ADD_TEST(NAME Database WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND test_database)
  19. ADD_EXECUTABLE(test_modifier test_modifier.cpp)
  20. TARGET_LINK_LIBRARIES(test_modifier lensfun ${COMMON_LIBS})
  21. @@ -30,4 +30,4 @@ TARGET_LINK_LIBRARIES(test_modifier_coord_geometry lensfun ${COMMON_LIBS})
  22. ADD_TEST(Modifier_coord_geometry test_modifier_coord_geometry)
  23. FIND_PACKAGE(PythonInterp REQUIRED)
  24. -ADD_TEST(NAME Database_integrity COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/check_database/check_database.py ../../data/db)
  25. +ADD_TEST(NAME Database_integrity COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/check_database/check_database.py ${CMAKE_SOURCE_DIR}/data/db)
  26. diff --git a/tests/test_database.cpp b/tests/test_database.cpp
  27. index 45dc38f..49a2644 100644
  28. --- a/tests/test_database.cpp
  29. +++ b/tests/test_database.cpp
  30. @@ -10,7 +10,7 @@ typedef struct {
  31. void db_setup(lfFixture *lfFix, gconstpointer data)
  32. {
  33. lfFix->db = lf_db_new ();
  34. - lfFix->db->Load();
  35. + lfFix->db->LoadDirectory("data/db");
  36. }
  37. --
  38. 2.6.4