-
Notifications
You must be signed in to change notification settings - Fork 8
Add Fortuno unit testing #704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,28 @@ | ||
| ! CSIRO Open Source Software License Agreement (variation of the BSD / MIT License) | ||
| ! Copyright (c) 2015, Commonwealth Scientific and Industrial Research Organisation | ||
| ! (CSIRO) ABN 41 687 119 230. | ||
|
|
||
| module test_example_mod | ||
| use fortuno_interface_mod, only: test_list_t | ||
| use fortuno_interface_mod, only: test_case | ||
| use fortuno_interface_mod, only: check | ||
| implicit none | ||
| private | ||
|
|
||
| public :: test_example | ||
|
|
||
| contains | ||
|
|
||
| function test_example() result(example_tests) | ||
| type(test_list_t) :: example_tests | ||
| example_tests = test_list_t([ & | ||
| test_case("example", example) & | ||
| ]) | ||
| end function test_example | ||
|
|
||
| subroutine example() | ||
| !! Example test. | ||
| call check(1 /= 2, msg="1 should not equal 2") | ||
| end subroutine example | ||
|
|
||
| end module |
This file contains hidden or 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,16 @@ | ||
| ! CSIRO Open Source Software License Agreement (variation of the BSD / MIT License) | ||
| ! Copyright (c) 2015, Commonwealth Scientific and Industrial Research Organisation | ||
| ! (CSIRO) ABN 41 687 119 230. | ||
|
|
||
| !> Entry point for running Fortuno tests. | ||
| program testapp | ||
| use fortuno_interface_mod, only: execute_cmd_app | ||
| use fortuno_interface_mod, only: test_list => test_list_t | ||
| use test_example_mod, only: test_example | ||
| implicit none | ||
|
|
||
| call execute_cmd_app(test_list([ & | ||
| test_example() & | ||
| ])) | ||
|
|
||
| end program testapp |
This file contains hidden or 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,33 @@ | ||
| ! Copyright (C) 2024 Alex Buccheri | ||
| ! | ||
| ! This Source Code Form is subject to the terms of the Mozilla Public | ||
| ! License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| ! file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
|
||
| module fortuno_interface_mod | ||
| !! Expose Fortuno MPI data types and routines through common aliases. | ||
|
|
||
| use fortuno_mpi, only: test_case_t => mpi_case_base | ||
| use fortuno_mpi, only: test_item_t => test_item | ||
| use fortuno_mpi, only: test_list_t => test_list | ||
|
|
||
| use fortuno_mpi, only: execute_cmd_app => execute_mpi_cmd_app | ||
| use fortuno_mpi, only: test_suite => mpi_suite_item | ||
| use fortuno_mpi, only: test_case => mpi_case_item | ||
|
|
||
| use fortuno_mpi, only: check => mpi_check | ||
| use fortuno_mpi, only: check_failed => mpi_check_failed | ||
| use fortuno_mpi, only: skip => mpi_skip | ||
| use fortuno_mpi, only: is_equal | ||
| use fortuno_mpi, only: all_equal | ||
| use fortuno_mpi, only: all_close | ||
|
|
||
| use fortuno_mpi, only: global_comm | ||
| use fortuno_mpi, only: num_ranks | ||
| use fortuno_mpi, only: this_rank | ||
|
|
||
| implicit none | ||
|
|
||
| ! Scope is deliberately public | ||
|
|
||
| end module fortuno_interface_mod | ||
This file contains hidden or 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 @@ | ||
| ! Copyright (C) 2024 Alex Buccheri | ||
| ! | ||
| ! This Source Code Form is subject to the terms of the Mozilla Public | ||
| ! License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| ! file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
|
||
| module fortuno_interface_mod | ||
| !! Expose Fortuno serial data types and routines through common aliases. | ||
|
|
||
| use fortuno_serial, only: test_case_t => serial_case_base | ||
| use fortuno_serial, only: test_item_t => test_item | ||
| use fortuno_serial, only: test_list_t => test_list | ||
|
abhaasgoyal marked this conversation as resolved.
|
||
|
|
||
| use fortuno_serial, only: execute_cmd_app => execute_serial_cmd_app | ||
| use fortuno_serial, only: test_suite => serial_suite_item | ||
| use fortuno_serial, only: test_case => serial_case_item | ||
|
|
||
| use fortuno_serial, only: check => serial_check | ||
| use fortuno_serial, only: check_failed => serial_check_failed | ||
| use fortuno_serial, only: skip => serial_skip | ||
| use fortuno_serial, only: is_equal | ||
| use fortuno_serial, only: all_equal | ||
| use fortuno_serial, only: all_close | ||
|
|
||
| implicit none | ||
|
|
||
| ! Scope is deliberately public | ||
|
|
||
| contains | ||
|
|
||
| function global_comm() | ||
| !! Serial stub for global_comm function. | ||
| use cable_mpi_stub_types_mod, only: MPI_COMM, MPI_COMM_NULL | ||
| type(MPI_COMM) global_comm | ||
| global_comm = MPI_COMM_NULL | ||
| end function | ||
|
|
||
| integer function num_ranks() | ||
| !! Serial stub for num_ranks function. | ||
| num_ranks = 1 | ||
| end function | ||
|
|
||
| integer function this_rank() | ||
| !! Serial stub for this_rank function. | ||
| this_rank = 0 | ||
| end function | ||
|
|
||
| end module fortuno_interface_mod | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.