CMakeLists.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # ***** BEGIN GPL LICENSE BLOCK *****
  2. #
  3. # This program is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU General Public License
  5. # as published by the Free Software Foundation; either version 2
  6. # of the License, or (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software Foundation,
  15. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. # ***** END GPL LICENSE BLOCK *****
  17. # --env-system-scripts allows to run without the install target.
  18. # Use '--write-blend=/tmp/test.blend' to view output
  19. # Some tests are interesting but take too long to run
  20. # and don't give deterministic results
  21. set(USE_EXPERIMENTAL_TESTS FALSE)
  22. set(TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/../lib/tests)
  23. set(TEST_OUT_DIR ${CMAKE_BINARY_DIR}/tests)
  24. # ugh, any better way to do this on testing only?
  25. execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_OUT_DIR})
  26. #~ if(NOT IS_DIRECTORY ${TEST_SRC_DIR})
  27. #~ message(FATAL_ERROR "CMake test directory not found!")
  28. #~ endif()
  29. # all calls to blender use this
  30. if(APPLE)
  31. if(${CMAKE_GENERATOR} MATCHES "Xcode")
  32. set(TEST_BLENDER_EXE_PARAMS --background -noaudio --factory-startup)
  33. else()
  34. set(TEST_BLENDER_EXE_PARAMS --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)
  35. endif()
  36. else()
  37. set(TEST_BLENDER_EXE_PARAMS --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)
  38. endif()
  39. # for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no
  40. # set(TEST_BLENDER_EXE_BARE ${TEST_BLENDER_EXE})
  41. # set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} ${TEST_BLENDER_EXE_PARAMS} )
  42. # ------------------------------------------------------------------------------
  43. # GENERAL PYTHON CORRECTNESS TESTS
  44. macro (COLLADA_TEST module test_name blend_file)
  45. add_test(
  46. NAME collada_${module}_${test_name}
  47. COMMAND "$<TARGET_FILE:blender>" ${TEST_BLENDER_EXE_PARAMS} ${TEST_SRC_DIR}/collada/${module}/${blend_file}
  48. --python ${CMAKE_CURRENT_LIST_DIR}/${module}/test_${module}_${test_name}.py --
  49. --testdir ${TEST_SRC_DIR}/collada/${module}
  50. )
  51. endmacro()
  52. # Tests are disabled because they only work on Windows
  53. # Tests will be redone completely to work reliable
  54. #COLLADA_TEST(mesh simple mesh_simple.blend)
  55. #COLLADA_TEST(animation simple suzannes_parent_inverse.blend)