diff --git a/test/fc_gitinfo/cmake/autocmake.cfg b/test/fc_git_info/cmake/autocmake.cfg similarity index 95% rename from test/fc_gitinfo/cmake/autocmake.cfg rename to test/fc_git_info/cmake/autocmake.cfg index dcdbc36..2ea2b74 100644 --- a/test/fc_gitinfo/cmake/autocmake.cfg +++ b/test/fc_git_info/cmake/autocmake.cfg @@ -10,5 +10,5 @@ source: ../../../modules/default_build_paths.cmake [src] source: ../../../modules/src.cmake -[git] +[git_info] source: ../../../modules/git_info/git_info.cmake diff --git a/test/fc_git_info/src/CMakeLists.txt b/test/fc_git_info/src/CMakeLists.txt new file mode 100644 index 0000000..2080ed2 --- /dev/null +++ b/test/fc_git_info/src/CMakeLists.txt @@ -0,0 +1,3 @@ +include_directories(${PROJECT_BINARY_DIR}) + +add_executable(example example.F90) diff --git a/test/fc_git_info/src/example.F90 b/test/fc_git_info/src/example.F90 new file mode 100644 index 0000000..c05d5d1 --- /dev/null +++ b/test/fc_git_info/src/example.F90 @@ -0,0 +1,16 @@ +program example + + implicit none + logical :: test_ok + +! file generated at build 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 diff --git a/test/fc_gitinfo/src/CMakeLists.txt b/test/fc_gitinfo/src/CMakeLists.txt deleted file mode 100644 index 04891bc..0000000 --- a/test/fc_gitinfo/src/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -include_directories("${PROJECT_BINARY_DIR}") -add_executable(example example.F90) diff --git a/test/fc_gitinfo/src/example.F90 b/test/fc_gitinfo/src/example.F90 deleted file mode 100644 index 4e92fb6..0000000 --- a/test/fc_gitinfo/src/example.F90 +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/test/test.py b/test/test.py index ce579fb..c8aad90 100644 --- a/test/test.py +++ b/test/test.py @@ -133,8 +133,8 @@ def test_fc(): assert 'Hello World!' in stdout -def test_fc_gitinfo(): - stdout, stderr = configure_build_and_exe('fc_gitinfo', 'python setup.py --fc=gfortran') +def test_fc_git_info(): + stdout, stderr = configure_build_and_exe('fc_git_info', 'python setup.py --fc=gfortran') assert 'Test OK!' in stdout # ------------------------------------------------------------------------------