diff --git a/script/test b/script/test index 2c6c50e5..bb29adca 100755 --- a/script/test +++ b/script/test @@ -6,7 +6,7 @@ function usage { cat <<-EOF USAGE - $0 [-dgGhv] [-f focus-string] + $0 [-dgGhv] [-f focus-string] [-s seed] OPTIONS @@ -22,6 +22,10 @@ OPTIONS -f run only tests whose description contain the given string + -s set the seed used to control random behavior + + -z pipe tests' stderr to `dot(1)`, to render an SVG log + EOF } @@ -33,7 +37,7 @@ target=tests export BUILDTYPE=Test cmd="out/${BUILDTYPE}/${target}" -while getopts "df:s:gGhpv" option; do +while getopts "df:s:gGhpvS" option; do case ${option} in h) usage @@ -61,6 +65,9 @@ while getopts "df:s:gGhpv" option; do s) export TREE_SITTER_SEED=${OPTARG} ;; + S) + mode=SVG + ;; esac done @@ -92,6 +99,11 @@ case ${mode} in fi ;; + SVG) + $cmd "${args[@]}" 2> >(dot -Tsvg > index.html) + echo "Wrote index.html" + ;; + normal) time $cmd "${args[@]}" ;;