2017-11-16 13:58:57 +01:00
|
|
|
%__rex_examples %{_docdir}/apache-rex/
|
|
|
|
|
|
|
|
%__rex_run_dir ./apache-rex
|
|
|
|
%__rex_logfile %{__rex_run_dir}/run_log
|
2019-05-29 15:38:36 +02:00
|
|
|
%__rex_verbosity 1
|
2017-11-16 13:58:57 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# macro: run supplied apache runnable example
|
|
|
|
#
|
|
|
|
# usage: %apache_rex_check [parameters] example_dir
|
|
|
|
#
|
|
|
|
# parameters: -r run_base_dir where to write examples output, logs, etc.
|
|
|
|
# default: see %{__rex_run_dir}
|
|
|
|
# -v verbosity verbosity of the output [0, 1, 2]
|
|
|
|
# default: see %{__rex_verbosity}
|
2019-05-29 15:38:36 +02:00
|
|
|
# -m module_path coma separated list; path(s) to additional modules (to be tested)
|
|
|
|
# default: ''
|
|
|
|
# -b binary_path coma separated list; path(s) to additional binaries (to be tested)
|
|
|
|
# default: ''
|
2017-11-16 13:58:57 +01:00
|
|
|
#
|
2019-05-29 15:38:36 +02:00
|
|
|
%apache_rex_check(r:,v:,m:,b:) \
|
|
|
|
EXAMPLE_DIRS="%{*}" \
|
|
|
|
if [ -z "$EXAMPLE_DIRS" ]; then \
|
2017-11-16 13:58:57 +01:00
|
|
|
echo "ERROR: no example dir provided" \
|
|
|
|
exit 1 \
|
|
|
|
fi \
|
2019-05-29 15:38:36 +02:00
|
|
|
EDS= \
|
|
|
|
for EXAMPLE_DIR in $EXAMPLE_DIRS; do \
|
2017-11-16 13:58:57 +01:00
|
|
|
if [ ! -d "$EXAMPLE_DIR" ]; then \
|
2019-05-29 15:38:36 +02:00
|
|
|
EXAMPLE_DIR="%{__rex_examples}$EXAMPLE_DIR" \
|
|
|
|
if [ ! -d "$EXAMPLE_DIR" ]; then \
|
|
|
|
echo "ERROR: example $EXAMPLE_DIR not found" \
|
|
|
|
exit 1 \
|
|
|
|
fi \
|
2017-11-16 13:58:57 +01:00
|
|
|
fi \
|
2019-05-29 15:38:36 +02:00
|
|
|
EDS="$EDS $EXAMPLE_DIR" \
|
|
|
|
done \
|
|
|
|
EXAMPLE_DIRS="$EDS" \
|
|
|
|
REX_RUN_DIR_BASE="%{-r:%{-r*}}" \
|
2017-11-16 13:58:57 +01:00
|
|
|
if [ -z "$REX_RUN_DIR" ]; then \
|
2019-05-29 15:38:36 +02:00
|
|
|
REX_RUN_DIR_BASE='%{__rex_run_dir}' \
|
2017-11-16 13:58:57 +01:00
|
|
|
fi \
|
2019-05-29 15:38:36 +02:00
|
|
|
mkdir -p $REX_RUN_DIR_BASE \
|
2017-11-16 13:58:57 +01:00
|
|
|
REX_VERBOSITY="%{-v:%{-v*}}" \
|
|
|
|
if [ -z "$REX_VERBOSITY" ]; then \
|
|
|
|
REX_VERBOSITY='%{__rex_verbosity}' \
|
|
|
|
fi \
|
2019-05-29 15:38:36 +02:00
|
|
|
REX_MODULE_PATH="%{-m:%{-m*}}" \
|
|
|
|
REX_BINARY_PATH="%{-b:%{-b*}}" \
|
|
|
|
VERBOSITY=$REX_VERBOSITY RUN_DIR_BASE=$REX_RUN_DIR_BASE MODULE_PATH=$REX_MODULE_PATH BINARY_PATH=$REX_BINARY_PATH run-rex $EXAMPLE_DIRS | tee %{__rex_logfile} \
|
2017-11-16 13:58:57 +01:00
|
|
|
%nil
|
|
|
|
|