Browse files

Make it easy to run-tests with diff. vim versions

  • Loading branch information...
1 parent 51364dd commit 4a6bd9bff4b7b58654887ecb70ebf49a8164455b @sjbach committed Sep 25, 2010
View
2 tests/buffer-explorer-view/expect
@@ -1,4 +1,4 @@
-spawn view -N --noplugin -u ../vimrc
+spawn $env(VIEW) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/buffer-explorer/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/buffer-grep-explorer/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/buffer-modified/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/file-as-dir/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/filesystem-explorer-from-here-view/expect
@@ -1,4 +1,4 @@
-spawn view -N --noplugin -u ../vimrc
+spawn $env(VIEW) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/filesystem-explorer-from-here/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/filesystem-explorer-view/expect
@@ -1,4 +1,4 @@
-spawn view -N --noplugin -u ../vimrc
+spawn $env(VIEW) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/filesystem-explorer/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/juggler-letters/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/juggler-more-than-10/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/juggler-no-other-buffers/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/juggler-numbers/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/juggler-out-of-bounds/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/longest-common-prefix/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/open-all/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/recurse-no-selection/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/root-navigation-nonexistent-file/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
2 tests/root-navigation/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}
View
35 tests/run-tests.bash
@@ -1,9 +1,42 @@
#!/bin/bash
+case "$1" in
+ -h|--help)
+ echo '[VIM=path/to/vim] ./run-tests.bash [test-dir]'
+ exit 0
+ ;;
+ ?*)
+ if [ -d "$1" ]; then
+ test_dirs="$1"
+ else
+ echo "Error: $1 unknown"
+ exit 1
+ fi
+esac
+
+if [ ! "$VIM" ]; then
+ export VIM=`which vim`
+fi
+
+export VIEW=${VIM%/*}/view
+
export DISPLAY=
+
+vim_version=$($VIM --version | head -n1)
+ruby_version=$($VIM --version | grep -- '-lruby' | \
+ sed 's/.*-lruby\([^ ]*\).*/\1/')
+
+echo "Testing against:"
+echo " $vim_version"
+echo " Ruby: $ruby_version"
+
failures=
-for dir in */; do
+if [ ! "$test_dirs" ]; then
+ test_dirs=*/
+fi
+
+for dir in $test_dirs; do
cd $dir
if ! expect -f expect; then
echo "fail: $dir"
View
2 tests/single-quote/expect
@@ -1,4 +1,4 @@
-spawn vim -N --noplugin -u ../vimrc
+spawn $env(VIM) -N --noplugin -u ../vimrc
set timeout 3
expect {
timeout {exit 1}

0 comments on commit 4a6bd9b

Please sign in to comment.