Skip to content

Commit

Permalink
update the tests in cmake file
Browse files Browse the repository at this point in the history
  • Loading branch information
Apostolos Chalkis committed Jul 1, 2024
1 parent e95547b commit 563e834
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 415 deletions.
185 changes: 183 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,109 @@ add_definitions(${CMAKE_CXX_FLAGS} "-DMKL_ILP64")
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgslcblas")
#add_definitions( "-O3 -lgsl -lm -ldl -lgslcblas" )

add_executable (new_volume_example new_volume_example.cpp)
add_executable (benchmarks_sob benchmarks_sob.cpp)
add_executable (benchmarks_cg benchmarks_cg.cpp)
add_executable (benchmarks_cb benchmarks_cb.cpp)

add_library(test_main OBJECT test_main.cpp)

add_executable (mcmc_diagnostics_test mcmc_diagnostics_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME test_psrf COMMAND mcmc_diagnostics_test -tc=psrf)
add_test(NAME test_univariate_psrf COMMAND mcmc_diagnostics_test -tc=univariate_psrf)
add_test(NAME test_interval_psrf COMMAND mcmc_diagnostics_test -tc=interval_psrf)
add_test(NAME test_ess COMMAND mcmc_diagnostics_test -tc=ess)
add_test(NAME test_geweke COMMAND mcmc_diagnostics_test -tc=geweke)
add_test(NAME test_raftery COMMAND mcmc_diagnostics_test -tc=raftery)

add_executable (sampling_test sampling_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME test_dikin COMMAND sampling_test -tc=dikin)
add_test(NAME test_john COMMAND sampling_test -tc=john)
add_test(NAME test_vaidya COMMAND sampling_test -tc=vaidya)
add_test(NAME test_brdhr COMMAND sampling_test -tc=brdhr)
add_test(NAME test_bcdhr COMMAND sampling_test -tc=bcdhr)
add_test(NAME test_grdhr COMMAND sampling_test -tc=grdhr)
add_test(NAME test_gbaw COMMAND sampling_test -tc=gbaw)
add_test(NAME test_ghmc COMMAND sampling_test -tc=ghmc)

add_executable (mmcs_test mmcs_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME test_mmcs COMMAND mmcs_test -tc=mmcs)

add_executable (ode_solvers_test ode_solvers_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME ode_solvers_test_first_order
COMMAND ode_solvers_test -tc=first_order)
add_test(NAME ode_solvers_test_second_order
COMMAND ode_solvers_test -tc=second_order)

add_executable (root_finders_test root_finders_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME root_finders_test_root_finders
COMMAND root_finders_test -tc=root_finders)

#add_executable (benchmarks_crhmc benchmarks_crhmc.cpp )
#add_executable (benchmarks_crhmc_sampling benchmarks_crhmc_sampling.cpp )

add_executable (crhmc_polytope_preparation_test crhmc_polytope_preparation_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME crhmc_polytope_test_preparation
COMMAND crhmc_polytope_preparation_test -tc=test_preparation_crhmc)
add_test(NAME crhmc_test_fixed_vars
COMMAND crhmc_polytope_preparation_test -tc=test_fixed_vars_crhmc)
add_test(NAME crhmc_test_dep_vars
COMMAND crhmc_polytope_preparation_test -tc=test_dep_vars_crhmc)
add_test(NAME crhmc_test_center_computation
COMMAND crhmc_polytope_preparation_test -tc=test_center_computation)

add_executable (boundary_oracles_test boundary_oracles_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME boundary_oracles_test_h_poly_oracles
COMMAND boundary_oracles_test -tc=h_poly_oracles)

add_executable (volume_sob_hpolytope volume_sob_hpolytope.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME volume_sob_hpolytope_cube COMMAND volume_sob_hpolytope -tc=cube)
add_test(NAME volume_sob_hpolytope_cross COMMAND volume_sob_hpolytope -tc=cross)
add_test(NAME volume_sob_hpolytope_birkhoff COMMAND volume_sob_hpolytope -tc=birk)
add_test(NAME volume_sob_hpolytope_prod_simplex COMMAND volume_sob_hpolytope -tc=prod_simplex)
add_test(NAME volume_sob_hpolytope_simplex COMMAND volume_sob_hpolytope -tc=simplex)
add_test(NAME volume_sob_hpolytope_skinny_cube COMMAND volume_sob_hpolytope -tc=skinny_cube)
add_test(NAME volume_sob_hpolytope_cube_overflow COMMAND volume_sob_hpolytope -tc=cube_overflow)
set_property(TEST volume_sob_hpolytope_cube_overflow PROPERTY TIMEOUT 1)

add_executable (volume_sob_vpolytope volume_sob_vpolytope.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME volume_sob_vpolytope_cube COMMAND volume_sob_vpolytope -tc=cube)
add_test(NAME volume_sob_vpolytope_cross COMMAND volume_sob_vpolytope -tc=cross)
add_test(NAME volume_sob_vpolytope_simplex COMMAND volume_sob_vpolytope -tc=simplex)

add_executable (volume_cg_hpolytope volume_cg_hpolytope.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME volume_cg_hpolytope_cube COMMAND volume_cg_hpolytope -tc=cube)
add_test(NAME volume_cg_hpolytope_cross COMMAND volume_cg_hpolytope -tc=cross)
add_test(NAME volume_cg_hpolytope_birkhoff COMMAND volume_cg_hpolytope -tc=birk)
add_test(NAME volume_cg_hpolytope_prod_simplex COMMAND volume_cg_hpolytope -tc=prod_simplex)
add_test(NAME volume_cg_hpolytope_simplex COMMAND volume_cg_hpolytope -tc=simplex)
add_test(NAME volume_cg_hpolytope_skinny_cube COMMAND volume_cg_hpolytope -tc=skinny_cube)

add_executable (volume_cg_vpolytope volume_cg_vpolytope.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME volume_cg_vpolytope_cube COMMAND volume_cg_vpolytope -tc=cube)
add_test(NAME volume_cg_vpolytope_cross COMMAND volume_cg_vpolytope -tc=cross)
add_test(NAME volume_cg_vpolytope_simplex COMMAND volume_cg_vpolytope -tc=simplex)

add_executable (volume_cb_hpolytope volume_cb_hpolytope.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME volume_cb_hpolytope_cube COMMAND volume_cb_hpolytope -tc=cube)
add_test(NAME volume_cb_hpolytope_cross COMMAND volume_cb_hpolytope -tc=cross)
add_test(NAME volume_cb_hpolytope_birkhoff COMMAND volume_cb_hpolytope -tc=birk)
add_test(NAME volume_cb_hpolytope_prod_simplex COMMAND volume_cb_hpolytope -tc=prod_simplex)
add_test(NAME volume_cb_hpolytope_simplex COMMAND volume_cb_hpolytope -tc=simplex)
add_test(NAME volume_cb_hpolytope_skinny_cube COMMAND volume_cb_hpolytope -tc=skinny_cube)

add_executable (volume_cb_vpolytope volume_cb_vpolytope.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME volume_cb_vpolytope_cube COMMAND volume_cb_vpolytope -tc=cube)
add_test(NAME volume_cb_vpolytope_cross COMMAND volume_cb_vpolytope -tc=cross)
add_test(NAME volume_cb_vpolytope_simplex COMMAND volume_cb_vpolytope -tc=simplex)

add_executable (volume_cb_zonotopes volume_cb_zonotopes.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME volume_cb_zonotopes_uniform_zonotopes
COMMAND volume_cb_zonotopes -tc=uniform_zonotopes)

add_executable (volume_cb_vpoly_intersection_vpoly volume_cb_vpoly_intersection_vpoly.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME volume_cb_vpoly_intersection_vpoly_random_vpoly_sphere
COMMAND volume_cb_vpoly_intersection_vpoly -tc=random_vpoly_sphere)

add_executable (rounding_test rounding_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME test_round_min_ellipsoid
Expand All @@ -207,6 +307,56 @@ add_test(NAME round_vaidya_barrier_test



add_executable (logconcave_sampling_test logconcave_sampling_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME logconcave_sampling_test_hmc
COMMAND logconcave_sampling_test -tc=hmc)
add_test(NAME logconcave_sampling_test_uld
COMMAND logconcave_sampling_test -tc=uld)
add_test(NAME logconcave_sampling_test_exponential_biomass_sampling
COMMAND logconcave_sampling_test -tc=exponential_biomass_sampling)
add_test(NAME logconcave_sampling_test_nuts_hmc_truncated
COMMAND logconcave_sampling_test -tc=benchmark_nuts_hmc_truncated)
add_test(NAME logconcave_sampling_test_nuts_hmc
COMMAND logconcave_sampling_test -tc=benchmark_nuts_hmc)


add_executable (crhmc_sampling_test crhmc_sampling_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME crhmc_sampling_test_crhmc
COMMAND crhmc_sampling_test -tc=crhmc)
add_test(NAME crhmc_test_polytope_sampling
COMMAND crhmc_sampling_test -tc=test_polytope_sampling_crhmc)
add_test(NAME crhmc_test_sparse_sampling
COMMAND crhmc_sampling_test -tc=test_sampling_sparse_problem)
add_executable (simple_mc_integration simple_mc_integration.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME simple_mc_integration_over_limits
COMMAND simple_mc_integration -tc=rectangle)
add_test(NAME simple_mc_integration_over_cubes
COMMAND simple_mc_integration -tc=cube)
add_test(NAME simple_mc_integration_over_simplices
COMMAND simple_mc_integration -tc=simplex)
add_test(NAME simple_mc_integration_over_product_simplices
COMMAND simple_mc_integration -tc=prod_simplex)
add_test(NAME simple_mc_integration_over_cross_polytopes
COMMAND simple_mc_integration -tc=cross)
add_test(NAME simple_mc_integration_over_birkhoff_polytopes
COMMAND simple_mc_integration -tc=birkhoff)

add_executable (order_polytope order_polytope.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME order_polytope_basics COMMAND order_polytope -tc=basics)
add_test(NAME order_polytope_line_intersect COMMAND order_polytope -tc=line_intersect)
add_test(NAME order_polytope_reflection COMMAND order_polytope -tc=reflection)
add_test(NAME order_polytope_vec_mult COMMAND order_polytope -tc=vec_mult)

add_executable (matrix_sampling_test sampling_correlation_matrices_test.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME test_corre_spectra_classes COMMAND matrix_sampling_test -tc=corre_spectra)
add_test(NAME test_new_ball_uniform COMMAND matrix_sampling_test -tc=new_ball_uniform)
add_test(NAME test_new_billiard_uniform COMMAND matrix_sampling_test -tc=new_billiard_uniform)
add_test(NAME test_new_accelerated_billiard_uniform COMMAND matrix_sampling_test -tc=new_accelerated_billiard_uniform)
add_test(NAME test_new_ball_uniform_MT COMMAND matrix_sampling_test -tc=new_ball_uniform_MT)
add_test(NAME test_new_rdhr_uniform_MT COMMAND matrix_sampling_test -tc=new_rdhr_uniform_MT)
add_test(NAME test_new_billiard_uniform_MT COMMAND matrix_sampling_test -tc=new_billiard_uniform_MT)
add_test(NAME test_new_accelerated_billiard_uniform_MT COMMAND matrix_sampling_test -tc=new_accelerated_billiard_uniform_MT)

add_executable (test_internal_points test_internal_points.cpp $<TARGET_OBJECTS:test_main>)
add_test(NAME test_max_ball
COMMAND test_internal_points -tc=test_max_ball)
Expand All @@ -220,7 +370,6 @@ add_test(NAME test_volumetric_center
COMMAND test_internal_points -tc=test_volumetric_center)
add_test(NAME test_vaidya_center
COMMAND test_internal_points -tc=test_vaidya_center)



set(ADDITIONAL_FLAGS "-march=native -DSIMD_LEN=0 -DTIME_KEEPING")
Expand All @@ -229,6 +378,38 @@ set(ADDITIONAL_FLAGS "-march=native -DSIMD_LEN=0 -DTIME_KEEPING")
# PROPERTIES COMPILE_FLAGS ${ADDITIONAL_FLAGS})
#set_target_properties(benchmarks_crhmc_sampling
# PROPERTIES COMPILE_FLAGS ${ADDITIONAL_FLAGS})

set_target_properties(crhmc_polytope_preparation_test
PROPERTIES COMPILE_FLAGS ${ADDITIONAL_FLAGS})
set_target_properties(crhmc_sampling_test
PROPERTIES COMPILE_FLAGS ${ADDITIONAL_FLAGS})

TARGET_LINK_LIBRARIES(new_volume_example lp_solve ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(new_volume_example lp_solve coverage_config)
TARGET_LINK_LIBRARIES(volume_sob_hpolytope lp_solve coverage_config)
TARGET_LINK_LIBRARIES(volume_sob_vpolytope lp_solve coverage_config)
TARGET_LINK_LIBRARIES(volume_cg_hpolytope lp_solve coverage_config)
TARGET_LINK_LIBRARIES(volume_cg_vpolytope lp_solve coverage_config)
TARGET_LINK_LIBRARIES(volume_cb_hpolytope lp_solve coverage_config)
TARGET_LINK_LIBRARIES(volume_cb_vpolytope lp_solve coverage_config)
TARGET_LINK_LIBRARIES(volume_cb_zonotopes lp_solve coverage_config)
TARGET_LINK_LIBRARIES(volume_cb_vpoly_intersection_vpoly lp_solve coverage_config)
TARGET_LINK_LIBRARIES(volume_cb_vpoly_intersection_vpoly lp_solve ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(rounding_test lp_solve ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(mcmc_diagnostics_test lp_solve ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(sampling_test lp_solve ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(mmcs_test lp_solve ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(benchmarks_sob lp_solve ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(benchmarks_cg lp_solve ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(benchmarks_cb lp_solve ${MKL_LINK} coverage_config)
#TARGET_LINK_LIBRARIES(benchmarks_crhmc_sampling lp_solve ${MKL_LINK} QD_LIB coverage_config)
#TARGET_LINK_LIBRARIES(benchmarks_crhmc lp_solve ${MKL_LINK} QD_LIB coverage_config)
TARGET_LINK_LIBRARIES(simple_mc_integration lp_solve ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(ode_solvers_test lp_solve ${IFOPT} ${IFOPT_IPOPT} ${PTHREAD} ${GMP} ${MPSOLVE} ${FFTW3} ${MKL_LINK} QD_LIB coverage_config)
TARGET_LINK_LIBRARIES(boundary_oracles_test lp_solve ${IFOPT} ${IFOPT_IPOPT} ${PTHREAD} ${GMP} ${MPSOLVE} ${FFTW3} ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(root_finders_test ${PTHREAD} ${GMP} ${MPSOLVE} ${FFTW3} ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(crhmc_polytope_preparation_test ${PTHREAD} ${GMP} ${MPSOLVE} ${FFTW3} ${MKL_LINK} QD_LIB coverage_config)
TARGET_LINK_LIBRARIES(logconcave_sampling_test lp_solve ${IFOPT} ${IFOPT_IPOPT} ${PTHREAD} ${GMP} ${MPSOLVE} ${FFTW3} ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(crhmc_sampling_test lp_solve ${IFOPT} ${IFOPT_IPOPT} ${PTHREAD} ${GMP} ${MPSOLVE} ${FFTW3} ${MKL_LINK} QD_LIB coverage_config)
TARGET_LINK_LIBRARIES(order_polytope lp_solve coverage_config)
TARGET_LINK_LIBRARIES(matrix_sampling_test lp_solve ${MKL_LINK} coverage_config)
TARGET_LINK_LIBRARIES(test_internal_points lp_solve ${MKL_LINK} coverage_config)
Loading

0 comments on commit 563e834

Please sign in to comment.