CMakeLists.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. # CMake build control file for safe numerics Library tests
  2. ###########################
  3. # test targets
  4. message( STATUS "Runtimes are stored in ${CMAKE_CURRENT_BINARY_DIR}" )
  5. # compile and run tests
  6. set( run_test_list
  7. test_add_automatic
  8. test_add_native
  9. test_and_automatic
  10. test_and_native
  11. test_assignment
  12. test_auto
  13. test_cast
  14. test_checked_add
  15. test_checked_and
  16. test_checked_cast
  17. test_checked_divide
  18. test_checked_equal_to
  19. test_checked_left_shift
  20. test_checked_less_than
  21. test_checked_modulus
  22. test_checked_multiply
  23. test_checked_or
  24. test_checked_right_shift
  25. test_checked_subtract
  26. test_checked_xor
  27. test_construction
  28. test_cpp
  29. test_divide_automatic
  30. test_divide_native
  31. test_equal_automatic
  32. test_equal_native
  33. test_float
  34. test_interval
  35. test_left_shift_automatic
  36. test_left_shift_native
  37. test_less_than_automatic
  38. test_less_than_native
  39. test_modulus_automatic
  40. test_modulus_native
  41. test_multiply_automatic
  42. test_multiply_native
  43. test_or_automatic
  44. test_or_native
  45. # test_performance
  46. test_range
  47. test_rational
  48. test_right_shift_automatic
  49. test_right_shift_native
  50. test_safe_compare
  51. test_subtract_automatic
  52. test_subtract_native
  53. test_xor_automatic
  54. test_xor_native
  55. test_z
  56. )
  57. foreach(test_name ${run_test_list})
  58. test_run_pass(${test_name})
  59. set_target_properties(${test_name} PROPERTIES FOLDER "safe numeric runtime tests")
  60. endforeach(test_name)
  61. # compile fail tests
  62. set(compile_fail_test_list
  63. test_trap
  64. test_constexpr
  65. )
  66. foreach(test_name ${compile_fail_test_list})
  67. test_compile_fail(${test_name})
  68. set_target_properties(${test_name} PROPERTIES FOLDER "safe numeric compile fail tests")
  69. endforeach(test_name)
  70. ## safe integer constexpr tests
  71. set(safe_constexpr_test_list
  72. test_add_automatic_constexpr
  73. test_add_native_constexpr
  74. test_divide_automatic_constexpr
  75. test_divide_native_constexpr
  76. test_equal_automatic_constexpr
  77. test_equal_native_constexpr
  78. test_left_shift_automatic_constexpr
  79. test_left_shift_native_constexpr
  80. test_less_than_automatic_constexpr
  81. test_less_than_native_constexpr
  82. test_modulus_automatic_constexpr
  83. test_modulus_native_constexpr
  84. test_multiply_automatic_constexpr
  85. test_multiply_native_constexpr
  86. test_or_automatic_constexpr
  87. test_or_native_constexpr
  88. test_right_shift_automatic_constexpr
  89. test_right_shift_native_constexpr
  90. test_xor_automatic_constexpr
  91. test_xor_native_constexpr
  92. test_subtract_native_constexpr
  93. test_subtract_automatic_constexpr
  94. )
  95. foreach(test_name ${safe_constexpr_test_list})
  96. test_compile_pass(${test_name})
  97. set_target_properties(${test_name} PROPERTIES FOLDER "safe constexpr tests - compile only")
  98. endforeach(test_name)
  99. # checked results constexpr
  100. set(checked_result_test_list
  101. test_checked_add_constexpr
  102. test_checked_and_constexpr
  103. test_checked_cast_constexpr
  104. test_checked_divide_constexpr
  105. test_checked_equal_to_constexpr
  106. test_checked_left_shift_constexpr
  107. test_checked_less_than_constexpr
  108. test_checked_modulus_constexpr
  109. test_checked_multiply_constexpr
  110. test_checked_or_constexpr
  111. test_checked_right_shift_constexpr
  112. test_checked_subtract_constexpr
  113. test_checked_xor_constexpr
  114. )
  115. foreach(test_name ${checked_result_test_list})
  116. test_compile_pass(${test_name})
  117. set_target_properties(${test_name} PROPERTIES FOLDER "checked result tests - compile only")
  118. endforeach(test_name)
  119. # end test targets
  120. ####################
  121. ###########################
  122. # add headers to IDE
  123. if(0)
  124. file(GLOB include_files
  125. RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
  126. "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
  127. )
  128. add_custom_target(include SOURCES ${include_files})
  129. set_target_properties(include PROPERTIES FOLDER "tests")
  130. endif(0)
  131. # end headers in IDE
  132. ####################