Skip to content

Commit e6ac76a

Browse files
committed
Passing multiple ctest -E / -R options doesn't work as expected.
Passing -E overwrites all other -E settings, same with -R. Update build script to join these together into a single regex and just pass one -E and one -R.
1 parent 93d1f8e commit e6ac76a

1 file changed

Lines changed: 23 additions & 6 deletions

File tree

ci/common/build.bash

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ function echo_and_run_timed {
4141
time ${@:2}
4242
}
4343

44+
# join_delimit <delimiter> [value [value [...]]]
45+
# Combine all values into a single string, separating each by a single character
46+
# delimiter. Eg:
47+
# foo=(bar baz kramble)
48+
# joined_foo=$(join_delimit "|" "${foo[@]}")
49+
# echo joined_foo # "bar|baz|kramble"
50+
function join_delimit {
51+
local IFS="${1}"
52+
shift
53+
echo "${*}"
54+
}
55+
4456
################################################################################
4557
# VARIABLES - Set up bash and environmental variables.
4658
################################################################################
@@ -178,21 +190,26 @@ fi
178190

179191
append CTEST_FLAGS "--output-on-failure"
180192

193+
CTEST_EXCLUSION_REGEXES=()
194+
181195
if [[ "${BUILD_TYPE}" == "cpu" ]]; then
182-
append CTEST_FLAGS "-E ^cub|^thrust.*cuda"
196+
CTEST_EXCLUSION_REGEXES+=("^cub" "^thrust.*cuda")
183197
fi
184198

185199
if [[ "${CXX_TYPE}" == "icc" ]]; then
186200
# The free version of icpc used in gpuCI seems to have a compiler bug that
187201
# causes a scan test to produce incorrect output.
188-
append CTEST_FLAGS "-E thrust\\.cpp\\.tbb\\.cpp..\\.test\\.scan$"
202+
CTEST_EXCLUSION_REGEXES+=("thrust\\.cpp\\.tbb\\.cpp..\\.test\\.scan$")
203+
fi
204+
205+
if [[ -n "${CTEST_EXCLUSION_REGEXES[@]}" ]]; then
206+
CTEST_EXCLUSION_REGEX=$(join_delimit "|" "${CTEST_EXCLUSION_REGEXES[@]}")
207+
append CTEST_FLAGS "-E ${CTEST_EXCLUSION_REGEX}"
189208
fi
190209

191210
if [[ -n "${@}" ]]; then
192-
for arg in "${@}"
193-
do
194-
append CTEST_FLAGS "-R ^${arg}$"
195-
done
211+
CTEST_INCLUSION_REGEX=$(join_delimit "|" "${@}")
212+
append CTEST_FLAGS "-R ${CTEST_INCLUSION_REGEX[@]}"
196213
fi
197214

198215
# Export variables so they'll show up in the logs when we report the environment.

0 commit comments

Comments
 (0)