Commit 513ce474 authored by Millian Poquet's avatar Millian Poquet

[ci] run-tests: manage redis-server

parent f8e00d12
#!/usr/bin/env nix-shell
#! nix-shell -i bash ./default.nix
# TODO: manage redis-server here
# Run a redis server if needed
redis_launched_here=0
r=$(ps faux | grep redis-server | grep -v grep | wc -l)
if [ $r -eq 0 ]
then
echo "Running a Redis server..."
redis-server>/dev/null &
redis_launched_here=1
while ! nc -z localhost 6379; do
sleep 1
done
fi
# Add built batsim in PATH
export PATH=$(realpath ./build):${PATH}
......@@ -9,3 +21,13 @@ export PATH=$(realpath ./build):${PATH}
# Execute the tests
cd build
ctest
failed=$?
# Stop the redis server if it has been launched by this script
if [ $redis_launched_here -eq 1 ]
then
echo "Stopping the Redis server..."
killall redis-server
fi
exit ${failed}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment