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