From f8d0547601ff608e1520721d6332c617388e7a6d Mon Sep 17 00:00:00 2001 From: haskal Date: Mon, 3 Feb 2020 18:36:30 -0500 Subject: [PATCH] Create parallel test runner script --- scripts/ci.sh | 16 ++++++++++++++++ scripts/run-tests.sh | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 scripts/ci.sh diff --git a/scripts/ci.sh b/scripts/ci.sh new file mode 100755 index 0000000..aab72b9 --- /dev/null +++ b/scripts/ci.sh @@ -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 diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 2651024..1428919 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -4,4 +4,4 @@ rm /etc/resolv.conf echo "nameserver 8.8.8.8" > /etc/resolv.conf cd $1 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