Add a script to help making bulk updates of the tests (#914)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
This commit is contained in:
parent
f7a4e517fe
commit
90cdae96b2
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This scripts aims to make it easier to do a bulk update of all the
|
||||||
|
# tests. Simply run it in a terminal and fix the test that's currently
|
||||||
|
# failing. The script will automatically switch to the next test when
|
||||||
|
# the current test succeeds. It uses inotifywait to detect changes to
|
||||||
|
# the test.
|
||||||
|
|
||||||
|
DUNE=_build/default/bin/main.exe
|
||||||
|
|
||||||
|
LIST=$(mktemp)
|
||||||
|
trap "rm -f $LIST" EXIT
|
||||||
|
|
||||||
|
echo "Computing the list of failing tests..."
|
||||||
|
$DUNE runtest test/blackbox-tests \
|
||||||
|
--diff-command "echo >> $LIST" --dev &> /dev/null
|
||||||
|
TESTS=$(cat /tmp/list |cut -d/ -f4 |sed 's/^//')
|
||||||
|
rm -f $LIST
|
||||||
|
|
||||||
|
count=0
|
||||||
|
for t in $TESTS; do
|
||||||
|
let count++
|
||||||
|
done
|
||||||
|
|
||||||
|
i=1
|
||||||
|
for t in $TESTS; do
|
||||||
|
n=0
|
||||||
|
while true; do
|
||||||
|
clear
|
||||||
|
let n++
|
||||||
|
title="[$i/$count] $t (run $n)"
|
||||||
|
echo "$title"
|
||||||
|
echo "${title//?/=}"
|
||||||
|
echo
|
||||||
|
$DUNE build --dev @test/blackbox-tests/$t && break
|
||||||
|
inotifywait $(find test/blackbox-tests/test-cases/$t -type d) \
|
||||||
|
-e modify,attrib,close_write,move,create,delete
|
||||||
|
done
|
||||||
|
done
|
Loading…
Reference in New Issue