about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-26 12:08:07 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-26 12:11:53 -0700
commit6c1e02f8cd8d823b80178c7372e6776229d62221 (patch)
treef1f945879031d8376b82a78e5f0e572ae99f1e0b
parentf51041d4e6ddfddc717b542660f02f8eeb81a0b4 (diff)
downloadrainbows-6c1e02f8cd8d823b80178c7372e6776229d62221.tar.gz
This makes it easier to figure out why tests are failing
for people that forget to read t/README
-rw-r--r--t/.gitignore1
-rw-r--r--t/GNUmakefile12
2 files changed, 12 insertions, 1 deletions
diff --git a/t/.gitignore b/t/.gitignore
index 3003730..bee30c6 100644
--- a/t/.gitignore
+++ b/t/.gitignore
@@ -1,3 +1,4 @@
 /test-results-*
 /test-bin-*
 /random_blob
+/.dep+*
diff --git a/t/GNUmakefile b/t/GNUmakefile
index 5084643..d1b09cf 100644
--- a/t/GNUmakefile
+++ b/t/GNUmakefile
@@ -73,12 +73,22 @@ random_blob:
 
 $(T): random_blob
 
+dependencies := socat curl
+deps := $(addprefix .dep+,$(dependencies))
+$(deps): dep_bin = $(lastword $(subst +, ,$@))
+$(deps):
+        @which $(dep_bin) > $@+ 2>/dev/null || :
+        @test -s $@+ || \
+          { echo >&2 "E `$(dep_bin)' not found in PATH=$(PATH)"; exit 1; }
+        @mv $@+ $@
+dep: $(deps)
+
 $(MODEL_T): export model = $(firstword $(subst ., ,$@))
 $(MODEL_T): script = $(subst $(model).,,$@)
 $(MODEL_T): trash/.gitignore
 $(MODEL_T): export RUBY := $(RUBY)
 $(MODEL_T): export PATH := $(CURDIR)/test-bin-$(RUBY_VERSION):$(PATH)
-$(MODEL_T): test-bin-$(RUBY_VERSION)/rainbows
+$(MODEL_T): test-bin-$(RUBY_VERSION)/rainbows dep
         $(TRACER) $(SHELL) $(SH_TEST_OPTS) $(script) $(TEST_OPTS)
 
 trash/.gitignore: