wip tester

This commit is contained in:
asus
2023-02-17 12:44:05 +01:00
parent 84357f3462
commit b401ebb5ab
17 changed files with 648 additions and 185 deletions

21
tester.sh Normal file
View 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