All Projects → dongli → fortran-unit-test

dongli / fortran-unit-test

Licence: MIT License
Another Fortran unit test library

Programming Languages

fortran
972 projects
CMake
9771 projects

Projects that are alternatives of or similar to fortran-unit-test

test-drive
The simple testing framework
Stars: ✭ 37 (+94.74%)
Mutual labels:  unit-testing, fortran-library
react-testing-talk
No description or website provided.
Stars: ✭ 12 (-36.84%)
Mutual labels:  unit-testing
angular-karma test-explorer
vscode extension for easy angular testing and debugging
Stars: ✭ 67 (+252.63%)
Mutual labels:  unit-testing
specdris
A test framework for Idris
Stars: ✭ 55 (+189.47%)
Mutual labels:  unit-testing
unity-ci-test
Example Unity Project using TravisCI
Stars: ✭ 35 (+84.21%)
Mutual labels:  unit-testing
trx2junit
Transforms XML from trx-Testresults to JUnit-Testresults / trx to JUnit XML and the other way round
Stars: ✭ 42 (+121.05%)
Mutual labels:  unit-testing
EasyUtAndroid
Android unit testing example 全面的android应用单元测试方法及案例
Stars: ✭ 21 (+10.53%)
Mutual labels:  unit-testing
tropic
🍍 Test Runner Library
Stars: ✭ 29 (+52.63%)
Mutual labels:  unit-testing
cpptest
🛠️ Powerful, yet simple, C++ unit testing framework; new home after https://sourceforge.net/projects/cpptest/
Stars: ✭ 51 (+168.42%)
Mutual labels:  unit-testing
TcUnit-Runner
Program that makes it possible to automate runs of TcUnit unit tests
Stars: ✭ 23 (+21.05%)
Mutual labels:  unit-testing
MockitoIn28Minutes
Learn Mockito from In28Minutes
Stars: ✭ 95 (+400%)
Mutual labels:  unit-testing
GitHub-Stalker
track your GitHub statistics with Pandas
Stars: ✭ 31 (+63.16%)
Mutual labels:  unit-testing
MGCleanArchitecture
Clean Architecture with RxSwift & MVVM - Templates and Solutions
Stars: ✭ 156 (+721.05%)
Mutual labels:  unit-testing
Github-Search
https://medium.com/@ericntd/the-real-beginner-guide-to-android-unit-testing-3859d2f25186
Stars: ✭ 18 (-5.26%)
Mutual labels:  unit-testing
XCTestHTMLReport
Xcode-like HTML report for Unit and UI Tests
Stars: ✭ 581 (+2957.89%)
Mutual labels:  unit-testing
json-snapshot.github.io
Snapshot Testing for Java
Stars: ✭ 28 (+47.37%)
Mutual labels:  unit-testing
testing-reactjs-examples
🧪 "What should we test in our React components" - presentation examples.
Stars: ✭ 23 (+21.05%)
Mutual labels:  unit-testing
faiNumber-Fortran
A fast, flexible, and secure numerical library for Fortran.
Stars: ✭ 13 (-31.58%)
Mutual labels:  fortran-library
MealsCatalogue
Flutter application using base architecture component like BLoC pattern, RxDart, Http, SQFlite, Flavor, Unit Testing (Mockito), Instrumentation Testing and etc 🔥
Stars: ✭ 45 (+136.84%)
Mutual labels:  unit-testing
zx-spec
A unit testing framework for Sinclair ZX Spectrum assembly
Stars: ✭ 32 (+68.42%)
Mutual labels:  unit-testing

Fortran Unit Test Library FUT

Content

Overview

This is a Fortran Unit Test library purely written in Fortran to encourage scientific programmer to write tests.

Go to Top

Installation

A CMake-Setup is provided.

Go to Top

Example

demo.F90:

program good_test

  use unit_test

  implicit none

  type(test_suite_type) :: specific_suite

  ! example with default suite
  call test_suite_init()
  call test_case_create('Test 1')

  ! By sending macros __FILE__ and __LINE__, report will print the file and line number where assertion fails.
  call assert_approximate(1.0, 2.0, __FILE__, __LINE__) ! line 14

  ! report the complete suite
  call test_suite_report()

  ! finalize
  call test_case_final()

  ! example with specific suite
  call test_suite_init('my specific test suite', specific_suite)
  call test_case_create('Specific Test 1', specific_suite)
  ! suite = SUITE need in this case (cause optional argument eps, file_name, line_number is missing)
  call assert_approximate(1.0, 2.0, suite=specific_suite)

  call test_case_create('Specific Test 2', specific_suite)
  ! suite = SUITE need in this case (cause optional argument eps is missing)
  call assert_equal(1.0, 2.0, __FILE__, __LINE__,  suite=specific_suite)

  call test_case_create('Specific Test 3', specific_suite)
  call assert_approximate(1.0, 2.0, __FILE__, __LINE__, 1E-0, specific_suite)

  ! report a test_case
  call test_case_report('Specific Test 2', specific_suite)

  ! report the complete suite
  call test_suite_report(specific_suite)

  ! finalize
  call test_suite_final(specific_suite)

end program good_test

Output:

///////////////////// Report of Suite: Default test suite ///////////////////////

 +-> Details:
 |   |
 |   +-> Test 1: 1 of 1 assertions succeed.
 |   |
 |
 +-> Summary:
 |   +-> Default test suite: 1 of 1 assertions succeed.

////////////////////////////////////////////////////////////////////////////////


//////// Report of Suite: my specific test suite, Case: Specific Test 2 /////////

 +-> Specific Test 2: 0 of 1 assertions succeed.
 |   |
 |   +-> Assertion #1 failed with reason: x ( 1.000) == y ( 2.000)
 |   +-> Check line: test_assert.F90:29

/////////////////// Report of Suite: my specific test suite /////////////////////

 +-> Details:
 |   |
 |   +-> Specific Test 1: 1 of 1 assertions succeed.
 |   |
 |   +-> Specific Test 2: 0 of 1 assertions succeed.
 |   |   |
 |   |   +-> Assertion #1 failed with reason: x ( 1.000) == y ( 2.000)
 |   |   +-> Check line: test_assert.F90:29
 |   |
 |   +-> Specific Test 3: 0 of 1 assertions succeed.
 |   |   |
 |   |   +-> Assertion #1 failed with reason: x ( 1.000) =~ y ( 2.000)
 |   |   +-> Check line: test_assert.F90:32
 |   |
 |
 +-> Summary:
 |   +-> my specific test suite: 1 of 3 assertions succeed.

////////////////////////////////////////////////////////////////////////////////

You can integrate this library into your CMake based project as:

...
add_subdirectory (<fortran-unit-test root>)
include_directories (${UNIT_TEST_INCLUDE_DIR})
...
target_link_libraries (<user target> fortran_unit_test ...)

Go to Top

Supported Data Types

  • assert_equal()
    • single data type
      • integer(1);
      • integer(2);
      • integer(4);
      • integer(8);
      • real(4);
      • real(8);
      • character(*);
    • vector data type
      • integer(1), dimension(:);
      • integer(2), dimension(:);
      • integer(4), dimension(:);
      • integer(8), dimension(:);
      • real(4), dimension(:);
      • real(8), dimension(:);
      • character(*), dimension(:);
    • array data type
      • integer(1), dimension(:, :);
      • integer(2), dimension(:, :);
      • integer(4), dimension(:, :);
      • integer(8), dimension(:, :);
      • real(4), dimension(:, :);
      • real(8), dimension(:, :);
      • character(*), dimension(:, :);
  • assert_approximate()
    • single data type
      • real(4);
      • real(8);
    • vector data type
      • real(4), dimension(:);
      • real(8), dimension(:);
    • array data type
      • real(4), dimension(:, :);
      • real(8), dimension(:, :);
  • assert_great_then()
    • single data type
      • integer(1);
      • integer(2);
      • integer(4);
      • integer(8);
      • real(4);
      • real(8);
    • vector data type
      • integer(1), dimension(:);
      • integer(2), dimension(:);
      • integer(4), dimension(:);
      • integer(8), dimension(:);
      • real(4), dimension(:);
      • real(8), dimension(:);
    • array data type
      • integer(1), dimension(:, :);
      • integer(2), dimension(:, :);
      • integer(4), dimension(:, :);
      • integer(8), dimension(:, :);
      • real(4), dimension(:, :);
      • real(8), dimension(:, :);

Go to Top

Compiler Support

Compiler Compiler Compiler Compiler Compiler Compiler

Go to Top

License

License

Go to Top

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].