| 1 | #!/usr/bin/env bash | 
| 2 | # | 
| 3 | # Usage: | 
| 4 | # benchmarks/tokens.sh <function name> | 
| 5 | |
| 6 | set -o nounset | 
| 7 | set -o pipefail | 
| 8 | set -o errexit | 
| 9 | |
| 10 | # See if tokens blow up by doing creating Id.Lit_Slash | 
| 11 | |
| 12 | count-tokens() { | 
| 13 | local osh=_bin/cxx-opt/osh | 
| 14 | ninja $osh | 
| 15 | |
| 16 | for file in benchmarks/testdata/*; do | 
| 17 | echo $file | 
| 18 | |
| 19 | # It prints the number of tokens | 
| 20 | $osh --tool tokens $file >/dev/null | 
| 21 | done | 
| 22 | } | 
| 23 | |
| 24 | "$@" |