-
Notifications
You must be signed in to change notification settings - Fork 86
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
CMake Tests 3 and 8 fail due to new test case, example 6, added in e636f96 #30
Comments
I think it's a good idea. The unit test need some cleanup (see Issue #27). Testing all the error cases is especially important (where the error happening and being caught is the success). |
Do you have any preferences for directory structure and naming convention if we split json_example.f90 into individual tests? I’m gonna tackle this now I think. |
Maybe a |
Under src, or along side? |
Hmmm.. not sure. Maybe under src? |
… the latest FoBiS version (1.2.5) and no longer compiles the json-fortran module twice.
Right now this is what I’m thinking in terms of splitting out the tests:
Any feedback appreciated esp. CC: @jacobwilliams |
I would prefer the simpler option of just having stand-alone programs, with each one a separate test. And then the master unit test script (Python maybe) calls each of them and determines if each one passes or fails. I know there are unit-testing frameworks out there, I'm just not familiar with the different options. |
Well… the cmake one just requires you to write a bind(c) function for each test, put it in its own file having the same name as the function, and add it to a list of test sources in CMake… CMake builds and links etc for you and you can run all test with btw do you have any insight on updating the SConstruct build in the case that json_example.f90 has been spit into |
OK, I have thought more about this, and I have come up with what I think is a much better and simpler solution than the one I proposed above:
module js_test_strprint_mod
use json_module
implicit none
! constants etc here
contains
subroutine test_strprint(err_count)
integer, intent(out) :: err_count
! do tests
end subroutine
end module
#ifndef NO_STAND_ALONE_TESTS
program jf_test_strprint
use jf_test_strprint_mod
implicit none
integer :: errors
call test_strprint(errors_
if (errors /= 0) stop 1
end program
#endif @jacobwilliams do you think this is simple/KISS enough for “fortran poor man”? 😄 |
That sounds great!! I especially like the idea of being able to add a new |
HAHA, well this “poor fortran man” is a bit rusty on bash command line flags (I know you use |
-Fixes jacobwilliams#30: CMake tests 3 and 8 fail -Fixes jacobwilliams#49: tests dir should be under src -Maybe addresses jacobwilliams#27... I'll leave that up to @jacobwilliams -maybe concludes jacobwilliams#42... -Breaks SCons build: @jacobwilliams and @bruceravel, my python/SCons is too nonexistant to fix this myself.
-Fixes jacobwilliams#30: CMake tests 3 and 8 fail -Fixes jacobwilliams#49: tests dir should be under src -Maybe addresses jacobwilliams#27... I'll leave that up to @jacobwilliams -maybe concludes jacobwilliams#42... -Breaks SCons build: @jacobwilliams and @bruceravel, my python/SCons is too nonexistant to fix this myself.
-Fixes jacobwilliams#30: CMake tests 3 and 8 fail -Fixes jacobwilliams#49: tests dir should be under src -Maybe addresses jacobwilliams#27... I'll leave that up to @jacobwilliams -maybe concludes jacobwilliams#42... -Breaks SCons build: @jacobwilliams and @bruceravel, my python/SCons is too nonexistant to fix this myself.
-Fixes jacobwilliams#30: CMake tests 3 and 8 fail -Fixes jacobwilliams#49: tests dir should be under src -Maybe addresses jacobwilliams#27... I'll leave that up to @jacobwilliams -maybe concludes jacobwilliams#42... -Breaks SCons build: @jacobwilliams and @bruceravel, my python/SCons is too nonexistant to fix this myself. -Probably breaks visual studio build, @jacobwilliams: I can't work on this, I don't have access to visual studio -Tests return the number of errors encountered -CMake and build.sh scripts work fine, SCons and VS builds likely broken -CMake flags now distinguished between compiler flags (for all compilers) and fortran specific compiler flags
-Fixes jacobwilliams#30: CMake tests 3 and 8 fail -Fixes jacobwilliams#49: tests dir should be under src -Maybe addresses jacobwilliams#27... I'll leave that up to @jacobwilliams -maybe concludes jacobwilliams#42... -SCons build works and runs test with `scons test` -Probably breaks visual studio build, @jacobwilliams: I can't work on this, I don't have access to visual studio -Tests return the number of errors encountered -CMake and build.sh scripts work fine, VS build likely broken -CMake flags now distinguished between compiler flags (for all compilers) and fortran specific compiler flags -Small CMake bug fixed where CMake wasn't passing the requested GNU specific flags -CMake and build.sh have added options to compile for code coverage analysis with gcov when using GNU compiler
-Fixes jacobwilliams#30: CMake tests 3 and 8 fail -Fixes jacobwilliams#49: tests dir should be under src -Maybe addresses jacobwilliams#27... I'll leave that up to @jacobwilliams -maybe concludes jacobwilliams#42... -SCons build works and runs test with `scons test` -Probably breaks visual studio build, @jacobwilliams: I can't work on this, I don't have access to visual studio -Tests return the number of errors encountered -CMake and build.sh scripts work fine, VS build likely broken -CMake flags now distinguished between compiler flags (for all compilers) and fortran specific compiler flags -Small CMake bug fixed where CMake wasn't passing the requested GNU specific flags -CMake and build.sh have added options to compile for code coverage analysis with gcov when using GNU compiler
-Fixes jacobwilliams#30: CMake tests 3 and 8 fail -Fixes jacobwilliams#49: tests dir should be under src -Maybe addresses jacobwilliams#27... I'll leave that up to @jacobwilliams -maybe concludes jacobwilliams#42... -SCons build works and runs test with `scons test` -Probably breaks visual studio build, @jacobwilliams: I can't work on this, I don't have access to visual studio -Tests return the number of errors encountered -CMake and build.sh scripts work fine, VS build likely broken -CMake flags now distinguished between compiler flags (for all compilers) and fortran specific compiler flags -Small CMake bug fixed where CMake wasn't passing the requested GNU specific flags -CMake and build.sh have added options to compile for code coverage analysis with gcov when using GNU compiler
-Fixes jacobwilliams#30: CMake tests 3 and 8 fail -Fixes jacobwilliams#49: tests dir should be under src -Maybe addresses jacobwilliams#27... I'll leave that up to @jacobwilliams -maybe concludes jacobwilliams#42... -SCons build works and runs test with `scons test` -Probably breaks visual studio build, @jacobwilliams: I can't work on this, I don't have access to visual studio -Tests return the number of errors encountered -CMake and build.sh scripts work fine, VS build likely broken -CMake flags now distinguished between compiler flags (for all compilers) and fortran specific compiler flags -Small CMake bug fixed where CMake wasn't passing the requested GNU specific flags -CMake and build.sh have added options to compile for code coverage analysis with gcov when using GNU compiler
-Fixes jacobwilliams#30: CMake tests 3 and 8 fail -Fixes jacobwilliams#49: tests dir should be under src -Maybe addresses jacobwilliams#27... I'll leave that up to @jacobwilliams -maybe concludes jacobwilliams#42... -SCons build works and runs test with `scons test` -Probably breaks visual studio build, @jacobwilliams: I can't work on this, I don't have access to visual studio -Tests return the number of errors encountered -CMake and build.sh scripts work fine, VS build likely broken -CMake flags now distinguished between compiler flags (for all compilers) and fortran specific compiler flags -Small CMake bug fixed where CMake wasn't passing the requested GNU specific flags -CMake and build.sh have added options to compile for code coverage analysis with gcov when using GNU compiler
-Fixes jacobwilliams#30: CMake tests 3 and 8 fail -Fixes jacobwilliams#49: tests dir should be under src -Maybe addresses jacobwilliams#27... I'll leave that up to @jacobwilliams -maybe concludes jacobwilliams#42... -SCons build works and runs test with `scons test` -Probably breaks visual studio build, @jacobwilliams: I can't work on this, I don't have access to visual studio -Tests return the number of errors encountered -CMake and build.sh scripts work fine, VS build likely broken -CMake flags now distinguished between compiler flags (for all compilers) and fortran specific compiler flags -Small CMake bug fixed where CMake wasn't passing the requested GNU specific flags -CMake and build.sh have added options to compile for code coverage analysis with gcov when using GNU compiler
Unit test cleanup as discussed in #30
The CMake tests are crude, and intentionally introducing an invalid json file and diagnosing the error is causing CTest to hit on the ‘error’ regex and incorrectly say that the test has failed.
My preferred fix would be to break up the json_example.f90 file into individual tests, one per file, then they could be tested one by one. What do you think @jacobwilliams ?
The text was updated successfully, but these errors were encountered: