Goddard-Fortran-Ecosystem / pFUnit

Parallel Fortran Unit Testing Framework
Other
171 stars 45 forks source link

fix: verbose ctests #398

Closed Leonard-Reuter closed 1 year ago

Leonard-Reuter commented 1 year ago

made tests added with add_pfunit_ctest verbose, s.t. --verbose is effectively passed through by ctest.

mathomp4 commented 1 year ago

@Leonard-Reuter We just applied a CI fix to main on our repo. Can you sync up your fork and update your branch to get that fix on your branch? That should help things get working CI-wise.

Note also that we will be adding a "changelog enforcer" soon (see #401), so please add to the Changelog.md a description of your change/fix following the format you see in there.

Leonard-Reuter commented 1 year ago

I am not sure I want verbose as the default. I'll have to play with this branch in another project and see the impact.

I think, that without the change proposed over here, the --verbose option of ctest does not add any additional value while it is impossible to get test-wise output.

Examples (I tested it with this repo: https://github.com/Leonard-Reuter/cmake-fortran-template):

ctest -L allocator gives:

Test project /home/reuter/GitProjects/cmake-fortran-template/build
    Start 27: allocator_tests
1/1 Test #27: allocator_tests ..................   Passed    0.01 sec

100% tests passed, 0 tests failed out of 1

Label Time Summary:
allocators    =   0.01 sec*proc (1 test)

Total Test time (real) =   0.05 sec

ctest -L allocator --verbose used to give:

Test project /home/reuter/GitProjects/cmake-fortran-template/build2
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 27
    Start 27: allocator_tests

27: Test command: /home/reuter/GitProjects/cmake-fortran-template/build2/bin/allocator_tests
27: Test timeout computed to be: 10000000
27: ....
27: Time:         0.000 seconds
27:   
27:  OK
27:  (4 tests)
1/1 Test #27: allocator_tests ..................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 1

Label Time Summary:
allocators    =   0.00 sec*proc (1 test)

Total Test time (real) =   0.02 sec

ctest -L allocator --verbose now gives:

Test project /home/reuter/GitProjects/cmake-fortran-template/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 27
    Start 27: allocator_tests

27: Test command: /home/reuter/GitProjects/cmake-fortran-template/build/bin/allocator_tests "--verbose"
27: Test timeout computed to be: 10000000
27:  /home/reuter/GitProjects/cmake-fortran-template/build/pFUnit/pfunit-src/extern/fArgParse/src/ArgParser.F90         518
27:  
27: 
27:  Start: <blockAllocator_test_suite.TestBlockAllocatorConstruction>
27: .   end: <blockAllocator_test_suite.TestBlockAllocatorConstruction>
27:  
27: 
27:  Start: <blockAllocator_test_suite.TestBlockAllocatorAdd>
27: .   end: <blockAllocator_test_suite.TestBlockAllocatorAdd>
27:  
27: 
27:  Start: <blockAllocator_test_suite.TestBlockAllocatorGet>
27: .   end: <blockAllocator_test_suite.TestBlockAllocatorGet>
27:  
27: 
27:  Start: <blockAllocator_test_suite.TestBlockAllocatorReallocate>
27: .   end: <blockAllocator_test_suite.TestBlockAllocatorReallocate>
27: 
27: Time:         0.001 seconds
27:   
27:  OK
27:  (4 tests)
1/1 Test #27: allocator_tests ..................   Passed    0.02 sec

100% tests passed, 0 tests failed out of 1

Label Time Summary:
allocators    =   0.02 sec*proc (1 test)

Total Test time (real) =   0.05 sec