about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-06-04 01:25:29 +0000
committerEric Wong <normalperson@yhbt.net>2010-06-04 01:36:30 +0000
commitf66c59d7b259e5784c9da87df1a6f1dbca160577 (patch)
tree50009f915932d0b423b114348095953a6f1257d0 /t
parente7690caedf80a1af2b6145d1b8f108ea42ee9a29 (diff)
downloadrainbows-f66c59d7b259e5784c9da87df1a6f1dbca160577.tar.gz
We don't need tmp/ in our top level directory
Diffstat (limited to 't')
-rw-r--r--t/.gitignore1
-rw-r--r--t/GNUmakefile22
-rw-r--r--t/test_isolate.rb39
3 files changed, 51 insertions, 11 deletions
diff --git a/t/.gitignore b/t/.gitignore
index 552f88a..ca24c05 100644
--- a/t/.gitignore
+++ b/t/.gitignore
@@ -3,3 +3,4 @@
 /random_blob
 /.dep+*
 /trash
+/tmp
diff --git a/t/GNUmakefile b/t/GNUmakefile
index 81484a7..955f273 100644
--- a/t/GNUmakefile
+++ b/t/GNUmakefile
@@ -15,12 +15,7 @@ ifeq ($(RUBY_VERSION),)
   $(error unable to detect RUBY_VERSION)
 endif
 
-ifeq ($(RUBYLIB),)
-  RUBYLIB := $(rainbows_lib)
-else
-  RUBYLIB := $(rainbows_lib):$(RUBYLIB)
-endif
-export RUBYLIB RUBY_VERSION
+export RUBY_VERSION
 
 models += WriterThreadPool
 models += WriterThreadSpawn
@@ -99,16 +94,21 @@ $(deps):
         @test -s $@.$(pid) || \
           { echo >&2 "E '$(dep_bin)' not found in PATH=$(PATH)"; exit 1; }
         @mv $@.$(pid) $@
-dep: $(deps)
-        $(MAKE) -C .. isolate
+
+libs := tmp/isolate/ruby-$(RUBY_VERSION)/.libs
+$(libs): test_isolate.rb
+        mkdir -p $(@D)
+        $(RUBY) $< > $@+
+        mv $@+ $@
+$(T): $(libs) $(deps) test-bin-$(RUBY_VERSION)/rainbows trash/.gitignore
 
 $(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 dep
-        $(TRACER) $(SHELL) $(SH_TEST_OPTS) $(script) $(TEST_OPTS)
+$(MODEL_T):
+        RUBYLIB=$(rainbows_lib):$$(cat $(libs)) \
+           $(TRACER) $(SHELL) $(SH_TEST_OPTS) $(script) $(TEST_OPTS)
 
 trash/.gitignore:
         mkdir -p $(@D)
diff --git a/t/test_isolate.rb b/t/test_isolate.rb
new file mode 100644
index 0000000..9e14b3f
--- /dev/null
+++ b/t/test_isolate.rb
@@ -0,0 +1,39 @@
+require 'rubygems'
+require 'isolate'
+
+path = "tmp/isolate/ruby-#{RUBY_VERSION}"
+opts = {
+  :system => false,
+  # we want "ruby-1.8.7" and not "ruby-1.8", so disable multiruby
+  :multiruby => false,
+  :path => path,
+}
+
+old_out = $stdout.dup
+$stdout.reopen($stderr)
+
+Isolate.now!(opts) do
+  gem 'rack', '1.1.0'
+  gem 'unicorn', '0.99.0'
+
+  gem 'iobuffer', '0.1.3'
+  gem 'rev', '0.3.2'
+
+  gem 'eventmachine', '0.12.10'
+
+  gem 'sinatra', '0.9.4'
+  gem 'async_sinatra', '0.1.5'
+
+  gem 'neverblock', '0.1.6.2'
+
+  if defined?(::Fiber)
+    gem 'case', '0.5'
+    gem 'revactor', '0.1.5'
+    gem 'rack-fiber_pool', '0.9.0'
+  end
+
+  gem 'cramp', '0.11'
+end
+
+$stdout.reopen(old_out)
+puts Dir["#{path}/gems/*-*/lib"].map { |x| File.expand_path(x) }.join(':')