diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-10-24 10:28:13 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-10-24 10:51:45 -0700 |
commit | bd8912c86fc3ef617e72e4cf59fb308dc06563ba (patch) | |
tree | 38454a2fc9f6b3520c44db3fed0d49d13cf522ac /t | |
parent | ccd4681cdd361f00b86d29e9d1b1ccae0e7d5079 (diff) | |
download | rainbows-bd8912c86fc3ef617e72e4cf59fb308dc06563ba.tar.gz |
It's more common form for externally-visible/modifiable variables in Makefiles and shell scripts.
Diffstat (limited to 't')
-rw-r--r-- | t/GNUmakefile | 10 | ||||
-rwxr-xr-x | t/test-lib.sh | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/t/GNUmakefile b/t/GNUmakefile index 16f6e36..e4e4f5a 100644 --- a/t/GNUmakefile +++ b/t/GNUmakefile @@ -2,11 +2,11 @@ all:: -ruby = ruby +RUBY = ruby rainbows_lib := $(shell cd ../lib && pwd) -include ../local.mk ifeq ($(RUBY_VERSION),) - RUBY_VERSION := $(shell $(ruby) -e 'puts RUBY_VERSION') + RUBY_VERSION := $(shell $(RUBY) -e 'puts RUBY_VERSION') endif ifeq ($(RUBYLIB),) @@ -50,11 +50,11 @@ endif run_test = $(quiet_pre) ( $(t_wrap) ) $(quiet_post) -test-bin-$(RUBY_VERSION)/rainbows: ruby_bin = $(shell which $(ruby)) +test-bin-$(RUBY_VERSION)/rainbows: ruby_bin = $(shell which $(RUBY)) test-bin-$(RUBY_VERSION)/rainbows: ../bin/rainbows mkdir -p $(@D) install -m 755 $^ $@+ - $(ruby) -i -p -e '$$_.gsub!(%r{^#!.*$$},"#!$(ruby_bin)")' $@+ + $(RUBY) -i -p -e '$$_.gsub!(%r{^#!.*$$},"#!$(ruby_bin)")' $@+ mv $@+ $@ req_random_blob := $(wildcard t?1??-*.sh) @@ -65,7 +65,7 @@ random_blob: $(req_random_blob): random_blob $(T): trash/.gitignore -$(T): export ruby := $(ruby) +$(T): export RUBY := $(RUBY) $(T): export PATH := $(CURDIR)/test-bin-$(RUBY_VERSION):$(PATH) $(T): test-bin-$(RUBY_VERSION)/rainbows $(run_test) diff --git a/t/test-lib.sh b/t/test-lib.sh index 34f0de1..b4ece30 100755 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -27,8 +27,8 @@ then esac fi -ruby="${ruby-'ruby'}" -RUBY_VERSION=${RUBY_VERSION-$($ruby -e 'puts RUBY_VERSION')} +RUBY="${RUBY-ruby}" +RUBY_VERSION=${RUBY_VERSION-$($RUBY -e 'puts RUBY_VERSION')} t_pfx=$PWD/trash/$T-$RUBY_VERSION set -u @@ -76,7 +76,7 @@ wait_for_pid () { require_check () { lib=$1 const=$2 - if ! $ruby -r$lib -e "puts $const" >/dev/null 2>&1 + if ! $RUBY -r$lib -e "puts $const" >/dev/null 2>&1 then echo >&2 "skipping $T since we don't have $lib" exit 0 |