Skip to content

Commit 1db0b4d

Browse files
committed
address the concern in ap#127 by canonicalizing the path
also made the default run (all test files) work from any directory
1 parent 5dda713 commit 1db0b4d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/bench

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/sh
2-
set -e
32
s=startuptime.txt
4-
[ $# = 0 ] && set -- *.* # default to all files with a dot
3+
this=$(realpath "$0" 2>/dev/null || readlink -f "$0")
4+
[ $# = 0 ] && cd "${this%/*}" && set -- *.* # default to all files with a dot
5+
target="${this%/tests/*}/after/syntax/css.vim"
56
[ $# -gt 1 ] && multi=1 || multi=
67
for sample in "$@"; do
78
vim --startuptime $s -c qa "$sample"
8-
run=$(awk '/\/after\/syntax\/css\.vim$/ {sum += $2} END {print sum}' "$s")
9+
run=$(awk -v t="$target" 'index($0, t) {sum += $2} END {print sum}' "$s")
910
rm $s
1011
echo "$run${multi:+\t$sample}"
1112
total="${total:-0} + ${run:-0}"

0 commit comments

Comments
 (0)