wip tester
This commit is contained in:
21
tester.sh
Normal file
21
tester.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
port=0
|
||||
while [ $port -lt 1024 -o $port -gt 10000 ]; do
|
||||
port=$RANDOM
|
||||
done
|
||||
echo "Running tests on port $port..."
|
||||
|
||||
clang -Wall -Wextra -Werror mini_serv.c -o mini_serv
|
||||
|
||||
./mini_serv "$port" &
|
||||
nc localhost "$port" &
|
||||
|
||||
for i in {1..30}
|
||||
do
|
||||
nc localhost "$port" &
|
||||
kill -KILL $(pidof nc | tr ' ' '\n' | head -n1)
|
||||
done
|
||||
|
||||
killall -q mini_serv nc
|
||||
|
||||
Reference in New Issue
Block a user