Commits (6)
...@@ -242,6 +242,8 @@ function junitxml_xmlattribute() { ...@@ -242,6 +242,8 @@ function junitxml_xmlattribute() {
# Escape characters that will be invalid in attributes # Escape characters that will be invalid in attributes
value="${value//&/amp;}" value="${value//&/amp;}"
value="${value//\"/"}" value="${value//\"/"}"
value="${value//</&lt;}"
value="${value//>/&gt;}"
echo -n "\"$value\"" echo -n "\"$value\""
} }
......
...@@ -149,7 +149,6 @@ sut_leaf="$(basename "${sut_exe}")" ...@@ -149,7 +149,6 @@ sut_leaf="$(basename "${sut_exe}")"
sut_testdir="${2:-tests/invocation}" sut_testdir="${2:-tests/invocation}"
# Set up the test suite name based on the binary we're testing. # Set up the test suite name based on the binary we're testing.
testsuite="${sut_leaf%.*}" testsuite="${sut_leaf%.*}"
if [[ "$testsuite" == "test" || \ if [[ "$testsuite" == "test" || \
...@@ -164,19 +163,36 @@ junitxml_ci_properties ...@@ -164,19 +163,36 @@ junitxml_ci_properties
# The files we're going to execute are in the 'invocation' directory. # The files we're going to execute are in the 'invocation' directory.
files_to_test=("${sut_testdir}"/*.invoke) files_to_test=("${sut_testdir}"/*.invoke)
# If we're inside the CI, even if we wouldn't have a TERM set, let's use one
if [[ "${CI}" != '' && "${TERM}" == '' ]] ; then
export TERM=ansi
fi
# Terminal colouring # Terminal colouring
term_red="$(tput setaf 1)" if ! tput bold > /dev/null 2> /dev/null ; then
term_green="$(tput setaf 2)" # No terminal colouring available; so we won't use colours
term_yellow="$(tput setaf 3)" term_red=""
term_blue="$(tput setaf 4)" term_green=""
term_magenta="$(tput setaf 5)" term_yellow=""
term_cyan="$(tput setaf 6)" term_blue=""
term_white="$(tput setaf 7)" term_magenta=""
term_reset="$(tput sgr0)" term_cyan=""
term_bright="$(tput bold || true)" term_white=""
term_dim="$(tput dim || true)" term_reset=""
term_bright=""
term_dim=""
else
term_red="$(tput setaf 1)"
term_green="$(tput setaf 2)"
term_yellow="$(tput setaf 3)"
term_blue="$(tput setaf 4)"
term_magenta="$(tput setaf 5)"
term_cyan="$(tput setaf 6)"
term_white="$(tput setaf 7)"
term_reset="$(tput sgr0)"
term_bright="$(tput bold || true)"
term_dim="$(tput dim || true)"
fi
# Check whether we have the 'colordiff' tool - if not, we'll revert to # Check whether we have the 'colordiff' tool - if not, we'll revert to
# boring regular 'diff'. # boring regular 'diff'.
......
...@@ -226,7 +226,7 @@ function install_requirements() { ...@@ -226,7 +226,7 @@ function install_requirements() {
local -a toinstall local -a toinstall
local def="${required_defs[$defindex]}" local def="${required_defs[$defindex]}"
local depfile="${environment}/${def}.deps" local depfile="${environment}/${def}.deps"
toinstall=($(comm -12 <(sed 's/[~@].*$//' "$reqfile") "$depfile")) toinstall=($(comm -12 <(sed 's/[~@].*$//' "$reqfile" | sort) "$depfile"))
debug " Checking $defindex - $def: ${toinstall[*]}" debug " Checking $defindex - $def: ${toinstall[*]}"
local -a promotedef local -a promotedef
...@@ -350,8 +350,10 @@ sed -E "s/^#.*//; /^ *$/d;" "${tmpinput}" \ ...@@ -350,8 +350,10 @@ sed -E "s/^#.*//; /^ *$/d;" "${tmpinput}" \
# Ensure that our environment is set up properly # Ensure that our environment is set up properly
echo "local::lib configuration" > "${log_file}"
mkdir -p "${environment}" mkdir -p "${environment}"
eval "$(SHELL=/bin/bash perl -f -M"local::lib=${environment}" 2> /dev/null)" eval "$(SHELL=/bin/bash perl -f -M"local::lib=${environment}" 2>> "${log_file}" | tee -a "${log_file}")"
if [ $? != 0 ] ; then if [ $? != 0 ] ; then
echo "Failed to create local::lib environment" echo "Failed to create local::lib environment"
exit 1 exit 1
...@@ -368,7 +370,7 @@ while [[ "$environment_name" == 'perllib' || ...@@ -368,7 +370,7 @@ while [[ "$environment_name" == 'perllib' ||
done done
echo "CPAN output" > "${log_file}" echo "CPAN output" >> "${log_file}"
# Ensure that we have a version of CPAN # Ensure that we have a version of CPAN
if ! check_module App::cpanminus 2>> "${log_file}" ; then if ! check_module App::cpanminus 2>> "${log_file}" ; then
......
...@@ -330,6 +330,7 @@ to_remove=($(diff <("${pip_tool}" list --disable-pip-version-check \ ...@@ -330,6 +330,7 @@ to_remove=($(diff <("${pip_tool}" list --disable-pip-version-check \
<((echo "$requirements_virtualenv" ; \ <((echo "$requirements_virtualenv" ; \
cut -d'=' -f 1 "${tmprequirements}") | sort) \ cut -d'=' -f 1 "${tmprequirements}") | sort) \
| grep '^<' \ | grep '^<' \
| grep -v 'pkg-resources' \
| cut -d' ' -f2)) | cut -d' ' -f2))
set -e set -e
if [[ "${#to_remove[@]}" != 0 ]] ; then if [[ "${#to_remove[@]}" != 0 ]] ; then
...@@ -349,8 +350,9 @@ fi ...@@ -349,8 +350,9 @@ fi
# Apply any site customization that may have been configured. # Apply any site customization that may have been configured.
pythonlib="$(python -c "import sys ; \ pythonlib="$(python -c "import sys ; import os.path ;\
print([path for path in sys.path if '$(basename "$environment")/lib' in path][0])" print([path for path in sys.path if '$(basename "$environment")/lib' in path \
and os.path.isdir(path)][0])"
2>/dev/null)" 2>/dev/null)"
if [[ "${pythonlib}" != '' ]] ; then if [[ "${pythonlib}" != '' ]] ; then
if [[ "${sitecustomize}" != '' ]] ; then if [[ "${sitecustomize}" != '' ]] ; then
......