Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cmake-fortran-template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
luechow-group
cmake-fortran-template
Commits
d4bb5cdb
Commit
d4bb5cdb
authored
6 years ago
by
Arne Lüchow
Browse files
Options
Downloads
Patches
Plain Diff
version with installed pFUnit
parent
f33e8761
Branches
no_submodule
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
cmake/utils/pFUnit.cmake
+31
-23
31 additions, 23 deletions
cmake/utils/pFUnit.cmake
pFUnit
+0
-1
0 additions, 1 deletion
pFUnit
with
32 additions
and
25 deletions
CMakeLists.txt
+
1
−
1
View file @
d4bb5cdb
...
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.5)
...
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.5)
### options
### options
option
(
WARNINGS
"ON - display compiler warnings, OFF - do not display compiler warnings"
ON
)
option
(
WARNINGS
"ON - display compiler warnings, OFF - do not display compiler warnings"
ON
)
option
(
OPENMP
"ON - enables adding of OpenMP targets, OFF - disables adding of OpenMP targets"
OFF
)
option
(
OPENMP
"ON - enables adding of OpenMP targets, OFF - disables adding of OpenMP targets"
OFF
)
option
(
PFUNIT
"ON - using pFUnit for unit tests, OFF - skip building unit tests"
O
FF
)
option
(
PFUNIT
TESTS
"ON - using pFUnit for unit tests, OFF - skip building unit tests"
O
N
)
# defines project name and used language
# defines project name and used language
project
(
FortranTemplate Fortran
)
project
(
FortranTemplate Fortran
)
...
...
This diff is collapsed.
Click to expand it.
cmake/utils/pFUnit.cmake
+
31
−
23
View file @
d4bb5cdb
### for the use of pFUnit
### for the use of pFUnit
if
(
${
PFUNIT
}
)
# this version:_
# expects standard pFUnit installation, i.e. env variables PFUNIT und F90_VENDOR set
if
(
${
PFUNITTESTS
}
)
enable_testing
()
enable_testing
()
include
(
ExternalProject
)
###include(ExternalProject)
# python is needed for the preprocessing
# python is needed for the preprocessing
find_program
(
PYTHON python
)
find_program
(
PYTHON python
)
set
(
PFUNIT_BUILD_PATH
${
PROJECT_BINARY_DIR
}
/pFUnit
)
set
(
PFUNIT_BUILD_PATH $ENV{PFUNIT}
)
message
(
" using pFUnit installed at
${
PFUNIT_BUILD_PATH
}
"
)
# this way, pFUnit is configured during the cmake build step
# this way, pFUnit is configured during the cmake build step
ExternalProject_Add
(
pFUnit
#
ExternalProject_Add(pFUnit
PREFIX pFUnit
#
PREFIX pFUnit
SOURCE_DIR
${
PROJECT_SOURCE_DIR
}
/pFUnit
#
SOURCE_DIR ${PROJECT_SOURCE_DIR}/pFUnit
BINARY_DIR
${
PFUNIT_BUILD_PATH
}
#
BINARY_DIR ${PFUNIT_BUILD_PATH}
TMP_DIR
${
PFUNIT_BUILD_PATH
}
/tmp
#
TMP_DIR ${PFUNIT_BUILD_PATH}/tmp
STAMP_DIR
${
PFUNIT_BUILD_PATH
}
/stamp
#
STAMP_DIR ${PFUNIT_BUILD_PATH}/stamp
CMAKE_ARGS
#
CMAKE_ARGS
"-DCMAKE_INSTALL_PREFIX=
${
PFUNIT_BUILD_PATH
}
"
#
"-DCMAKE_INSTALL_PREFIX=${PFUNIT_BUILD_PATH}"
"-DINSTALL_PATH=
${
PFUNIT_BUILD_PATH
}
"
#
"-DINSTALL_PATH=${PFUNIT_BUILD_PATH}"
"-DCMAKE_Fortran_COMPILER=
${
CMAKE_Fortran_COMPILER
}
"
#
"-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}"
)
#
)
add_test
(
NAME pFUnitTest
#
add_test(NAME pFUnitTest
COMMAND
${
PFUNIT_BUILD_PATH
}
/tests/tests.x
#
COMMAND ${PFUNIT_BUILD_PATH}/tests/tests.x
WORKING_DIRECTORY
${
PFUNIT_BUILD_PATH
}
)
#
WORKING_DIRECTORY ${PFUNIT_BUILD_PATH})
#
set_tests_properties
(
pFUnitTest
#
set_tests_properties(pFUnitTest
PROPERTIES LABELS
"pFUnit;
${
PROJECT_NAME
}
"
)
#
PROPERTIES LABELS "pFUnit;${PROJECT_NAME}")
function
(
add_pFUnit_test moduleName libraries
)
function
(
add_pFUnit_test moduleName libraries
)
# Input:
# Input:
...
@@ -49,7 +55,9 @@ if (${PFUNIT})
...
@@ -49,7 +55,9 @@ if (${PFUNIT})
add_custom_command
(
add_custom_command
(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
test
}
.f90
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
test
}
.f90
COMMAND
${
PYTHON
}
${
PFUNIT_BUILD_PATH
}
/bin/pFUnitParser.py
${
CMAKE_CURRENT_LIST_DIR
}
/
${
test
}
.pf
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
test
}
.f90
COMMAND
${
PYTHON
}
${
PFUNIT_BUILD_PATH
}
/bin/pFUnitParser.py
${
CMAKE_CURRENT_LIST_DIR
}
/
${
test
}
.pf
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
test
}
.f90
DEPENDS pFUnit
${
CMAKE_CURRENT_LIST_DIR
}
/
${
test
}
.pf
)
DEPENDS
${
CMAKE_CURRENT_LIST_DIR
}
/
${
test
}
.pf
)
#####DEPENDS pFUnit ${CMAKE_CURRENT_LIST_DIR}/${test}.pf)
# adding the test to testSuites.inc
# adding the test to testSuites.inc
file
(
APPEND
${
CMAKE_CURRENT_BINARY_DIR
}
/testSuites.inc
"ADD_TEST_SUITE(
${
test
}
_suite)
\n
"
)
file
(
APPEND
${
CMAKE_CURRENT_BINARY_DIR
}
/testSuites.inc
"ADD_TEST_SUITE(
${
test
}
_suite)
\n
"
)
...
@@ -59,7 +67,7 @@ if (${PFUNIT})
...
@@ -59,7 +67,7 @@ if (${PFUNIT})
endforeach
()
endforeach
()
add_executable
(
${
moduleName
}
Tests.bin
add_executable
(
${
moduleName
}
Tests.bin
${
P
ROJECT_SOURCE_DIR
}
/pFUnit
/include/driver.F90
${
P
FUNIT_BUILD_PATH
}
/include/driver.F90
${
ppSources
}
)
${
ppSources
}
)
target_include_directories
(
${
moduleName
}
Tests.bin
target_include_directories
(
${
moduleName
}
Tests.bin
...
...
This diff is collapsed.
Click to expand it.
pFUnit
@
bb130e68
Compare
bb130e68
...
bb130e68
Subproject commit bb130e68bea079d71333e43222edee1d24a6d472
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment