-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename MessagesType-bound procs, various refactoring, improve docstri…
…ngs, add tests
- Loading branch information
Showing
5 changed files
with
172 additions
and
119 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module TestMessage | ||
use testdrive, only: error_type, unittest_type, new_unittest, check | ||
use MessageModule, only: MessagesType | ||
use ConstantsModule, only: LINELENGTH | ||
|
||
implicit none | ||
private | ||
public :: collect_message | ||
|
||
contains | ||
|
||
subroutine collect_message(testsuite) | ||
type(unittest_type), allocatable, intent(out) :: testsuite(:) | ||
testsuite = [ & | ||
new_unittest("init_and_count", test_init_and_count), & | ||
new_unittest("write_all", test_write_all) & | ||
] | ||
end subroutine collect_message | ||
|
||
subroutine test_init_and_count(error) | ||
type(error_type), allocatable, intent(out) :: error | ||
type(MessagesType) :: messages | ||
messages = MessagesType() | ||
call messages%init() | ||
call check(error, messages%count() == 0) | ||
end subroutine test_init | ||
|
||
subroutine test_write_all(error) | ||
type(error_type), allocatable, intent(out) :: error | ||
type(MessagesType) :: messages | ||
messages = MessagesType() | ||
call messages%init() | ||
call messages%store("1") | ||
call messages%store("2") | ||
! debug visually with e.g. `meson test --no-rebuild -C builddir --verbose Message` | ||
call messages%write_all() | ||
end subroutine test_write_all | ||
|
||
end module TestMessage |
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
Oops, something went wrong.