From 289f895e0500f6572d1da55708ad131c02c6ebb7 Mon Sep 17 00:00:00 2001 From: Miro ILIAS Date: Thu, 6 Aug 2015 08:46:34 +0200 Subject: [PATCH] Simple Fortran test for --int64, without math libraries --- test/fc_int64/cmake/autocmake.cfg | 14 ++++++++++++++ test/fc_int64/src/CMakeLists.txt | 1 + test/fc_int64/src/example.f90 | 14 ++++++++++++++ test/test.py | 5 +++++ 4 files changed, 34 insertions(+) create mode 100644 test/fc_int64/cmake/autocmake.cfg create mode 100644 test/fc_int64/src/CMakeLists.txt create mode 100644 test/fc_int64/src/example.f90 diff --git a/test/fc_int64/cmake/autocmake.cfg b/test/fc_int64/cmake/autocmake.cfg new file mode 100644 index 0000000..192bae3 --- /dev/null +++ b/test/fc_int64/cmake/autocmake.cfg @@ -0,0 +1,14 @@ +[project] +name: example + +[fc] +source: ../../../modules/fc.cmake + +[int64] +source: ../../../modules/int64.cmake + +[default_build_paths] +source: ../../../modules/default_build_paths.cmake + +[src] +source: ../../../modules/src.cmake diff --git a/test/fc_int64/src/CMakeLists.txt b/test/fc_int64/src/CMakeLists.txt new file mode 100644 index 0000000..f6a0177 --- /dev/null +++ b/test/fc_int64/src/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(example example.f90) diff --git a/test/fc_int64/src/example.f90 b/test/fc_int64/src/example.f90 new file mode 100644 index 0000000..caf4a48 --- /dev/null +++ b/test/fc_int64/src/example.f90 @@ -0,0 +1,14 @@ +program example + implicit none + ! max i*4 is 2,147,483,647, add 1 for i*8 + integer*8, parameter :: i8ref = 2147483648 + integer :: i + logical :: test_ok + i=i8ref + test_ok = (sizeof(i) == 8 .and. i == 2147483648) + if (test_ok) then + print *,"test_int64 ok" + else + stop "test_int64 failed!" + endif +end program diff --git a/test/test.py b/test/test.py index c8aad90..829c27f 100644 --- a/test/test.py +++ b/test/test.py @@ -137,6 +137,11 @@ def test_fc_git_info(): stdout, stderr = configure_build_and_exe('fc_git_info', 'python setup.py --fc=gfortran') assert 'Test OK!' in stdout + +def test_fc_int64(): + stdout, stderr = configure_build_and_exe('fc_int64', 'python setup.py --fc=gfortran --int64') + assert 'test_int64 ok' in stdout + # ------------------------------------------------------------------------------