-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2276 from deslaughter/f/test-drive_unit_tests
Replace pFUnit with test-drive for running unit tests
- Loading branch information
Showing
57 changed files
with
6,222 additions
and
3,609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
program aerodyn_utest | ||
use, intrinsic :: iso_fortran_env, only: error_unit | ||
use testdrive, only: run_testsuite, new_testsuite, testsuite_type | ||
|
||
use test_AD_FVW, only: test_AD_FVW_suite | ||
use NWTC_Num | ||
|
||
implicit none | ||
integer :: stat, is, total_tests | ||
type(testsuite_type), allocatable :: testsuites(:) | ||
character(len=*), parameter :: fmt = '("#", *(1x, a))' | ||
|
||
stat = 0 | ||
|
||
call SetConstants() | ||
|
||
testsuites = [ & | ||
new_testsuite("FVW", test_AD_FVW_suite) & | ||
] | ||
|
||
total_tests = 0 | ||
do is = 1, size(testsuites) | ||
write (error_unit, fmt) "Testing:", testsuites(is)%name | ||
call run_testsuite(testsuites(is)%collect, error_unit, stat) | ||
end do | ||
|
||
if (stat > 0) then | ||
write (error_unit, '(i0, 1x, a)') stat, "test(s) failed!" | ||
error stop | ||
end if | ||
|
||
write (error_unit, fmt) "All tests PASSED" | ||
|
||
end program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
module test_AD_FVW | ||
|
||
use testdrive, only: new_unittest, unittest_type, error_type, check | ||
use NWTC_Num | ||
use FVW_Tests | ||
|
||
implicit none | ||
|
||
private | ||
public :: test_AD_FVW_suite | ||
|
||
contains | ||
|
||
!> Collect all exported unit tests | ||
subroutine test_AD_FVW_suite(testsuite) | ||
type(unittest_type), allocatable, intent(out) :: testsuite(:) | ||
testsuite = [new_unittest("test_AD_FVW_all", test_AD_FVW_all)] | ||
end subroutine | ||
|
||
subroutine test_AD_FVW_all(error) | ||
type(error_type), allocatable, intent(out) :: error | ||
! test branches | ||
! - known valid checks for various FVW routines (contained in own module) | ||
! - known invalid rotation matrix: halve the angle of the diagonal elements | ||
|
||
integer(IntKi) :: ErrStat | ||
character(ErrMsgLen) :: ErrMsg | ||
character(1024) :: testname | ||
|
||
! initialize NWTC_Num constants | ||
call SetConstants() | ||
|
||
! This is a single routine that contains the test cases below. | ||
! -------------------------------------------------------------------------- | ||
testname = "Set of FVW tests" | ||
call FVW_RunTests(ErrStat, ErrMsg) | ||
call check(error, ErrID_None, ErrStat); if (allocated(error)) return | ||
|
||
! test routines from FVW_RunTests to be run individually -- except these are all private | ||
! ! -------------------------------------------------------------------------- | ||
! testname = "known valid Biot-Savart segment" | ||
! call Test_BiotSavart_Sgmt(testname, ErrStat, ErrMsg) | ||
! call check(error, 0, ErrStat); if (allocated(error)) return | ||
! | ||
! ! -------------------------------------------------------------------------- | ||
! testname = "known valid Biot-Savart part" | ||
! call Test_BiotSavart_Part(testname, ErrStat, ErrMsg) | ||
! call check(error, 0, ErrStat); if (allocated(error)) return | ||
! | ||
! ! -------------------------------------------------------------------------- | ||
! testname = "known valid Biot-Savart to part-tree" | ||
! call Test_BiotSavart_PartTree(testname, ErrStat, ErrMsg) | ||
! call check(error, 0, ErrStat); if (allocated(error)) return | ||
! | ||
! ! -------------------------------------------------------------------------- | ||
! testname = "known valid segment split to parts" | ||
! call Test_SegmentsToPart(testname, ErrStat, ErrMsg) | ||
! call check(error, 0, ErrStat); if (allocated(error)) return | ||
|
||
end subroutine | ||
|
||
end module |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
program beamdyn_utest | ||
use, intrinsic :: iso_fortran_env, only: error_unit | ||
use testdrive, only: run_testsuite, new_testsuite, testsuite_type | ||
|
||
use test_BD_Crv, only: test_BD_Crv_suite | ||
use test_BD_diffmtc, only: test_BD_diffmtc_suite | ||
use test_BD_InitializeNodalLocations, only: test_BD_InitializeNodalLocations_suite | ||
use test_BD_MemberEta, only: test_BD_MemberEta_suite | ||
use test_BD_Misc, only: test_BD_Misc_suite | ||
use test_BD_QuadraturePointData, only: test_BD_QuadraturePointData_suite | ||
use test_BD_ShapeFuncs, only: test_BD_ShapeFuncs_suite | ||
use test_BD_TrapezoidalPointWeight, only: test_BD_TrapezoidalPointWeight_suite | ||
use NWTC_Num | ||
|
||
implicit none | ||
integer :: stat, is | ||
type(testsuite_type), allocatable :: testsuites(:) | ||
character(len=*), parameter :: fmt = '("#", *(1x, a))' | ||
|
||
stat = 0 | ||
|
||
call SetConstants() | ||
|
||
testsuites = [ & | ||
new_testsuite("Crv", test_BD_Crv_suite), & | ||
new_testsuite("diffmtc", test_BD_diffmtc_suite), & | ||
new_testsuite("InitializeNodalLocations", test_BD_InitializeNodalLocations_suite), & | ||
new_testsuite("MemberEta", test_BD_MemberEta_suite), & | ||
new_testsuite("Misc", test_BD_Misc_suite), & | ||
new_testsuite("QuadraturePointData", test_BD_QuadraturePointData_suite), & | ||
new_testsuite("ShapeFuncs", test_BD_ShapeFuncs_suite), & | ||
new_testsuite("TrapezoidalPointWeight", test_BD_TrapezoidalPointWeight_suite) & | ||
] | ||
|
||
do is = 1, size(testsuites) | ||
write (error_unit, fmt) "Testing:", testsuites(is)%name | ||
call run_testsuite(testsuites(is)%collect, error_unit, stat) | ||
end do | ||
|
||
if (stat > 0) then | ||
write (error_unit, '(i0, 1x, a)') stat, "test(s) failed!" | ||
error stop | ||
end if | ||
|
||
write (error_unit, fmt) "All tests PASSED" | ||
|
||
end program | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.