simple fortran test for checking the generated "git_info.h"
- with form according to Rado's order
This commit is contained in:
parent
cc69b40fe2
commit
015e9af844
14
test/fc_gitinfo/cmake/autocmake.cfg
Normal file
14
test/fc_gitinfo/cmake/autocmake.cfg
Normal file
@ -0,0 +1,14 @@
|
||||
[project]
|
||||
name: example
|
||||
|
||||
[fc]
|
||||
source: ../../../modules/fc.cmake
|
||||
|
||||
[default_build_paths]
|
||||
source: ../../../modules/default_build_paths.cmake
|
||||
|
||||
[src]
|
||||
source: ../../../modules/src.cmake
|
||||
|
||||
[git]
|
||||
source: ../../../modules/git_info/git_info.cmake
|
2
test/fc_gitinfo/src/CMakeLists.txt
Normal file
2
test/fc_gitinfo/src/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
include_directories("${PROJECT_BINARY_DIR}")
|
||||
add_executable(example example.F90)
|
11
test/fc_gitinfo/src/example.F90
Normal file
11
test/fc_gitinfo/src/example.F90
Normal file
@ -0,0 +1,11 @@
|
||||
program example
|
||||
implicit none
|
||||
logical :: test_ok
|
||||
! file generated on run-time
|
||||
#include "git_info.h"
|
||||
test_ok = len(GIT_COMMIT_HASH) > 0 .and. &
|
||||
len(GIT_COMMIT_AUTHOR) > 0 .and. &
|
||||
len(GIT_COMMIT_DATE) > 0 .and. &
|
||||
len(GIT_BRANCH) > 0
|
||||
if (test_ok) print *,'Test OK!'
|
||||
end program
|
@ -132,6 +132,11 @@ def test_fc():
|
||||
stdout, stderr = configure_build_and_exe('fc', 'python setup.py --fc=gfortran')
|
||||
assert 'Hello World!' in stdout
|
||||
|
||||
|
||||
def test_fc_gitinfo():
|
||||
stdout, stderr = configure_build_and_exe('fc_gitinfo', 'python setup.py --fc=gfortran')
|
||||
assert 'Test OK!' in stdout
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user