summaryrefslogtreecommitdiff
path: root/setup-memcached-env.sh
blob: b71c7a05b24e8f3a5c9da7f771c0b4d3c4645369 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -x -e

function clean_exit(){
    local error_code="$?"
    local spawned=$(jobs -p)
    if [ -n "$spawned" ]; then
        kill $(jobs -p)
    fi
    return $error_code
}

trap "clean_exit" EXIT

memcached_bin=$(which memcached || true)
if [ -n "$memcached_bin" ]; then
    $memcached_bin -p 11212 &
fi

export TOOZ_TEST_MEMCACHED_URL="memcached://localhost:11212?timeout=5"
# Yield execution to venv command
$*