-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
- Loading branch information
Showing
9 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set_property(DIRECTORY APPEND | ||
PROPERTY LABELS package | ||
) | ||
|
||
set(test_list | ||
FetchContent | ||
find_package | ||
) | ||
if (NOT Wannier90_IS_TOP_LEVEL) | ||
list(APPEND test_list pkg-config) | ||
endif () | ||
|
||
foreach (test IN LISTS test_list) | ||
Wannier90_add_test(${test} TEST_NAME test-${test}) | ||
endforeach () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
cmake_minimum_required(VERSION 3.25...3.29) | ||
project(example_Wannier90 LANGUAGES Fortran) | ||
|
||
|
||
include(FetchContent) | ||
|
||
if (DEFINED ENV{PACKIT_SOURCE_URL}) | ||
set(git_repo $ENV{PACKIT_SOURCE_URL}) | ||
else () | ||
set(git_repo https://github.com/wannier-developers/wannier90) | ||
endif () | ||
if (DEFINED ENV{PACKIT_SOURCE_SHA}) | ||
set(git_tag $ENV{PACKIT_SOURCE_SHA}) | ||
elseif (DEFINED ENV{PACKIT_COMMIT_SHA}) | ||
set(git_tag $ENV{PACKIT_COMMIT_SHA}) | ||
else () | ||
set(git_tag develop) | ||
endif () | ||
|
||
FetchContent_Declare(Wannier90 | ||
GIT_REPOSITORY ${git_repo} | ||
GIT_TAG ${git_tag} | ||
) | ||
FetchContent_MakeAvailable(Wannier90) | ||
|
||
add_executable(main src/main.F90) | ||
target_link_libraries(main PRIVATE Wannier90::wannier90) | ||
|
||
enable_testing() | ||
|
||
add_test(NAME smoke_test_lib | ||
COMMAND $<TARGET_FILE:main> | ||
) | ||
add_test(NAME smoke_test_exe | ||
COMMAND $<TARGET_FILE:Wannier90::exe> --version | ||
) | ||
add_test(NAME smoke_test_post | ||
COMMAND $<TARGET_FILE:Wannier90::post> --version | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cmake_minimum_required(VERSION 3.25...3.29) | ||
project(example_Wannier90 LANGUAGES Fortran) | ||
|
||
find_package(Wannier90 REQUIRED) | ||
|
||
add_executable(main src/main.F90) | ||
target_link_libraries(main PRIVATE Wannier90::wannier90) | ||
|
||
enable_testing() | ||
|
||
add_test(NAME smoke_test_lib | ||
COMMAND $<TARGET_FILE:main> | ||
) | ||
add_test(NAME smoke_test_exe | ||
COMMAND $<TARGET_FILE:Wannier90::exe> --version | ||
) | ||
add_test(NAME smoke_test_post | ||
COMMAND $<TARGET_FILE:Wannier90::post> --version | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.25...3.29) | ||
project(example_Wannier90 LANGUAGES Fortran) | ||
|
||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(Wannier90 REQUIRED IMPORTED_TARGET wannier90) | ||
|
||
add_executable(main src/main.F90) | ||
target_link_libraries(main PRIVATE PkgConfig::Wannier90) | ||
|
||
enable_testing() | ||
|
||
add_test(NAME smoke_test_lib | ||
COMMAND $<TARGET_FILE:main> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
program wannier90_example | ||
use w90_library | ||
implicit none | ||
|
||
! TODO: Implement basic smoke test | ||
end program wannier90_example |