Create parallel test runner script

This commit is contained in:
xenia 2020-02-03 18:36:30 -05:00
parent ba5d516f4e
commit f8d0547601
2 changed files with 17 additions and 1 deletions

16
scripts/ci.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
cd build
echo Running tests with $(nproc) threads...
ls tests | parallel "mkdir {}.d; cd {}.d; ../sim --router ../../router ../tests/{} &> test.log" &>/dev/null
echo Complete
for x in $(ls tests); do
if cat $x.d/*.log | grep PASS &>/dev/null; then
tput setaf 2
echo $x pass
else
tput setaf 1
echo $x fail
fi
tput sgr0
done

View File

@ -4,4 +4,4 @@ rm /etc/resolv.conf
echo "nameserver 8.8.8.8" > /etc/resolv.conf echo "nameserver 8.8.8.8" > /etc/resolv.conf
cd $1 cd $1
export LD_LIBRARY_PATH=/usr/local/lib export LD_LIBRARY_PATH=/usr/local/lib
/usr/local/bin/python3.6 sim --router ../router milestone /usr/local/bin/python3.6 sim --router ../router all