Skip to content

Commit e04e0aa

Browse files
committed
Backport testing of source tree builds
This is a simple backport of commit #9e9dec8a4 [1]. [1] 9e9dec8
1 parent 2035ccf commit e04e0aa

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

exec-unittests

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,37 @@ function para_run_legacy {
8282
# Export functions for use with `parallel` below.
8383
export -f para_run_legacy run_legacy _time
8484

85+
function verify_make_source_tree {
86+
# The agent and server-side sub-trees have individual ways to create the
87+
# source tree for a tar ball. This function executes that step for the
88+
# given sub-tree.
89+
#
90+
# Arguments:
91+
# _major -- Name of the sub-tree to execute the "make install"
92+
#
93+
# Returns the exit status of the "make install" execution, or the exit
94+
# status dependent command steps (e.g. make, cd, etc.).
95+
local _major=${1}
96+
local _rc
97+
98+
if [[ ! -d ${_toxenvdir}/src ]]; then
99+
mkdir ${_toxenvdir}/src || return ${?}
100+
fi
101+
local _dir=${_toxenvdir}/src/${_major}
102+
rm -rf ${_dir}
103+
mkdir ${_dir} || return ${?}
104+
105+
printf -- "\n\n\nVerifying %s source tree build\n\n" "${_major^}"
106+
(cd ${_major} && make DESTDIR=${_dir} install)
107+
_rc=${?}
108+
if [[ ${_rc} -ne 0 ]]; then
109+
printf -- "\n%s source tree build failed with '%s'\n\n" "${_major^}" "${_rc}"
110+
else
111+
printf -- "\n%s source tree build succeeded\n\n" "${_major^}"
112+
fi
113+
return ${_rc}
114+
}
115+
85116
rc=0
86117

87118
if [[ -n "${COV_REPORT_XML}" ]]; then
@@ -128,6 +159,9 @@ trap "rm -f ${_para_jobs_file}" EXIT INT TERM
128159

129160
let count=0
130161
for _major in ${major_list}; do
162+
# Verify the Agent or Server Makefile functions correctly.
163+
verify_make_source_tree ${_major} || rc=1
164+
131165
if [[ "${_major}" == "agent" ]]; then
132166
# The parallel program is really cool. The usage of `parallel` is
133167
# internal and automated; only test code depends on this tool, and we,
@@ -151,7 +185,7 @@ for _major in ${major_list}; do
151185
run_legacy ${_major} bin ${posargs} || rc=1
152186
fi
153187
else
154-
printf -- "Logic bomb! Unrecognized major test sub-set, '%s'\n" "${_major}" >&2
188+
printf -- "Error - unrecognized major test sub-set, '%s'\n" "${_major}" >&2
155189
rc=1
156190
fi
157191
done

0 commit comments

Comments
 (0)