| 
									
										
										
										
											2023-11-29 10:30:41 -08:00
										 |  |  | FetchContent_Declare( | 
					
						
							|  |  |  |   doctest
 | 
					
						
							|  |  |  |   GIT_REPOSITORY "https://github.com/onqtam/doctest"
 | 
					
						
							|  |  |  |   GIT_TAG "b7c21ec5ceeadb4951b00396fc1e4642dd347e5f"
 | 
					
						
							|  |  |  | )
 | 
					
						
							|  |  |  | FetchContent_MakeAvailable(doctest)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | add_executable(tests ${PROJECT_SOURCE_DIR}/tests/tests.cpp)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if (MLX_BUILD_METAL)
 | 
					
						
							|  |  |  |   set( | 
					
						
							|  |  |  |     METAL_TEST_SOURCES
 | 
					
						
							|  |  |  |     metal_tests.cpp
 | 
					
						
							|  |  |  |   )
 | 
					
						
							|  |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-26 09:27:31 -08:00
										 |  |  | target_sources(tests PRIVATE | 
					
						
							| 
									
										
										
										
											2023-11-29 10:30:41 -08:00
										 |  |  |   allocator_tests.cpp
 | 
					
						
							|  |  |  |   array_tests.cpp
 | 
					
						
							|  |  |  |   arg_reduce_tests.cpp
 | 
					
						
							|  |  |  |   autograd_tests.cpp
 | 
					
						
							|  |  |  |   blas_tests.cpp
 | 
					
						
							| 
									
										
										
										
											2024-01-26 13:45:30 -08:00
										 |  |  |   compile_tests.cpp
 | 
					
						
							| 
									
										
										
										
											2024-01-30 16:04:45 -08:00
										 |  |  |   custom_vjp_tests.cpp
 | 
					
						
							| 
									
										
										
										
											2023-11-29 10:30:41 -08:00
										 |  |  |   creations_tests.cpp
 | 
					
						
							|  |  |  |   device_tests.cpp
 | 
					
						
							|  |  |  |   eval_tests.cpp
 | 
					
						
							|  |  |  |   fft_tests.cpp
 | 
					
						
							|  |  |  |   load_tests.cpp
 | 
					
						
							|  |  |  |   ops_tests.cpp
 | 
					
						
							|  |  |  |   random_tests.cpp
 | 
					
						
							|  |  |  |   scheduler_tests.cpp
 | 
					
						
							|  |  |  |   utils_tests.cpp
 | 
					
						
							|  |  |  |   vmap_tests.cpp
 | 
					
						
							| 
									
										
										
										
											2023-12-27 04:42:04 +01:00
										 |  |  |   linalg_tests.cpp
 | 
					
						
							| 
									
										
										
										
											2023-11-29 10:30:41 -08:00
										 |  |  |   ${METAL_TEST_SOURCES}
 | 
					
						
							|  |  |  | )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | target_link_libraries(tests PRIVATE mlx doctest)
 | 
					
						
							|  |  |  | add_test(NAME tests COMMAND tests)
 |