Skip to content

Commit

Permalink
Isolate internal tests with cleanups. (#128)
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel K. Gutierrez <samuel@lanl.gov>
  • Loading branch information
samuelkgutierrez authored May 1, 2024
1 parent a9abe75 commit cb7348e
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 292 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- Mode: C++; c-basic-offset:4; indent-tabs-mode:nil -*-
#
# Copyright (c) 2020-2024 Triad National Security, LLC
# All rights reserved.
Expand Down Expand Up @@ -191,6 +192,7 @@ add_subdirectory(src)
add_subdirectory(src/fortran)
# Conditionally add test source
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
add_subdirectory(tests/internal)
add_subdirectory(tests)
endif()

Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- Mode: C++; c-basic-offset:4; indent-tabs-mode:nil -*-
#
# Copyright (c) 2020-2024 Triad National Security, LLC
# All rights reserved.
Expand Down
3 changes: 2 additions & 1 deletion src/fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- Mode: C++; c-basic-offset:4; indent-tabs-mode:nil -*-
#
# Copyright (c) 2020-2022 Triad National Security, LLC
# Copyright (c) 2020-2024 Triad National Security, LLC
# All rights reserved.
#
# Copyright (c) 2020-2021 Lawrence Livermore National Security, LLC
Expand Down
2 changes: 1 addition & 1 deletion src/qvi-macros.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-basic-offset:4; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2020-2021 Triad National Security, LLC
* Copyright (c) 2020-2024 Triad National Security, LLC
* All rights reserved.
*
* Copyright (c) 2020-2021 Lawrence Livermore National Security, LLC
Expand Down
177 changes: 34 additions & 143 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- Mode: C++; c-basic-offset:4; indent-tabs-mode:nil -*-
#
# Copyright (c) 2020-2023 Triad National Security, LLC
# Copyright (c) 2020-2024 Triad National Security, LLC
# All rights reserved.
#
# Copyright (c) 2020-2021 Lawrence Livermore National Security, LLC
Expand All @@ -9,75 +10,10 @@
# top-level directory of this distribution.
#

# TODO(skg) Add valgrind tests.
################################################################################
################################################################################
add_executable(
test-hwloc
qvi-test-common.h
test-hwloc.c
)

target_link_libraries(
test-hwloc
quo-vadis
)

add_test(
hwloc
test-hwloc
)

################################################################################
################################################################################
add_executable(
test-rmi-server
test-rmi-server.cc
)

target_link_libraries(
test-rmi-server
quo-vadis
)

add_test(
NAME
rmi-server
COMMAND
bash -c "export URL=\"tcp://127.0.0.1:55995\" && \
${CMAKE_CURRENT_BINARY_DIR}/test-rmi-server $URL"
)

################################################################################
################################################################################
add_executable(
test-rmi
test-rmi.cc
)

target_link_libraries(
test-rmi
quo-vadis
)

add_test(
NAME
rmi
COMMAND
bash -c "export URL=\"tcp://127.0.0.1:55995\" && \
( ${CMAKE_SOURCE_DIR}/tests/exec-timeout.sh \
\"${CMAKE_CURRENT_BINARY_DIR}/test-rmi $URL -s\" 5 & ) && \
( ${CMAKE_CURRENT_BINARY_DIR}/test-rmi $URL -c & ) && \
( ${CMAKE_CURRENT_BINARY_DIR}/test-rmi $URL -c & ) && \
( ${CMAKE_CURRENT_BINARY_DIR}/test-rmi $URL -c & ) && \
${CMAKE_CURRENT_BINARY_DIR}/test-rmi $URL -c"
)

################################################################################
################################################################################
add_executable(
test-process-scopes
qvi-test-common.h
test-process-scopes.c
)

Expand All @@ -95,6 +31,12 @@ add_test(
${CMAKE_CURRENT_BINARY_DIR}/test-process-scopes"
)

# Use the C linker to test for C/C++ linkage problems.
set_target_properties(
test-process-scopes
PROPERTIES LINKER_LANGUAGE C
)

################################################################################
################################################################################
if (OPENMP_FOUND)
Expand All @@ -119,6 +61,12 @@ if (OPENMP_FOUND)
OpenMP::OpenMP_C
)

set_target_properties(
test-threads
test-openmp
PROPERTIES LINKER_LANGUAGE C
)

add_test(
NAME
threads
Expand All @@ -141,20 +89,8 @@ endif()
################################################################################
################################################################################
if(MPI_FOUND)
add_executable(
test-mpi
qvi-test-common.h
test-mpi.c
)

target_link_libraries(
test-mpi
quo-vadis-mpi
)

add_executable(
test-mpi-init
qvi-test-common.h
test-mpi-init.c
)

Expand All @@ -165,7 +101,6 @@ if(MPI_FOUND)

add_executable(
test-mpi-api
qvi-test-common.h
test-mpi-api.c
)

Expand All @@ -176,7 +111,6 @@ if(MPI_FOUND)

add_executable(
test-mpi-scopes
qvi-test-common.h
test-mpi-scopes.c
)

Expand All @@ -187,7 +121,6 @@ if(MPI_FOUND)

add_executable(
test-mpi-scopes-affinity-preserving
qvi-test-common.h
test-mpi-scopes-affinity-preserving.c
)

Expand All @@ -198,7 +131,6 @@ if(MPI_FOUND)

add_executable(
test-mpi-phases
qvi-test-common.h
test-mpi-phases.c
)

Expand All @@ -209,19 +141,17 @@ if(MPI_FOUND)

add_executable(
test-progress-thread
qvi-test-common.h
test-progress-thread.c
)

target_link_libraries(
test-progress-thread
quo-vadis
quo-vadis
quo-vadis-mpi
)

add_executable(
test-mpi-scope-create
qvi-test-common.h
test-mpi-scope-create.c
)

Expand All @@ -230,20 +160,8 @@ if(MPI_FOUND)
quo-vadis-mpi
)

add_executable(
test-mpi-scope-ksplit
qvi-test-common.h
test-mpi-scope-ksplit.cc
)

target_link_libraries(
test-mpi-scope-ksplit
quo-vadis-mpi
)

add_executable(
test-mpi-getdev
qvi-test-common.h
test-mpi-getdev.c
)

Expand All @@ -252,6 +170,20 @@ if(MPI_FOUND)
quo-vadis-mpi
)

# Use the C linker to test for C/C++ linkage problems.
set_target_properties(
test-mpi-init
test-mpi-api
test-mpi-scopes
test-mpi-scopes-affinity-preserving
test-mpi-phases
test-progress-thread
test-mpi-scope-create
test-mpi-getdev
#test-mpi-pthreads-layout
PROPERTIES LINKER_LANGUAGE C
)

# TODO(skg) Automate adding MPI tests.
add_test(
NAME
Expand All @@ -277,7 +209,6 @@ if(MPI_FOUND)
################################################################################
#add_executable(
#test-mpi-pthreads-layout
#qvi-test-common.h
#test-mpi-pthreads-layout.c
#)

Expand All @@ -293,7 +224,6 @@ if(MPI_FOUND)
if(OPENMP_FOUND)
add_executable(
test-mpi-threads
qvi-test-common.h
test-mpi-threads.c
)

Expand All @@ -306,7 +236,6 @@ if(MPI_FOUND)

#add_executable(
# test-mpi-threads-layout
# qvi-test-common.h
# test-mpi-threads-layout.c
#)

Expand All @@ -318,6 +247,11 @@ if(MPI_FOUND)
# OpenMP::OpenMP_C
#)

set_target_properties(
test-mpi-threads
#test-mpi-threads-layout
PROPERTIES LINKER_LANGUAGE C
)
endif()
endif()

Expand Down Expand Up @@ -373,47 +307,4 @@ if(QV_FORTRAN_HAPPY)
endif()
endif()

################################################################################
################################################################################
# Use the C linker to test for C/C++ linkage problems.
# TODO(skg) Add other C programs below.
set_target_properties(
test-hwloc
PROPERTIES LINKER_LANGUAGE C
)

if(MPI_FOUND)
set_target_properties(
test-mpi
test-mpi-init
test-mpi-api
test-mpi-getdev
test-mpi-scopes
#test-mpi-pthreads-layout
PROPERTIES LINKER_LANGUAGE C
)

if (OPENMP_FOUND)
set_target_properties(
test-mpi-threads
PROPERTIES LINKER_LANGUAGE C
)
#set_target_properties(
# test-mpi-threads-layout
# PROPERTIES LINKER_LANGUAGE C
#)
endif()
endif()

# Set core test properties.
# TODO(skg) Add rmi and process-scopes
set_tests_properties(
hwloc
rmi-server
rmi
PROPERTIES
TIMEOUT 60
LABELS "core"
)

# vim: ts=4 sts=4 sw=4 expandtab
Loading

0 comments on commit cb7348e

Please sign in to comment.