From 6c1e02f8cd8d823b80178c7372e6776229d62221 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 26 Oct 2009 12:08:07 -0700 Subject: tests: error out if socat + curl aren't reachable This makes it easier to figure out why tests are failing for people that forget to read t/README --- t/.gitignore | 1 + t/GNUmakefile | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3-24-ge0c7