Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- RED='\033[0;31m'
- GREEN='\033[0;32m'
- WHITE='\033[0;37m'
- if [ "$#" -ne 3 ]
- then
- echo "usage: $0 path_to_key nb_team nb_players_per_team"
- exit 1
- fi
- ./lemipc $1 0 &
- pids=$!
- for teamNb in $(eval echo {1..$2})
- do
- for playerNb in $(eval echo {1..$3})
- do
- ./lemipc $1 $teamNb > /dev/null &
- pids+=" $!"
- done
- done
- failed=0
- for p in $pids
- do
- if ! wait $p
- then
- echo -e "${RED}Process with pid $p Stopped with bad exit code${WHITE}"
- failed=1
- fi
- done
- if [ $failed -eq 1 ]
- then
- echo -e "${RED}Tests Failed !${WHITE}"
- exit 1
- else
- echo -e "${GREEN}Tests were successful !${WHITE}"
- exit 0
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement