mirror of
https://github.com/ml-explore/mlx.git
synced 2025-10-28 22:28:11 +08:00
Chore: add pre-commit hook for cmake (#1362)
* reset and lint * format --------- Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
@@ -1,43 +1,39 @@
|
||||
FetchContent_Declare(
|
||||
doctest
|
||||
GIT_REPOSITORY "https://github.com/onqtam/doctest"
|
||||
GIT_TAG "ae7a13539fb71f270b87eb2e874fbac80bc8dda2"
|
||||
)
|
||||
GIT_TAG "ae7a13539fb71f270b87eb2e874fbac80bc8dda2")
|
||||
FetchContent_MakeAvailable(doctest)
|
||||
|
||||
add_executable(tests ${PROJECT_SOURCE_DIR}/tests/tests.cpp)
|
||||
|
||||
if (MLX_BUILD_METAL)
|
||||
set(
|
||||
METAL_TEST_SOURCES
|
||||
metal_tests.cpp
|
||||
)
|
||||
if(MLX_BUILD_METAL)
|
||||
set(METAL_TEST_SOURCES metal_tests.cpp)
|
||||
endif()
|
||||
|
||||
include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake)
|
||||
|
||||
target_sources(tests PRIVATE
|
||||
allocator_tests.cpp
|
||||
array_tests.cpp
|
||||
arg_reduce_tests.cpp
|
||||
autograd_tests.cpp
|
||||
blas_tests.cpp
|
||||
compile_tests.cpp
|
||||
custom_vjp_tests.cpp
|
||||
creations_tests.cpp
|
||||
device_tests.cpp
|
||||
einsum_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
|
||||
linalg_tests.cpp
|
||||
${METAL_TEST_SOURCES}
|
||||
)
|
||||
target_sources(
|
||||
tests
|
||||
PRIVATE allocator_tests.cpp
|
||||
array_tests.cpp
|
||||
arg_reduce_tests.cpp
|
||||
autograd_tests.cpp
|
||||
blas_tests.cpp
|
||||
compile_tests.cpp
|
||||
custom_vjp_tests.cpp
|
||||
creations_tests.cpp
|
||||
device_tests.cpp
|
||||
einsum_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
|
||||
linalg_tests.cpp
|
||||
${METAL_TEST_SOURCES})
|
||||
|
||||
target_link_libraries(tests PRIVATE mlx doctest)
|
||||
doctest_discover_tests(tests)
|
||||
|
||||
Reference in New Issue
Block a user