我有一個項目,使用水果進行測試(fortran代碼)。 這是我的代碼。Cmake水果測試
calculator.f90
module calculator
implicit none
contains
subroutine add (a, b, output)
integer, intent(in) :: a, b
integer, intent(out):: output
output = a+b
end subroutine add
end module calculator
而且我的測試calculator_test.f90
module calculator_test
use fruit
contains
subroutine test_5_2_2
use calculator, only: add
integer :: result
call add(2,2,result)
call assertEquals(4,result)
end subroutine test_5_2_2
subroutine test_5_2_3
use calculator, only: add
integer :: result
call add(2,3,result)
call assertEquals(5,result)
end subroutine test_5_2_3
end module
現在我想使用CMake的構建和運行我的測試(詹金斯觸發) ,所以我的問題是:我是否需要更改測試或者是否可以運行我通過cmake編寫的測試,如果是這樣的話? 我在網上搜索了很多,但所有與cmake測試似乎是用C++完成,然後通過使用可執行的測試文件文件。
謝謝! -Minde
我已經在下面回答了假設你已經知道CMake。如果沒有,請告訴我,我可以添加一些細節讓你開始。如果回答不夠清楚,請在您的問題中添加一些細節,以便更清楚您需要在CMake中執行哪些操作。 – SethMMorton