From ff32962a682387ada24a7485a1bd21a3fc1b19d4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Feb 2009 14:32:31 -0500 Subject: ENH: Test included header in Fortran preprocessing This extends the Fortran preprocessing test to include a header file through a preprocessor directive. --- Tests/Fortran/CMakeLists.txt | 1 + Tests/Fortran/include/test_preprocess.h | 5 +++++ Tests/Fortran/test_preprocess.F90 | 6 +----- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 Tests/Fortran/include/test_preprocess.h diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index e8515c4..e4fc4c2 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -127,6 +127,7 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) in_interface/module.f90) add_definitions(-DFOO -DBAR=1) + include_directories(${testf_SOURCE_DIR}/include) add_executable(test_preprocess test_preprocess.F90) set(TEST_MODULE_DEPENDS 1) diff --git a/Tests/Fortran/include/test_preprocess.h b/Tests/Fortran/include/test_preprocess.h new file mode 100644 index 0000000..29ac4b6 --- /dev/null +++ b/Tests/Fortran/include/test_preprocess.h @@ -0,0 +1,5 @@ +#ifdef BAR + PRINT * , 'BAR was defined via ADD_DEFINITIONS' +#else + PRINT *, 'If you can read this something went wrong' +#endif diff --git a/Tests/Fortran/test_preprocess.F90 b/Tests/Fortran/test_preprocess.F90 index 374a6ff..e4f1fbe 100644 --- a/Tests/Fortran/test_preprocess.F90 +++ b/Tests/Fortran/test_preprocess.F90 @@ -46,10 +46,6 @@ PROGRAM PPTEST #endif ! 0 ; -#ifdef BAR - PRINT * , 'BAR was defined via ADD_DEFINITIONS' -#else - PRINT *, 'If you can read this something went wrong' -#endif +#include "test_preprocess.h" END PROGRAM -- cgit v0.12