Skip to content

Commit 357439a

Browse files
committed
Cleanup CMake build, and rename test directories.
1 parent ecb2496 commit 357439a

File tree

7 files changed

+3
-45
lines changed

7 files changed

+3
-45
lines changed

src/physics/utils/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ target_link_libraries(io_reader PUBLIC
1414
PIO::PIO_C
1515
cam_pio_utils
1616
ccpp_framework)
17-
#target_link_libraries(io_reader PUBLIC PIO::PIO_Fortran cam_pio_utils ccpp_framework)
1817
target_include_directories(io_reader PRIVATE ${CMAKE_BINARY_DIR}/ccpp_framework_stub
19-
${CMAKE_BINARY_DIR}/utils)
18+
${CMAKE_BINARY_DIR}/mock_routines)

test/unit/fortran/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
cmake_minimum_required(VERSION 3.18)
22

33
project(CAM-SIMA-core-utils LANGUAGES Fortran C)
4-
#project(CAM-SIMA-core-utils LANGUAGES Fortran)
54

65
option(CAM_SIMA_ENABLE_TESTS "Run pFUnit unit tests" OFF)
76
option(CAM_SIMA_ENABLE_CODE_COVERAGE "Run code coverage tool" OFF)
@@ -36,17 +35,15 @@ if(CAM_SIMA_ENABLE_TESTS OR CAM_SIMA_ENABLE_CODE_COVERAGE OR CAM_SIMA_ENABLE_IO_
3635
endif()
3736
if(CAM_SIMA_ENABLE_IO_TESTS)
3837
find_package(MPI REQUIRED COMPONENTS Fortran C)
39-
#find_package(MPI REQUIRED COMPONENTS Fortran)
4038
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
4139
find_package(NetCDF REQUIRED COMPONENTS Fortran C)
42-
#find_package(NetCDF REQUIRED COMPONENTS Fortran)
4340
find_package(PIO REQUIRED COMPONENTS Fortran C)
4441

4542
add_subdirectory(ccpp_framework_stub)
46-
add_subdirectory(utils)
43+
add_subdirectory(mock_routines)
4744

4845
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../src/physics/utils ${CMAKE_CURRENT_BINARY_DIR}/src/physics/utils)
4946

50-
add_subdirectory(src/mock_routines)
47+
add_subdirectory(src/pio_reader)
5148
endif()
5249
endif()

test/unit/fortran/utils/CMakeLists.txt renamed to test/unit/fortran/mock_routines/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
add_library(cam_pio_utils cam_pio_utils.F90)
22
target_link_libraries(cam_pio_utils PUBLIC MPI::MPI_Fortran
3-
#MPI::MPI_C
43
PIO::PIO_Fortran
54
PIO::PIO_C
65
NetCDF::NetCDF_C
File renamed without changes.

test/unit/fortran/src/mock_routines/test_pio_read.pf

Lines changed: 0 additions & 27 deletions
This file was deleted.

test/unit/fortran/src/mock_routines/CMakeLists.txt renamed to test/unit/fortran/src/pio_reader/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
add_pfunit_ctest(pio_tests
2-
#TEST_SOURCES test_pio_read.pf test_pio_reader.pf
32
TEST_SOURCES test_pio_reader.pf
43
LINK_LIBRARIES io_reader
54
cam_pio_utils
65
ccpp_framework
76
MPI::MPI_Fortran
8-
#MPI::MPI_C
97
PIO::PIO_Fortran
108
PIO::PIO_C
119
NetCDF::NetCDF_C

test/unit/fortran/src/mock_routines/test_pio_reader.pf renamed to test/unit/fortran/src/pio_reader/test_pio_reader.pf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ subroutine test_pio_reader_open_close_file()
2929
!close a file successfully.
3030
use funit
3131

32-
!use mpi, only: mpi_init
33-
3432
use ccpp_io_reader, only: abstract_netcdf_reader_t
3533
use ccpp_io_reader, only: create_netcdf_reader_t
3634

@@ -39,17 +37,11 @@ subroutine test_pio_reader_open_close_file()
3937
integer :: errcode
4038
character(len=256) :: errmsg
4139

42-
!integer :: mpi_ierr
43-
4440
! File name for testing:
4541
! NOTE: This specific file is added during the Github Actions workflow.
4642
character(len=*), parameter :: fname = &
4743
'../../../rrtmgp-data/rrtmgp-gas-sw-g112.nc'
4844

49-
! Initialize MPI:
50-
! NOTE: This must be done for the first test in the test suite.
51-
!call mpi_init(mpi_ierr)
52-
5345
! Begin test:
5446

5547
reader = create_netcdf_reader_t()

0 commit comments

Comments
 (0)