Skip to content

Commit

Permalink
DAOS-16629 build: Allow separate test builds (#15188)
Browse files Browse the repository at this point in the history
Client and server tests require different packages.
Separate test target so it doesn't imply client or
server.  It requires one or the other but this
allows building just client or server tests.

Signed-off-by: Jeff Olivier <[email protected]>
  • Loading branch information
jolivier23 authored Sep 26, 2024
1 parent c757af5 commit daf565c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 8 additions & 2 deletions site_scons/prereq_tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,19 +504,25 @@ def __init__(self, env, opts):
self._build_targets = []

build_dir = self.__env['BUILD_DIR']
targets = ['test', 'server', 'client']
main_targets = ['client', 'server']
targets = ['test'] + main_targets
self.__env.Alias('client', build_dir)
self.__env.Alias('server', build_dir)
self.__env.Alias('test', build_dir)
self._build_targets = []
check = any(item in BUILD_TARGETS for item in targets)
if not check or 'test' in BUILD_TARGETS:
if not check:
self._build_targets.extend(['client', 'server', 'test'])
else:
if 'client' in BUILD_TARGETS:
self._build_targets.append('client')
if 'server' in BUILD_TARGETS:
self._build_targets.append('server')
if 'test' in BUILD_TARGETS:
if not any(item in BUILD_TARGETS for item in main_targets):
print("test target requires client or server")
sys.exit(1)
self._build_targets.append('test')
BUILD_TARGETS.append(build_dir)

env.AddMethod(self.require, 'require')
Expand Down
7 changes: 4 additions & 3 deletions src/tests/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def build_dts_library(env, dc_credit):
denv.d_static_library('dts', [dc_credit, 'dts.c'])


def build_tests(env):
def build_tests(env, prereqs):
"""build the tests"""
Import('libdaos_tgts', 'cmd_parser')
denv = env.Clone()
Expand Down Expand Up @@ -65,7 +65,8 @@ def build_tests(env):
SConscript('drpc/SConscript')

# Build security_test
SConscript('security/SConscript')
if prereqs.server_requested():
SConscript('security/SConscript')

# ftest
SConscript('ftest/SConscript')
Expand Down Expand Up @@ -100,7 +101,7 @@ def scons():
# Add runtime paths for daos libraries
denv.AppendUnique(RPATH_FULL=['$PREFIX/lib64/daos_srv'])
denv.AppendUnique(CPPPATH=[Dir('../mgmt').srcnode()])
build_tests(denv)
build_tests(denv, prereqs)

if not base_env_mpi:
return
Expand Down

0 comments on commit daf565c

Please sign in to comment.