-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(logging): consolidate logging routines in Message.f90 (#1489)
* move routines from GenericUtilities/SimModule to MessageModule * pull logging level conditionals into simulation context where necessary * rename MessageType -> MessagesType, procedure naming, docstrings * remove name/title members from MessagesType (unused) * fix docstrings in Sim.f90 and other files * add minimal tests
- Loading branch information
Showing
31 changed files
with
673 additions
and
792 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,41 @@ | ||
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("store_count_and_write_all", & | ||
test_store_count_and_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_and_count | ||
|
||
subroutine test_store_count_and_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") | ||
call check(error, messages%count() == 2) | ||
! debug visually with e.g. `meson test --no-rebuild -C builddir --verbose Message` | ||
call messages%write_all() | ||
end subroutine test_store_count_and_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
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
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
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
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.