Commit 84dd8ef 1 parent c983429 commit 84dd8ef Copy full SHA for 84dd8ef
File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ install(FILES "${CMAKE_BINARY_DIR}/modules/ftorch.mod"
84
84
85
85
# Build integration tests
86
86
if (CMAKE_BUILD_TESTS)
87
+ # Unit tests
88
+ add_subdirectory (test /unit)
89
+ # Integration tests
87
90
file (MAKE_DIRECTORY test /examples)
88
91
file (COPY ${CMAKE_CURRENT_SOURCE_DIR} /../examples/CMakeLists.txt
89
92
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} /test /examples
Original file line number Diff line number Diff line change
1
+ find_package (FTorch)
2
+ find_package (MPI REQUIRED)
3
+ message (STATUS "Building with Fortran PyTorch coupling" )
4
+
5
+ # Include PFUNIT directories
6
+ include_directories (${PFUNIT} /include )
7
+
8
+ set (pf_tests
9
+ test_constructors.pf)
10
+
11
+ add_pfunit_tests(new_tests ${pf_tests} )
12
+ add_library (new_pftests EXCLUDE_FROM_ALL ${pf_tests} )
13
+ target_link_libraries (new_ptests PRIVATE FTorch::ftorch MPI::MPI_Fortran ${PFUNIT} /lib/libpfunit.a)
14
+
15
+
16
+ # Integration testing
17
+ if (CMAKE_BUILD_TESTS)
18
+ include (CTest)
19
+ add_test (NAME constructors COMMAND constructors WORKING_DIRECTORY ${PROJECT_BINARY_DIR} )
20
+ endif ()
You can’t perform that action at this time.
0 commit comments