simple fortran test for checking the generated "git_info.h"

- with form according to Rado's order
This commit is contained in:
Miro ILIAS 2015-08-03 20:15:19 +02:00
parent cc69b40fe2
commit 015e9af844
4 changed files with 32 additions and 0 deletions

View 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

View File

@ -0,0 +1,2 @@
include_directories("${PROJECT_BINARY_DIR}")
add_executable(example example.F90)

View 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

View File

@ -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
# ------------------------------------------------------------------------------