]> www.ginac.de Git - cln.git/blob - tests/CMakeLists.txt
cmake build: moved cl_config.h.cmake to `autoconf`
[cln.git] / tests / CMakeLists.txt
1
2 set(cln_tests exam tests)
3
4 set(exam_SOURCES
5         exam.h exam.cc
6         exam_I.cc exam_I_plus.cc exam_I_minus.cc exam_I_mul.cc
7         exam_I_div.cc exam_I_floor.cc
8         exam_RA.cc exam_RA_plus.cc exam_RA_minus.cc exam_RA_mul.cc
9         exam_RA_div.cc exam_RA_floor.cc
10         exam_SF.cc exam_SF_plus.cc exam_SF_minus.cc exam_SF_mul.cc
11         exam_SF_div.cc exam_SF_floor.cc
12         exam_FF.cc exam_FF_plus.cc exam_FF_minus.cc exam_FF_mul.cc
13         exam_FF_div.cc exam_FF_floor.cc
14         exam_DF.cc exam_DF_plus.cc exam_DF_minus.cc exam_DF_mul.cc
15         exam_DF_div.cc exam_DF_floor.cc
16         exam_LF.cc exam_LF_plus.cc exam_LF_minus.cc exam_LF_mul.cc
17         exam_LF_div.cc exam_LF_floor.cc
18         exam_I_factorial.cc
19         exam_I_gcd.cc exam_I_sqrtp.cc test_MI.h test.h
20 )
21
22 set(tests_SOURCES
23         test.h tests.cc test_I.cc test_I.h test_I_abs.cc test_I_compare.cc
24         test_I_plus.cc test_I_minus.cc test_I_plus1.cc
25         test_I_minus1.cc test_I_mul.cc test_I_div.cc
26         test_I_gcd.cc test_I_xgcd.cc test_I_ash.cc
27         test_I_evenp.cc test_I_oddp.cc test_I_lognot.cc
28         test_I_logand.cc test_I_logandc1.cc test_I_logandc2.cc
29         test_I_logior.cc test_I_logorc1.cc test_I_logorc2.cc
30         test_I_logxor.cc test_I_lognand.cc test_I_lognor.cc
31         test_I_logeqv.cc test_I_boole.cc test_I_logbitp.cc
32         test_I_logtest.cc test_I_ldb.cc test_I_ldbtest.cc
33         test_I_mkf.cc test_I_dpb.cc test_I_dpf.cc
34         test_I_logcount.cc test_I_ilength.cc test_I_ord2.cc
35         test_I_power2p.cc test_I_isqrt.cc test_I_sqrtp.cc
36         test_I_io.cc test_I_GV.cc
37         test_MI.h test_MI.cc test_MI_canonhom.cc test_MI_plus.cc
38         test_MI_minus.cc test_MI_mul.cc test_MI_recip.cc
39         test_MI_div.cc test_MI_expt.cc
40         test_nt.h test_nt.cc test_nt_jacobi.cc)
41         
42 macro(add_cln_test thename)
43         if ("${${thename}_SOURCES}" STREQUAL "")
44                 set(${thename}_sources ${thename}.cc ${${thename}_extra_src})
45         endif()
46         add_executable(${thename} EXCLUDE_FROM_ALL ${${thename}_SOURCES})
47         target_link_libraries(${thename} cln::cln)
48         target_include_directories(${thename}
49                 PRIVATE
50                 ${CMAKE_CURRENT_SOURCE_DIR}/../src
51                 ${CMAKE_CURRENT_BINARY_DIR}/../src
52                 ${CMAKE_CURRENT_BINARY_DIR}/../autoconf
53         )
54         add_dependencies(test_suite ${thename})
55         add_dependencies(check ${thename})
56         add_test(NAME ${thename} COMMAND $<TARGET_FILE:${thename}>)
57 endmacro()
58
59 foreach(tst ${cln_tests})
60         add_cln_test(${tst})
61 endforeach()
62