Skip to content

Commit

Permalink
add a script to run the tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
hoijui committed Apr 27, 2019
1 parent 095052d commit 39e60be
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions runTutorials.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
# Runs all the Escher tutorials.
# Requires the `escher` command available on the PATH.

which escher > /dev/null
if [ $? -ne 0 ]
then
>&2 echo "Error: Could not find 'escher' in PATH"
exit 1
fi

src_dir="$GOPATH/src/github.com/gocircuit/escher/src/"
tutorial_circuits="ShowIndex HelloWorld Break Debug Exec File TextMerge"

for circuit in $tutorial_circuits
do
# run each tutorial for at most 2 seconds
echo
echo
echo "################################################################################"
echo "### Running Escher tutorial $circuit ..."
echo "--------------------------------------------------------------------------------"
timeout --foreground --kill-after=2 --signal=SIGINT 3s \
escher -src "$src_dir" "*tutorial.$circuit"
echo
echo "################################################################################"
done

0 comments on commit 39e60be

Please sign in to comment.