Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,12 @@ add_custom_target(
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)

set(ENVOY_TEST_EXTRA_SETUP_SCRIPT "" CACHE STRING
"extra setup script to call from run_envoy_tests.sh after basic setup")

add_custom_target(
${PROJECT_NAME}.check ${PROJECT_SOURCE_DIR}/test/run_envoy_tests.sh ${PROJECT_SOURCE_DIR}
${PROJECT_BINARY_DIR}
${PROJECT_BINARY_DIR} ${ENVOY_TEST_EXTRA_SETUP_SCRIPT}
DEPENDS envoy envoy-test envoy.generate_example_configs
)

Expand Down
21 changes: 20 additions & 1 deletion test/run_envoy_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,23 @@ set -e

SOURCE_DIR=$1
BINARY_DIR=$2
EXTRA_SETUP_SCRIPT=$3

# These directories have the Bazel meaning described at
# https://bazel.build/versions/master/docs/test-encyclopedia.html. In particular, TEST_SRCDIR is
# where we expect to find the generated outputs of various scripts preparing input data (these are
# not only the actual source files!).
# It is a precondition that both $TEST_TMPDIR and $TEST_SRCDIR are empty.
if [ -z "$TEST_TMPDIR" ] || [ -z "$TEST_SRCDIR" ]
then
TEST_BASE=/tmp/envoy_test
echo "Cleaning $TEST_BASE"
rm -rf $TEST_BASE
fi
: ${TEST_TMPDIR:=$TEST_BASE/tmp}
: ${TEST_SRCDIR:=$TEST_BASE/runfiles}
export TEST_TMPDIR TEST_SRCDIR

source $SOURCE_DIR/test/setup_test_env.sh
echo "TEST_TMPDIR=$TEST_TMPDIR"
echo "TEST_SRCDIR=$TEST_SRCDIR"

Expand All @@ -15,6 +30,10 @@ $SOURCE_DIR/test/certs/gen_test_certs.sh $TEST_SRCDIR/test/certs
$SOURCE_DIR/test/config/integration/gen_test_configs.sh $SOURCE_DIR/test/config/integration \
$TEST_SRCDIR/test/config/integration

if [ -n "$EXTRA_SETUP_SCRIPT" ]; then
$EXTRA_SETUP_SCRIPT
fi

# First run the normal unit test suite
cd $SOURCE_DIR
$RUN_TEST_UNDER $BINARY_DIR/test/envoy-test $EXTRA_TEST_ARGS
Expand Down
15 changes: 0 additions & 15 deletions test/setup_test_env.sh

This file was deleted.