Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cmake-single-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
working-directory: ${{github.workspace}}/build/test
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}
Expand Down
49 changes: 1 addition & 48 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,11 @@ add_library(cmatrix STATIC src/sparse.c
src/dense.c
include/sparse.h
include/dense.h
test/dense_mread/test_mread.c
)
target_include_directories(cmatrix PUBLIC include)

# Enable testing
enable_testing()
add_subdirectory(test)

# Test executable for mread
add_executable(test_sparse_mread test/sparse_mread/test_mread.c)
target_link_libraries(test_sparse_mread PRIVATE cmatrix)
target_include_directories(test_sparse_mread PRIVATE include)

configure_file(
${CMAKE_SOURCE_DIR}/test/sparse_mread/mread_input_0.txt
${CMAKE_BINARY_DIR}/sparse_mread_input_0.txt
COPYONLY
)

configure_file(
${CMAKE_SOURCE_DIR}/test/sparse_mread/mread_input_1.txt
${CMAKE_BINARY_DIR}/sparse_mread_input_1.txt
COPYONLY
)

configure_file(
${CMAKE_SOURCE_DIR}/test/sparse_mread/mread_input_2.txt
${CMAKE_BINARY_DIR}/sparse_mread_input_2.txt
COPYONLY
)

add_test(NAME test_sparse_mread COMMAND test_sparse_mread)

add_executable(test_dense_mread test/dense_mread/test_mread.c)
target_link_libraries(test_dense_mread PRIVATE cmatrix)
target_include_directories(test_dense_mread PRIVATE include)

configure_file(
${CMAKE_SOURCE_DIR}/test/dense_mread/mread_input_0.txt;
${CMAKE_BINARY_DIR}/dense_mread_input_0.txt
COPYONLY
)

configure_file(
${CMAKE_SOURCE_DIR}/test/dense_mread/mread_input_1.txt;
${CMAKE_BINARY_DIR}/dense_mread_input_1.txt
COPYONLY
)

configure_file(
${CMAKE_SOURCE_DIR}/test/dense_mread/mread_input_2.txt;
${CMAKE_BINARY_DIR}/dense_mread_input_2.txt
COPYONLY
)

add_test(NAME test_dense_mread COMMAND test_dense_mread)
5 changes: 5 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enable_testing()

add_subdirectory(dense_mread)

add_subdirectory(sparse_mread)
24 changes: 24 additions & 0 deletions test/dense_mread/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Test executable for mread
add_executable(test_dense_mread test_mread.c)
target_link_libraries(test_dense_mread PRIVATE cmatrix)
target_include_directories(test_dense_mread PRIVATE ${CMAKE_SOURCE_DIR}/include)

configure_file(
mread_input_0.txt
dense_mread_input_0.txt
COPYONLY
)

configure_file(
mread_input_1.txt
dense_mread_input_1.txt
COPYONLY
)

configure_file(
mread_input_2.txt
dense_mread_input_2.txt
COPYONLY
)

add_test(NAME test_dense_mread COMMAND test_dense_mread)
24 changes: 24 additions & 0 deletions test/sparse_mread/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Test executable for mread
add_executable(test_sparse_mread test_mread.c)
target_link_libraries(test_sparse_mread PRIVATE cmatrix)
target_include_directories(test_sparse_mread PRIVATE ${CMAKE_SOURCE_DIR}/include)

configure_file(
mread_input_0.txt
sparse_mread_input_0.txt
COPYONLY
)

configure_file(
mread_input_1.txt
sparse_mread_input_1.txt
COPYONLY
)

configure_file(
mread_input_2.txt
sparse_mread_input_2.txt
COPYONLY
)

add_test(NAME test_sparse_mread COMMAND test_sparse_mread)